Socket
Socket
Sign inDemoInstall

@solace-community/angular-solace-message-client

Package Overview
Dependencies
Maintainers
3
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@solace-community/angular-solace-message-client - npm Package Compare versions

Comparing version 13.0.0 to 13.1.0

esm2020/lib/logger.mjs

29

lib/ɵsolace-message-client.d.ts

@@ -1,8 +0,10 @@

import { NgZone, OnDestroy } from '@angular/core';
import { Injector, NgZone, OnDestroy } from '@angular/core';
import { Observable } from 'rxjs';
import { BrowseOptions, ConsumeOptions, Data, MessageEnvelope, ObserveOptions, PublishOptions, SolaceMessageClient } from './solace-message-client';
import { BrowseOptions, ConsumeOptions, Data, MessageEnvelope, ObserveOptions, PublishOptions, RequestOptions, SolaceMessageClient } from './solace-message-client';
import { TopicMatcher } from './topic-matcher';
import { SolaceSessionProvider } from './solace-session-provider';
import { SolaceMessageClientConfig } from './solace-message-client.config';
import { Message, MessageConsumerProperties, QueueBrowserProperties, Session } from './solace.model';
import { Destination, Message, MessageConsumerProperties, QueueBrowserProperties, Session } from 'solclientjs';
import './solclientjs-typedef-augmentation';
import { Logger } from './logger';
import * as i0 from "@angular/core";

@@ -12,2 +14,4 @@ export declare class ɵSolaceMessageClient implements SolaceMessageClient, OnDestroy {

private _topicMatcher;
private _injector;
private _logger;
private _zone;

@@ -22,6 +26,11 @@ private _message$;

connected$: Observable<boolean>;
constructor(config: SolaceMessageClientConfig, _sessionProvider: SolaceSessionProvider, _topicMatcher: TopicMatcher, _zone: NgZone);
connect(config: SolaceMessageClientConfig): Promise<void>;
constructor(config: SolaceMessageClientConfig, _sessionProvider: SolaceSessionProvider, _topicMatcher: TopicMatcher, _injector: Injector, _logger: Logger, _zone: NgZone);
connect(config: SolaceMessageClientConfig): Promise<Session>;
/**
* Provides the OAuth access token as configured in {@link SolaceMessageClientConfig#accessToken} as Observable.
* The Observable errors if not using OAUTH2 authentication scheme, or if no token/provider is configured.
*/
private provideOAuthAccessToken$;
disconnect(): Promise<void>;
private dispose;
dispose(): void;
observe$(topic: string, options?: ObserveOptions): Observable<MessageEnvelope>;

@@ -40,5 +49,7 @@ /**

private createQueueBrowser$;
publish(topic: string, data?: Data | Message, options?: PublishOptions): Promise<void>;
publish(destination: string | Destination, data?: Data | Message, options?: PublishOptions): Promise<void>;
request$(destination: string | Destination, data?: Data | Message, options?: RequestOptions): Observable<MessageEnvelope>;
reply(request: Message, data?: Data | Message, options?: PublishOptions): Promise<void>;
enqueue(queue: string, data?: Data | Message, options?: PublishOptions): Promise<void>;
private sendToDestination;
private sendMessage;
get session(): Promise<Session>;

@@ -59,4 +70,4 @@ /**

ngOnDestroy(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<ɵSolaceMessageClient, [{ optional: true; }, null, null, null]>;
static ɵfac: i0.ɵɵFactoryDeclaration<ɵSolaceMessageClient, [{ optional: true; }, null, null, null, null, null]>;
static ɵprov: i0.ɵɵInjectableDeclaration<ɵSolaceMessageClient>;
}

@@ -0,1 +1,2 @@

import { Logger } from './logger';
export declare type Task<T> = () => Promise<T>;

@@ -11,3 +12,3 @@ /**

private _tasks$;
constructor();
constructor(logger: Logger);
/**

@@ -14,0 +15,0 @@ * Schedules the given task for serial execution.

@@ -1,6 +0,18 @@

import { SessionProperties } from './solace.model';
import { MessagePublisherProperties, SessionProperties } from 'solclientjs';
import { Type } from '@angular/core';
import { OAuthAccessTokenProvider } from './oauth-access-token-provider';
/**
* Configures the {@link SolaceMessageClient} to connect to the Solace message broker.
*/
export declare abstract class SolaceMessageClientConfig implements SessionProperties {
export declare abstract class SolaceMessageClientConfig implements Omit<SessionProperties, 'publisherProperties' | 'accessToken'> {
publisherProperties?: MessagePublisherProperties;
/**
* Specifies the access token required for OAUTH2 authentication.
* This is only relevant if the {@link AuthenticationScheme#OAUTH2} authentication scheme is being used.
*
* We recommend specifying a {@link OAuthAccessTokenProvider} to continuously provide a valid access token.
*
* See {@link OAuthAccessTokenProvider} for detailed instructions how to create and register an access provider.
*/
accessToken?: string | Type<OAuthAccessTokenProvider>;
}

@@ -10,3 +22,13 @@ /**

*/
export interface SolaceMessageClientConfig extends SessionProperties {
export interface SolaceMessageClientConfig extends Omit<SessionProperties, 'publisherProperties' | 'accessToken'> {
publisherProperties?: MessagePublisherProperties;
/**
* Specifies the access token required for OAUTH2 authentication.
* This is only relevant if the {@link AuthenticationScheme#OAUTH2} authentication scheme is being used.
*
* We recommend using a {@link OAuthAccessTokenProvider} to continuously provide a valid access token.
*
* See {@link OAuthAccessTokenProvider} for detailed instructions how to create and register an access provider.
*/
accessToken?: string | Type<OAuthAccessTokenProvider>;
}
import { BehaviorSubject, Observable, OperatorFunction } from 'rxjs';
import { Message, MessageConsumer, MessageConsumerProperties, MessageDeliveryModeType, QueueBrowserProperties, SDTField, Session } from './solace.model';
import { Destination, Message, MessageConsumer, MessageConsumerProperties, MessageDeliveryModeType, QueueBrowserProperties, SDTField, Session } from 'solclientjs';
import { SolaceMessageClientConfig } from './solace-message-client.config';

@@ -30,6 +30,6 @@ import * as i0 from "@angular/core";

*
* @return Promise that resolves when connected to the broker, or that rejects if the connection attempt failed.
* @return Promise that resolves to the {@link Session} when connected to the broker, or that rejects if the connection attempt failed.
* If already connected, the Promise resolves immediately.
*/
abstract connect(config: SolaceMessageClientConfig): Promise<void>;
abstract connect(config: SolaceMessageClientConfig): Promise<Session>;
/**

@@ -82,5 +82,7 @@ * Disconnects this client from the Solace message broker. Has no effect if already disconnected.

/**
* Consumes messages from a given topic endpoint or queue endpoint. Endpoint names are case-sensitive and consist of one or more segments, each separated by a forward slash.
* Consumes messages from a given topic endpoint or queue endpoint.
*
* If passing a `string` topic literal (that is, not a {@link MessageConsumerProperties} object), creates a private, non-durable topic endpoint on the broker that subscribes
* Endpoint names are case-sensitive and consist of one or more segments, each separated by a forward slash.
*
* When passing a `string` topic literal (that is, not a {@link MessageConsumerProperties} object), creates a private, non-durable topic endpoint on the broker that subscribes
* to messages published to the given topic. From the consumer's point of view, this is similar to observe a topic using {@link SolaceMessageClient#observe$}, with the difference

@@ -90,6 +92,2 @@ * that messages are not lost in the event of short connection interruptions as messages are retained on the broker until transported to the consumer. The lifecycle of a non-durable

*
* It is important to understand that a topic is not the same thing as a topic endpoint. A topic is a message property the event broker uses to route a message to its destination.
* Topic endpoints, unlike topics, are objects that define the storage of messages for a consuming application. Topic endpoints are more closely related to queues than to topics.
* Messages cannot be published directly to topic endpoints, but only indirectly via topics. For more information, refer to https://solace.com/blog/queues-vs-topic-endpoints.
*
* To subscribe to a queue, or to pass a more advanced endpoint configuration, pass a {@link MessageConsumerProperties} object instead.

@@ -101,3 +99,3 @@ *

* solaceMessageClient.consume$({
* topicEndpointSubscription: SolaceObjectFactory.createTopicDestination('topic'),
* topicEndpointSubscription: SolclientFactory.createTopicDestination('topic'),
* queueDescriptor: {

@@ -120,2 +118,8 @@ * type: QueueType.TOPIC_ENDPOINT,

*
* ## Topic vs Topic Endpoint
* A topic is not the same thing as a topic endpoint. Messages cannot be published directly to topic endpoints, but only indirectly via topics.
* A topic is a message property the event broker uses to route a message to its destination. Topic endpoints, unlike topics, are objects that define the storage of messages
* for a consuming application. Topic endpoints are more closely related to queues than to topics.
* For more information, refer to https://solace.com/blog/queues-vs-topic-endpoints.
*
* For topic endpoints, you can subscribe to multiple topics simultaneously by using wildcard segments in the topic.

@@ -157,11 +161,21 @@ *

/**
* Publishes a message to the given topic destination. The message is transported to all consumers subscribed to the topic.
* Publishes a message to the given topic or queue destination.
*
* It is important to understand that a topic is not the same thing as a topic endpoint. A topic is a message property the event broker uses to route a message to its destination.
* Topic endpoints, unlike topics, are objects that define the storage of messages for a consuming application and need administratively configured on the event broker. Topic endpoints
* are more closely related to queues than to topics. Messages cannot be published directly to topic endpoints, but only indirectly via topics.
* ## Topic Destination
* When sending the message to a topic destination, the broker will transport the message to all subscribers subscribed to the topic at the time of sending the message.
*
* ## Queue Destination
* A queue differs from the topic distribution mechanism that the message is transported to exactly a single consumer, i.e., the message is load balanced to a single consumer
* in round‑robin fashion, or for exclusive queues, it is always transported to the same subscription. When sending a message to a queue, the broker retains the message until
* it is consumed, or until it expires. Refer to the subsequent chapter 'Durability of Endpoints' for more information.
* A queue is typically used in a point-to-point (P2P) messaging environment.
*
* ## Topic vs Topic Endpoint
* A topic is not the same thing as a topic endpoint. Messages cannot be published directly to topic endpoints, but only indirectly via topics.
* A topic is a message property the event broker uses to route a message to its destination. Topic endpoints, unlike topics, are objects that define the storage of messages
* for a consuming application. Topic endpoints are more closely related to queues than to topics.
* For more information, refer to https://solace.com/blog/queues-vs-topic-endpoints.
*
* ## Topic destination name
* Topics are case-sensitive and consist of one or more segments, each separated by a forward slash. The topic name must be exact, thus not contain wildcards.
* ## Destination Name
* Destinations case-sensitive and consist of one or more segments, each separated by a forward slash. The destination must be exact, thus not contain wildcards.
*

@@ -179,6 +193,21 @@ * ## Payload

*
* @param topic - Specifies the topic to which the message should be published.
* ## Durability of Queue Endpoints
* Solace distinguishes between durable und non-durable queues.
*
* When sending the message to a durable queue, the broker retains the message until it is consumed (and also acknowledged) by the consumer, or until
* it expires. In constract, a non-durable queue, also known as a temporary queue, has a shorter lifecycle than a durable queue. It has the lifespan
* of the client that created it, with an additional 60 seconds in case of unexpected disconnect. The 60 seconds provides the client with some time to
* reconnect to the endpoint before it and its contents are deleted from the Solace broker.
*
* Although the terms durable and persistent are related, keep in mind that the concept 'durability' applies to endpoints, whereas 'persistence'
* applies to event messages.
*
* For further information refer to:
* - https://docs.solace.com/PubSub-Basics/Endpoints.htm
* - https://solace.com/blog/solace-endpoints-durable-vs-non-durable
*
* @param destination - Specifies the destination where to send the message to. If of the type `string`, sends it to a topic destination.
* @param data - Specifies optional {@link Data transfer data} to be carried along with this message. A message may contain unstructured byte data,
* or structured data in the form of a {@link SDTField}. Alternatively, to have full control over the message to be published, pass the
* {@link Message} object instead, which you can construct using {@link SolaceObjectFactory#createMessage}.
* {@link Message} object instead, which you can construct using {@link SolclientFactory#createMessage}.
* For more information, refer to the documentation of {@link Data}.

@@ -188,4 +217,39 @@ * @param options - Controls how to publish the message.

*/
abstract publish(topic: string, data?: Data | Message, options?: PublishOptions): Promise<void>;
abstract publish(destination: string | Destination, data?: Data | Message, options?: PublishOptions): Promise<void>;
/**
* Sends a request to the specified destination and waits for the response to arrive.
*
* - If sending the request to a topic, the request is transported to all subscribers subscribed to the topic at the time of sending the request.
* - If sending the request to a queue, the request is transported to a single subscriber. The request is retained if there was no subscriber
* at the time of sending the request.
* - If not receiving a reply within the specified (or globally set) timeout, then the Observable will error.
* - If not passing a 'replyTo' destination via options object, the API will generate a 'replyTo' destination where to send the reply to.
*
* Note:
* The implementation is based on "solclientjs" {@link Session#sendRequest} which does not support receiving multiple responses
* and requires the replier to include the requestor's `correlationId` in the reply message.
*
* @param destination - Specifies the destination where to send the message to. If of the type `string`, sends it to a topic destination.
* @param data - Specifies optional {@link Data transfer data} to be carried along with this request. The request may contain unstructured byte data,
* or structured data in the form of a {@link SDTField}. Alternatively, to have full control over the message to be published, pass the
* {@link Message} object instead, which you can construct using {@link SolclientFactory#createMessage}.
* For more information, refer to the documentation of {@link Data}.
* @param options - Controls how to publish the request, e.g., to pass a custom 'replyTo' destination.
* @return Observable that emits the received reply and then completes, or that errors if the request could not be dispatched or no reply was received
* within the specified timeout.
*/
abstract request$(destination: string | Destination, data?: Data | Message, options?: RequestOptions): Observable<MessageEnvelope>;
/**
* Replies to the passed request.
*
* @param request - Specifies the request to send a reply for.
* @param data - Specifies optional {@link Data transfer data} to be carried along with the reply. The reply may contain unstructured byte data,
* or structured data in the form of a {@link SDTField}. Alternatively, to have full control over the message to be published, pass the
* {@link Message} object instead, which you can construct using {@link SolclientFactory#createMessage}.
* For more information, refer to the documentation of {@link Data}.
* @param options - Controls how to publish the reply.
* @return A Promise that resolves when dispatched the reply, or that rejects if the reply could not be dispatched.
*/
abstract reply(request: Message, data?: Data | Message, options?: PublishOptions): Promise<void>;
/**
* Sends a message to the given queue destination. A queue is typically used in a point-to-point (P2P) messaging environment.

@@ -229,6 +293,8 @@ *

* or structured data in the form of a {@link SDTField}. Alternatively, to have full control over the message to be published, pass the
* {@link Message} object instead, which you can construct using {@link SolaceObjectFactory#createMessage}.
* {@link Message} object instead, which you can construct using {@link SolclientFactory#createMessage}.
* For more information, refer to the documentation of {@link Data}.
* @param options - Controls how to publish the message.
* @return A Promise that resolves when dispatched the message, or that rejects if the message could not be dispatched.
*
* @deprecated This API will be removed in version 14.0.0. Instead, use {@link #publish} passing a queue destination, as follows: `solaceMessageClient.publish(SolclientFactory.createDurableQueueDestination('queue'))`
*/

@@ -247,6 +313,8 @@ abstract enqueue(queue: string, data?: Data | Message, options?: PublishOptions): Promise<void>;

browse$(queueOrDescriptor: string | (QueueBrowserProperties & BrowseOptions)): Observable<MessageEnvelope>;
publish(topic: string, data?: ArrayBufferLike | DataView | string | SDTField | Message, options?: PublishOptions): Promise<void>;
publish(destination: string | Destination, data?: ArrayBufferLike | DataView | string | SDTField | Message, options?: PublishOptions): Promise<void>;
request$(destination: string | Destination, data?: Data | Message, options?: RequestOptions): Observable<MessageEnvelope>;
reply(request: Message, data?: ArrayBufferLike | DataView | string | SDTField | Message, options?: PublishOptions): Promise<void>;
enqueue(queue: string, data?: ArrayBufferLike | DataView | string | SDTField | Message, options?: PublishOptions): Promise<void>;
get session(): Promise<Session>;
connect(config: SolaceMessageClientConfig): Promise<void>;
connect(config: SolaceMessageClientConfig): Promise<Session>;
disconnect(): Promise<void>;

@@ -261,7 +329,14 @@ static ɵfac: i0.ɵɵFactoryDeclaration<NullSolaceMessageClient, never>;

/**
* The request timeout period (in milliseconds).
* If specified, this value overwrites readTimeoutInMsecs property in {@link SessionProperties}.
* Specifies the maximum time (in milliseconds) to wait for the destination to be subscribed.
* If specified, overrides the global timeout as set via {@link SessionProperties#readTimeoutInMsecs}.
*
* @deprecated This API will be removed in a future release. Instead, use {@link #subscribeTimeout} instead.
*/
requestTimeout?: number;
/**
* Specifies the maximum time (in milliseconds) to wait for the destination to be subscribed.
* If specified, overrides the global timeout as set via {@link SessionProperties#readTimeoutInMsecs}.
*/
subscribeTimeout?: number;
/**
* Controls if to emit received messages inside or outside of the Angular zone.

@@ -333,3 +408,3 @@ * If emitted outside of the Angular zone no change detection cycle is triggered.

* different to `string`, `boolean` or `number`, pass it as Structured Data Type (SDT) in the
* form of a {@link SDTField}, as following: `SolaceObjectFactory.createSDTField(SDTFieldType.INT8, 2);`
* form of a {@link SDTField}, as following: `SDTField.create(SDTFieldType.INT8, 2);`
*

@@ -416,2 +491,4 @@ * Header values are mapped as following to structured data types:

* A correlation ID is a unique identifier value that is attached to a message that allows referencing to a particular transaction or event chain.
*
* If replying to a request via {@link SolaceMessageClient#reply}, the API will copy the correlation id from the request, thus must not be set manually.
*/

@@ -425,5 +502,34 @@ correlationId?: string;

*/
correlationKey?: string;
correlationKey?: string | object;
/**
* Sets the destination a replier can reply to in "request-response" communication.
*
* If not passed the API will generate a 'replyTo' destination where to send the reply to.
*/
replyTo?: Destination;
/**
* Marks this message as a reply to a previous request in "request-response" communication.
*
* If replying to a request via {@link SolaceMessageClient#reply}, the API will mark the message as a reply, thus must not be set manually.
*/
markAsReply?: boolean;
}
/**
* Control how to publish a request.
*/
export interface RequestOptions extends PublishOptions {
/**
* Specifies the maximum time (in milliseconds) to wait for a response to be received. The minimum value is 100ms.
* If specified, overrides the global timeout as set via {@link SessionProperties#readTimeoutInMsecs}.
*/
requestTimeout?: number;
/**
* Controls if to emit received replies inside or outside of the Angular zone.
* If emitted outside of the Angular zone no change detection cycle is triggered.
*
* By default, if not specified, emits inside the Angular zone.
*/
emitOutsideAngularZone?: boolean;
}
/**
* RxJS operator for mapping a structured text message into its textual representation.

@@ -493,3 +599,3 @@ *

*
* Example: `SolaceObjectFactory.createSDTField(SDTFieldType.STRING, 'payload')`
* Example: `SDTField.create(SDTFieldType.STRING, 'payload')`
*

@@ -496,0 +602,0 @@ * https://solace.com/blog/inside-solace-message-introduction/

@@ -60,2 +60,12 @@ import { InjectionToken, ModuleWithProviders } from '@angular/core';

* ```
*
* #### Log Level
* The default log level is set to 'WARN' so that only warnings and errors are logged.
*
* The default log level can be changed as follows:
* - Change the log level programmatically by providing it under the DI token {@link LogLevel}:
* `{provide: LogLevel, useValue: LogLevel.DEBUG}`
* - Change the log level at runtime via session storage by adding the following entry and then reloading the application:
* key: `angular-solace-message-client#loglevel`
* value: `debug` // supported values are: trace | debug | info | warn | error | fatal
*/

@@ -62,0 +72,0 @@ export declare class SolaceMessageClientModule {

@@ -1,2 +0,2 @@

import { Session, SessionProperties } from './solace.model';
import { Session, SessionProperties } from 'solclientjs';
import * as i0 from "@angular/core";

@@ -3,0 +3,0 @@ /**

@@ -1,2 +0,2 @@

import { Destination } from './solace.model';
import { Destination } from 'solclientjs';
import * as i0 from "@angular/core";

@@ -10,5 +10,5 @@ /**

export declare class TopicMatcher {
matchesSubscriptionTopic(testeeTopic: string | Destination, subscriptionTopic: string | Destination): boolean;
matchesSubscriptionTopic(testeeTopic: string | Destination | null, subscriptionTopic: string | Destination): boolean;
static ɵfac: i0.ɵɵFactoryDeclaration<TopicMatcher, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<TopicMatcher>;
}

@@ -0,5 +1,5 @@

import { Destination } from 'solclientjs';
/**
* Maintains the subscription count per topic.
*/
import { Destination } from './solace.model';
export declare class TopicSubscriptionCounter {

@@ -6,0 +6,0 @@ private _subscriptionCounts;

{
"name": "@solace-community/angular-solace-message-client",
"version": "13.0.0",
"version": "13.1.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.",

@@ -22,3 +22,3 @@ "license": "MIT",

"rxjs": "^7.5.0",
"solclientjs": "^10.7.0"
"solclientjs": "^10.10.0"
},

@@ -25,0 +25,0 @@ "dependencies": {

export { SolaceMessageClientModule } from './lib/solace-message-client.module';
export { SolaceMessageClientConfig } from './lib/solace-message-client.config';
export { OAuthAccessTokenProvider } from './lib/oauth-access-token-provider';
export { SolaceSessionProvider } from './lib/solace-session-provider';
export { MessageEnvelope, Params, SolaceMessageClient, mapToText, mapToBinary, ObserveOptions, ConsumeOptions, BrowseOptions, PublishOptions, NullSolaceMessageClient, Data } from './lib/solace-message-client';
export { SolaceObjectFactory } from './lib/solace-object-factory';
export * from './lib/solace.model';
export * from './lib/solclientjs-typedef-augmentation';

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc