Skip to content

Commit e4dba89

Browse files
[service-bus] Hit low-hanging fruit with linting errors (Azure#13521)
There were some mechanical transform fixes we could for linting (beyond errors that could be autofixed). There are still _quite_ a few more remaining but this is the easy set that's more or less just rote transformations. There are no code changes to speak of - this entire change occurs in the comments. Part of a series of changes for Azure#10781
1 parent 4a669de commit e4dba89

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+393
-633
lines changed

sdk/servicebus/service-bus/src/connectionContext.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,26 +34,26 @@ import { ReceiverType } from "./core/linkEntity";
3434
*/
3535
export interface ConnectionContext extends ConnectionContextBase {
3636
/**
37-
* @property {SharedKeyCredential | TokenCredential} [tokenCredential] The credential to be used for Authentication.
37+
* The credential to be used for Authentication.
3838
* Default value: SharedKeyCredentials.
3939
*/
4040
tokenCredential: SharedKeyCredential | TokenCredential;
4141
/**
42-
* @property A map of active Service Bus Senders with sender name as key.
42+
* A map of active Service Bus Senders with sender name as key.
4343
*/
4444
senders: { [name: string]: MessageSender };
4545
/**
46-
* @property A map of active Service Bus receivers for non session enabled queues/subscriptions
46+
* A map of active Service Bus receivers for non session enabled queues/subscriptions
4747
* with receiver name as key.
4848
*/
4949
messageReceivers: { [name: string]: MessageReceiver };
5050
/**
51-
* @property A map of active Service Bus receivers for session enabled queues/subscriptions
51+
* A map of active Service Bus receivers for session enabled queues/subscriptions
5252
* with receiver name as key.
5353
*/
5454
messageSessions: { [name: string]: MessageSession };
5555
/**
56-
* @property A map of ManagementClient instances for operations over the $management link
56+
* A map of ManagementClient instances for operations over the $management link
5757
* with key as the entity path.
5858
*/
5959
managementClients: { [name: string]: ManagementClient };

sdk/servicebus/service-bus/src/constructorHelpers.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export interface ServiceBusClientOptions {
3030
*/
3131
retryOptions?: RetryOptions;
3232
/**
33-
* @property
3433
* Options to configure the channelling of the AMQP connection over Web Sockets.
3534
*/
3635
webSocketOptions?: WebSocketOptions;
@@ -43,9 +42,6 @@ export interface ServiceBusClientOptions {
4342
/**
4443
* @internal
4544
*
46-
* @param {string} connectionString
47-
* @param {(SharedKeyCredential | TokenCredential)} credential
48-
* @param {ServiceBusClientOptions} options
4945
*/
5046
export function createConnectionContext(
5147
connectionString: string,
@@ -62,8 +58,6 @@ export function createConnectionContext(
6258
}
6359

6460
/**
65-
* @param connectionString
66-
* @param options
6761
* @internal
6862
*/
6963
export function createConnectionContextForConnectionString(
@@ -76,9 +70,6 @@ export function createConnectionContextForConnectionString(
7670

7771
/**
7872
*
79-
* @param credential
80-
* @param host
81-
* @param options
8273
* @internal
8374
*/
8475
export function createConnectionContextForTokenCredential(
@@ -100,7 +91,7 @@ export function createConnectionContextForTokenCredential(
10091

10192
/**
10293
* Parses a connection string and extracts the EntityPath named entity out.
103-
* @param connectionString An entity specific Service Bus connection string.
94+
* @param connectionString - An entity specific Service Bus connection string.
10495
* @internal
10596
*/
10697
export function getEntityNameFromConnectionString(connectionString: string): string {

sdk/servicebus/service-bus/src/core/autoLockRenewer.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ type MinimalLink = Pick<LinkEntity<any>, "name" | "logPrefix" | "entityPath">;
2929
*/
3030
export class LockRenewer {
3131
/**
32-
* @property _messageRenewLockTimers A map of link names to individual maps for each
32+
* A map of link names to individual maps for each
3333
* link that map a message ID to its auto-renewal timer.
3434
*/
3535
private _messageRenewLockTimers: Map<string, Map<string, NodeJS.Timer | undefined>> = new Map<
@@ -50,9 +50,9 @@ export class LockRenewer {
5050
/**
5151
* Creates an AutoLockRenewer.
5252
*
53-
* @param linkEntity Your link entity instance (probably 'this')
54-
* @param context The connection context for your link entity (probably 'this._context')
55-
* @param options The ReceiveOptions passed through to your message receiver.
53+
* @param linkEntity - Your link entity instance (probably 'this')
54+
* @param context - The connection context for your link entity (probably 'this._context')
55+
* @param options - The ReceiveOptions passed through to your message receiver.
5656
* @returns if the lock mode is peek lock (or if is unspecified, thus defaulting to peekLock)
5757
* and the options.maxAutoLockRenewalDurationInMs is > 0..Otherwise, returns undefined.
5858
*/
@@ -96,7 +96,7 @@ export class LockRenewer {
9696
/**
9797
* Stops lock renewal for a single message.
9898
*
99-
* @param bMessage The message whose lock renewal we will stop.
99+
* @param bMessage - The message whose lock renewal we will stop.
100100
*/
101101
stop(linkEntity: MinimalLink, bMessage: RenewableMessageProperties) {
102102
const messageId = bMessage.messageId as string;
@@ -113,7 +113,7 @@ export class LockRenewer {
113113
/**
114114
* Starts lock renewal for a single message.
115115
*
116-
* @param bMessage The message whose lock renewal we will start.
116+
* @param bMessage - The message whose lock renewal we will start.
117117
*/
118118
start(linkEntity: MinimalLink, bMessage: RenewableMessageProperties, onError: OnErrorNoContext) {
119119
try {

sdk/servicebus/service-bus/src/core/batchingReceiver.ts

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,13 @@ import { ServiceBusError, translateServiceBusError } from "../serviceBusError";
2626
* Describes the batching receiver where the user can receive a specified number of messages for
2727
* a predefined time.
2828
* @internal
29-
* @class BatchingReceiver
30-
* @extends MessageReceiver
3129
*/
3230
export class BatchingReceiver extends MessageReceiver {
3331
/**
3432
* Instantiate a new BatchingReceiver.
3533
*
36-
* @constructor
37-
* @param {ClientEntityContext} context The client entity context.
38-
* @param {ReceiveOptions} [options] Options for how you'd like to connect.
34+
* @param context - The client entity context.
35+
* @param options - Options for how you'd like to connect.
3936
*/
4037
constructor(context: ConnectionContext, entityPath: string, options: ReceiveOptions) {
4138
super(context, entityPath, "batching", options);
@@ -80,7 +77,7 @@ export class BatchingReceiver extends MessageReceiver {
8077

8178
/**
8279
* To be called when connection is disconnected to gracefully close ongoing receive request.
83-
* @param {AmqpError | Error} [connectionError] The connection error if any.
80+
* @param connectionError - The connection error if any.
8481
* @returns {Promise<void>} Promise<void>.
8582
*/
8683
async onDetached(connectionError?: AmqpError | Error): Promise<void> {
@@ -97,10 +94,10 @@ export class BatchingReceiver extends MessageReceiver {
9794

9895
/**
9996
* Receives a batch of messages from a ServiceBus Queue/Topic.
100-
* @param maxMessageCount The maximum number of messages to receive.
97+
* @param maxMessageCount - The maximum number of messages to receive.
10198
* In Peeklock mode, this number is capped at 2047 due to constraints of the underlying buffer.
102-
* @param maxWaitTimeInMs The total wait time in milliseconds until which the receiver will attempt to receive specified number of messages.
103-
* @param maxTimeAfterFirstMessageInMs The total amount of time to wait after the first message
99+
* @param maxWaitTimeInMs - The total wait time in milliseconds until which the receiver will attempt to receive specified number of messages.
100+
* @param maxTimeAfterFirstMessageInMs - The total amount of time to wait after the first message
104101
* has been received. Defaults to 1 second.
105102
* If this time elapses before the `maxMessageCount` is reached, then messages collected till then will be returned to the user.
106103
* @returns {Promise<ServiceBusMessageImpl[]>} A promise that resolves with an array of Message objects.
@@ -160,8 +157,8 @@ export class BatchingReceiver extends MessageReceiver {
160157
* taking into account elapsed time from when getRemainingWaitTimeInMsFn
161158
* was called.
162159
*
163-
* @param maxWaitTimeInMs Maximum time to wait for the first message
164-
* @param maxTimeAfterFirstMessageInMs Maximum time to wait after the first message before completing the receive.
160+
* @param maxWaitTimeInMs - Maximum time to wait for the first message
161+
* @param maxTimeAfterFirstMessageInMs - Maximum time to wait after the first message before completing the receive.
165162
*
166163
* @internal
167164
*/
@@ -299,7 +296,7 @@ export class BatchingReceiverLite {
299296
/**
300297
* Closes the receiver (optionally with an error), cancelling any current operations.
301298
*
302-
* @param connectionError An optional error (rhea doesn't always deliver one for certain disconnection events)
299+
* @param connectionError - An optional error (rhea doesn't always deliver one for certain disconnection events)
303300
*/
304301
terminate(connectionError?: Error | AmqpError) {
305302
if (this._closeHandler) {

sdk/servicebus/service-bus/src/core/linkEntity.ts

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ import { ServiceBusError } from "../serviceBusError";
2424
*/
2525
export interface LinkEntityOptions {
2626
/**
27-
* @property {string} address The client entity address in one of the following forms:
27+
* The client entity address in one of the following forms:
2828
*/
2929
address?: string;
3030
/**
31-
* @property {string} audience The client entity token audience in one of the following forms:
31+
* The client entity token audience in one of the following forms:
3232
*/
3333
audience?: string;
3434
}
@@ -85,12 +85,12 @@ type LinkTypeT<
8585
*/
8686
export abstract class LinkEntity<LinkT extends Receiver | AwaitableSender | RequestResponseLink> {
8787
/**
88-
* @property {string} id The unique name for the entity in the format:
88+
* The unique name for the entity in the format:
8989
* `${name of the entity}-${guid}`.
9090
*/
9191
name: string;
9292
/**
93-
* @property {string} address The client entity address in one of the following forms:
93+
* The client entity address in one of the following forms:
9494
*
9595
* **Sender**
9696
* - `"<queue-name>"`.
@@ -105,7 +105,7 @@ export abstract class LinkEntity<LinkT extends Receiver | AwaitableSender | Requ
105105
*/
106106
address: string;
107107
/**
108-
* @property {string} audience The client entity token audience in one of the following forms:
108+
* The client entity token audience in one of the following forms:
109109
*
110110
* **Sender**
111111
* - `"sb://<yournamespace>.servicebus.windows.net/<queue-name>"`
@@ -121,17 +121,17 @@ export abstract class LinkEntity<LinkT extends Receiver | AwaitableSender | Requ
121121
*/
122122
audience: string;
123123
/**
124-
* @property _context Provides relevant information about the amqp connection,
124+
* Provides relevant information about the amqp connection,
125125
* cbs and $management sessions, token provider, sender and receivers.
126126
*/
127127
protected _context: ConnectionContext;
128128
/**
129-
* @property {NodeJS.Timer} _tokenRenewalTimer The token renewal timer that keeps track of when
129+
* The token renewal timer that keeps track of when
130130
* the Client Entity is due for token renewal.
131131
*/
132132
private _tokenRenewalTimer?: NodeJS.Timer;
133133
/**
134-
* @property _tokenTimeout Indicates token timeout
134+
* Indicates token timeout
135135
*/
136136
protected _tokenTimeout?: number;
137137

@@ -163,11 +163,10 @@ export abstract class LinkEntity<LinkT extends Receiver | AwaitableSender | Requ
163163

164164
/**
165165
* Creates a new ClientEntity instance.
166-
* @constructor
167-
* @param baseName The base name to use for the link. A unique ID will be appended to this.
168-
* @param entityPath The entity path (ex: 'your-queue')
169-
* @param context The connection context.
170-
* @param options Options that can be provided while creating the LinkEntity.
166+
* @param baseName - The base name to use for the link. A unique ID will be appended to this.
167+
* @param entityPath - The entity path (ex: 'your-queue')
168+
* @param context - The connection context.
169+
* @param options - Options that can be provided while creating the LinkEntity.
171170
*/
172171
constructor(
173172
public readonly baseName: string,
@@ -187,7 +186,7 @@ export abstract class LinkEntity<LinkT extends Receiver | AwaitableSender | Requ
187186

188187
/**
189188
* Determines whether the AMQP link is open. If open then returns true else returns false.
190-
* @return {boolean} boolean
189+
* @returns boolean
191190
*/
192191
isOpen(): boolean {
193192
const result: boolean = this._link ? this._link.isOpen() : false;
@@ -305,7 +304,6 @@ export abstract class LinkEntity<LinkT extends Receiver | AwaitableSender | Requ
305304
* NOTE: This method should be implemented by any child classes to actually create the underlying
306305
* Rhea link (AwaitableSender or Receiver or RequestResponseLink)
307306
*
308-
* @param _options
309307
*/
310308
protected abstract createRheaLink(_options: LinkOptionsT<LinkT>): Promise<LinkT>;
311309

@@ -346,7 +344,7 @@ export abstract class LinkEntity<LinkT extends Receiver | AwaitableSender | Requ
346344

347345
/**
348346
* Provides the current type of the ClientEntity.
349-
* @return {string} The entity type.
347+
* @returns The entity type.
350348
*/
351349
private get _type(): string {
352350
let result = "LinkEntity";
@@ -366,8 +364,8 @@ export abstract class LinkEntity<LinkT extends Receiver | AwaitableSender | Requ
366364

367365
/**
368366
* Negotiates the cbs claim for the ClientEntity.
369-
* @param {boolean} [setTokenRenewal] Set the token renewal timer. Default false.
370-
* @return {Promise<void>} Promise<void>
367+
* @param setTokenRenewal - Set the token renewal timer. Default false.
368+
* @returns Promise<void>
371369
*/
372370
private async _negotiateClaim(setTokenRenewal?: boolean): Promise<void> {
373371
this._logger.verbose(`${this._logPrefix} negotiateclaim() has been called`);

0 commit comments

Comments
 (0)