From 892f80c5070470a79ca457c942f91dce9dda7c33 Mon Sep 17 00:00:00 2001 From: Ramya Rao Date: Fri, 12 Feb 2021 09:21:02 -0800 Subject: [PATCH] [Service Bus] Fix return tag to follow TSDoc (#13755) This PR fixes over 90 linter errors around the `@returns` tag in Service Bus. Related to #10781 - Remove the type info in the `@returns` tag as this is redundant. TS tooling can figure out the typing info without needing us to have it add it here - Remove the entire tag if it was not adding any information other than the type --- .../service-bus/src/connectionContext.ts | 1 - .../service-bus/src/core/batchingReceiver.ts | 3 +- .../service-bus/src/core/linkEntity.ts | 3 -- .../service-bus/src/core/managementClient.ts | 24 ++++--------- .../service-bus/src/core/messageSender.ts | 6 ---- .../service-bus/src/core/streamingReceiver.ts | 1 - .../service-bus/src/receivers/receiver.ts | 17 ++-------- .../src/receivers/sessionReceiver.ts | 8 ++--- sdk/servicebus/service-bus/src/sender.ts | 6 +--- .../src/serviceBusAtomManagementClient.ts | 34 ++++--------------- .../service-bus/src/serviceBusMessageBatch.ts | 1 - .../service-bus/src/session/messageSession.ts | 4 +-- .../service-bus/src/util/atomXmlHelper.ts | 1 - .../service-bus/src/util/crypto.browser.ts | 3 +- .../src/util/sasServiceClientCredentials.ts | 2 +- sdk/servicebus/service-bus/src/util/utils.ts | 8 ++--- .../test/public/utils/managementUtils.ts | 2 -- 17 files changed, 27 insertions(+), 97 deletions(-) diff --git a/sdk/servicebus/service-bus/src/connectionContext.ts b/sdk/servicebus/service-bus/src/connectionContext.ts index 906d2ba99b9..47570059494 100644 --- a/sdk/servicebus/service-bus/src/connectionContext.ts +++ b/sdk/servicebus/service-bus/src/connectionContext.ts @@ -547,7 +547,6 @@ export namespace ConnectionContext { * Once closed, * - the clients created by this ServiceBusClient cannot be used to send/receive messages anymore. * - this ServiceBusClient cannot be used to create any new queues/topics/subscriptions clients. - * @returns {Promise} */ export async function close(context: ConnectionContext): Promise { const logPrefix = `[${context.connectionId}]`; diff --git a/sdk/servicebus/service-bus/src/core/batchingReceiver.ts b/sdk/servicebus/service-bus/src/core/batchingReceiver.ts index ca8e8d2b90c..3e53e89226d 100644 --- a/sdk/servicebus/service-bus/src/core/batchingReceiver.ts +++ b/sdk/servicebus/service-bus/src/core/batchingReceiver.ts @@ -78,7 +78,6 @@ export class BatchingReceiver extends MessageReceiver { /** * To be called when connection is disconnected to gracefully close ongoing receive request. * @param connectionError - The connection error if any. - * @returns {Promise} Promise. */ async onDetached(connectionError?: AmqpError | Error): Promise { await this.closeLink(); @@ -100,7 +99,7 @@ export class BatchingReceiver extends MessageReceiver { * @param maxTimeAfterFirstMessageInMs - The total amount of time to wait after the first message * has been received. Defaults to 1 second. * If this time elapses before the `maxMessageCount` is reached, then messages collected till then will be returned to the user. - * @returns {Promise} A promise that resolves with an array of Message objects. + * @returns A promise that resolves with an array of Message objects. */ async receive( maxMessageCount: number, diff --git a/sdk/servicebus/service-bus/src/core/linkEntity.ts b/sdk/servicebus/service-bus/src/core/linkEntity.ts index fa09beca9be..239be1f5007 100644 --- a/sdk/servicebus/service-bus/src/core/linkEntity.ts +++ b/sdk/servicebus/service-bus/src/core/linkEntity.ts @@ -186,7 +186,6 @@ export abstract class LinkEntity */ private async _negotiateClaim(setTokenRenewal?: boolean): Promise { this._logger.verbose(`${this._logPrefix} negotiateclaim() has been called`); @@ -468,7 +466,6 @@ export abstract class LinkEntity { /** * Closes the AMQP management session to the ServiceBus namespace for this client, * returning a promise that will be resolved when disconnection is completed. - * @returns Promise */ async close(): Promise { try { @@ -380,7 +379,6 @@ export class ManagementClient extends LinkEntity { * also fetch even Deferred messages (but not Deadlettered message). * * @param messageCount - The number of messages to retrieve. Default value `1`. - * @returns Promise */ async peek( messageCount: number, @@ -406,7 +404,6 @@ export class ManagementClient extends LinkEntity { * * @param sessionId - The sessionId from which messages need to be peeked. * @param messageCount - The number of messages to retrieve. Default value `1`. - * @returns Promise */ async peekMessagesBySession( sessionId: string, @@ -428,7 +425,6 @@ export class ManagementClient extends LinkEntity { * @param fromSequenceNumber - The sequence number from where to read the message. * @param messageCount - The number of messages to retrieve. Default value `1`. * @param sessionId - The sessionId from which messages need to be peeked. - * @returns Promise */ async peekBySequenceNumber( fromSequenceNumber: Long, @@ -527,7 +523,7 @@ export class ManagementClient extends LinkEntity { * * @param lockToken - Lock token of the message * @param options - Options that can be set while sending the request. - * @returns Promise New lock token expiry date and time in UTC format. + * @returns New lock token expiry date and time in UTC format. */ async renewLock(lockToken: string, options?: SendManagementRequestOptions): Promise { throwErrorIfConnectionClosed(this._context); @@ -579,7 +575,7 @@ export class ManagementClient extends LinkEntity { * * @param scheduledEnqueueTimeUtc - The UTC time at which the messages should be enqueued. * @param messages - An array of messages that needs to be scheduled. - * @returns Promise The sequence numbers of messages that were scheduled. + * @returns The sequence numbers of messages that were scheduled. */ async scheduleMessages( scheduledEnqueueTimeUtc: Date, @@ -672,7 +668,6 @@ export class ManagementClient extends LinkEntity { /** * Cancels an array of messages that were scheduled. * @param sequenceNumbers - An Array of sequence numbers of the message to be cancelled. - * @returns Promise */ async cancelScheduledMessages( sequenceNumbers: Long[], @@ -739,9 +734,7 @@ export class ManagementClient extends LinkEntity { * * @param sequenceNumbers - A list containing the sequence numbers to receive. * @param receiveMode - The mode in which the receiver was created. - * @returns Promise - * - Returns a list of messages identified by the given sequenceNumbers. - * - Returns an empty list if no messages are found. + * @returns a list of messages identified by the given sequenceNumbers or an empty list if no messages are found. * - Throws an error if the messages have not been deferred. */ async receiveDeferredMessages( @@ -833,8 +826,6 @@ export class ManagementClient extends LinkEntity { * @param lockTokens - Message lock tokens to update disposition status. * @param dispositionStatus - The disposition status to be set * @param options - Optional parameters that can be provided while updating the disposition status. - * - * @returns Promise */ async updateDispositionStatus( lockToken: string, @@ -901,7 +892,7 @@ export class ManagementClient extends LinkEntity { * * @param sessionId - Id of the session for which the lock needs to be renewed * @param options - Options that can be set while sending the request. - * @returns Promise New lock token expiry date and time in UTC format. + * @returns New lock token expiry date and time in UTC format. */ async renewSessionLock( sessionId: string, @@ -951,7 +942,6 @@ export class ManagementClient extends LinkEntity { * * @param sessionId - The session for which the state needs to be set * @param state - The state that needs to be set. - * @returns Promise */ async setSessionState( sessionId: string, @@ -995,7 +985,7 @@ export class ManagementClient extends LinkEntity { * Gets the state of the specified session. * * @param sessionId - The session for which the state needs to be retrieved. - * @returns Promise The state of that session + * @returns The state of that session */ async getSessionState( sessionId: string, @@ -1040,7 +1030,7 @@ export class ManagementClient extends LinkEntity { * @param lastUpdateTime - Filter to include only sessions updated after a given time. * @param skip - The number of sessions to skip * @param top - Maximum numer of sessions. - * @returns Promise A list of session ids. + * @returns A list of session ids. */ async listMessageSessions( skip: number, @@ -1095,7 +1085,7 @@ export class ManagementClient extends LinkEntity { /** * Get all the rules on the Subscription. - * @returns Promise A list of rules. + * @returns A list of rules. */ async getRules( options?: OperationOptionsBase & SendManagementRequestOptions diff --git a/sdk/servicebus/service-bus/src/core/messageSender.ts b/sdk/servicebus/service-bus/src/core/messageSender.ts index 66d2441c2e4..f46588c551c 100644 --- a/sdk/servicebus/service-bus/src/core/messageSender.ts +++ b/sdk/servicebus/service-bus/src/core/messageSender.ts @@ -158,7 +158,6 @@ export class MessageSender extends LinkEntity { * * @param encodedMessage - The encoded message to be sent to ServiceBus. * @param sendBatch - Boolean indicating whether the encoded message represents a batch of messages or not - * @returns Promise */ private _trySend( encodedMessage: Buffer, @@ -320,7 +319,6 @@ export class MessageSender extends LinkEntity { /** * Closes the rhea link. * To be called when connection is disconnected, onAmqpClose and onSessionClose events. - * @returns {Promise} Promise. */ async onDetached(): Promise { // Clears the token renewal timer. Closes the link and its session if they are open. @@ -330,7 +328,6 @@ export class MessageSender extends LinkEntity { /** * Determines whether the AMQP sender link is open. If open then returns true else returns false. - * @returns boolean */ isOpen(): boolean { const result: boolean = this.link == null ? false : this.link.isOpen(); @@ -348,7 +345,6 @@ export class MessageSender extends LinkEntity { * Sends the given message, with the given options on this link * * @param data - Message to send. Will be sent as UTF8-encoded JSON string. - * @returns {Promise} */ async send(data: ServiceBusMessage, options?: OperationOptionsBase): Promise { throwErrorIfConnectionClosed(this._context); @@ -390,7 +386,6 @@ export class MessageSender extends LinkEntity { * of the envelope (batch message). * @param inputMessages - An array of Message objects to be sent in a * Batch message. - * @returns {Promise} */ async sendMessages( inputMessages: ServiceBusMessage[], @@ -476,7 +471,6 @@ export class MessageSender extends LinkEntity { * retryOptions: { maxRetries: 5; timeoutInMs: 10 } * } * ``` - * @returns {Promise} */ async getMaxMessageSize( options: { diff --git a/sdk/servicebus/service-bus/src/core/streamingReceiver.ts b/sdk/servicebus/service-bus/src/core/streamingReceiver.ts index 1f01b9581bd..5f983099593 100644 --- a/sdk/servicebus/service-bus/src/core/streamingReceiver.ts +++ b/sdk/servicebus/service-bus/src/core/streamingReceiver.ts @@ -448,7 +448,6 @@ export class StreamingReceiver extends MessageReceiver { /** * Will reconnect the receiver link if necessary. * @param receiverError - The receiver error or connection error, if any. - * @returns {Promise} Promise. */ async onDetached(receiverError?: AmqpError | Error): Promise { logger.verbose(`${this.logPrefix} onDetached: reinitializing link.`); diff --git a/sdk/servicebus/service-bus/src/receivers/receiver.ts b/sdk/servicebus/service-bus/src/receivers/receiver.ts index 2e0aa870378..276b883686b 100644 --- a/sdk/servicebus/service-bus/src/receivers/receiver.ts +++ b/sdk/servicebus/service-bus/src/receivers/receiver.ts @@ -87,7 +87,7 @@ export interface ServiceBusReceiver { * @param options - A set of options to control the receive operation. * - `maxWaitTimeInMs`: The maximum time to wait for the first message before returning an empty array if no messages are available. * - `abortSignal`: The signal to use to abort the ongoing operation. - * @returns Promise A promise that resolves with an array of messages. + * @returns A promise that resolves with an array of messages. * @throws Error if the underlying connection, client or receiver is closed. * @throws Error if current receiver is already in state of receiving messages. * @throws `ServiceBusError` if the service returns an error while receiving messages. @@ -101,9 +101,7 @@ export interface ServiceBusReceiver { * Returns a promise that resolves to an array of deferred messages identified by given `sequenceNumbers`. * @param sequenceNumbers - The sequence number or an array of sequence numbers for the messages that need to be received. * @param options - Options bag to pass an abort signal or tracing options. - * @returns {Promise} - * - Returns a list of messages identified by the given sequenceNumbers. - * - Returns an empty list if no messages are found. + * @returns A list of messages identified by the given sequenceNumbers or an empty list if no messages are found. * @throws Error if the underlying connection or receiver is closed. * @throws `ServiceBusError` if the service returns an error while receiving deferred messages. */ @@ -164,8 +162,6 @@ export interface ServiceBusReceiver { * in this mode. * @throws Error with name `ServiceUnavailableError` if Service Bus does not acknowledge the request to settle * the message in time. The message may or may not have been settled successfully. - * - * @returns Promise. */ completeMessage(message: ServiceBusReceivedMessage): Promise; /** @@ -189,8 +185,6 @@ export interface ServiceBusReceiver { * the message in time. The message may or may not have been settled successfully. * * @param propertiesToModify - The properties of the message to modify while abandoning the message. - * - * @returns Promise. */ abandonMessage( message: ServiceBusReceivedMessage, @@ -217,8 +211,6 @@ export interface ServiceBusReceiver { * the message in time. The message may or may not have been settled successfully. * * @param propertiesToModify - The properties of the message to modify while deferring the message - * - * @returns Promise */ deferMessage( message: ServiceBusReceivedMessage, @@ -246,8 +238,6 @@ export interface ServiceBusReceiver { * * @param options - The DeadLetter options that can be provided while * rejecting the message. - * - * @returns Promise */ deadLetterMessage( message: ServiceBusReceivedMessage, @@ -261,7 +251,7 @@ export interface ServiceBusReceiver { * before its lock expires, then the message lands back in the Queue/Subscription for the next * receive operation. * - * @returns Promise - New lock token expiry date and time in UTC format. + * @returns New lock token expiry date and time in UTC format. * @throws Error if the underlying connection, client or receiver is closed. * @throws ServiceBusError if the service returns an error while renewing message lock. */ @@ -354,7 +344,6 @@ export class ServiceBusReceiverImpl implements ServiceBusReceiver { * be concurrently processed. You can also provide a timeout in milliseconds to denote the * amount of time to wait for a new message before closing the receiver. * - * @returns void * @throws Error if the underlying connection or receiver is closed. * @throws Error if current receiver is already in state of receiving messages. * @throws ServiceBusError if the service returns an error while receiving messages. These are bubbled up to be handled by user provided `onError` handler. diff --git a/sdk/servicebus/service-bus/src/receivers/sessionReceiver.ts b/sdk/servicebus/service-bus/src/receivers/sessionReceiver.ts index 8671c698927..6a588fb9605 100644 --- a/sdk/servicebus/service-bus/src/receivers/sessionReceiver.ts +++ b/sdk/servicebus/service-bus/src/receivers/sessionReceiver.ts @@ -89,7 +89,7 @@ export interface ServiceBusSessionReceiver extends ServiceBusReceiver { * Gets the state of the Session. For more on session states, see * {@link https://docs.microsoft.com/azure/service-bus-messaging/message-sessions#message-session-state Session State} * @param options - Options bag to pass an abort signal or tracing options. - * @returns {Promise} The state of that session + * @returns The state of that session * @throws Error if the underlying connection or receiver is closed. * @throws `ServiceBusError` if the service returns an error while retrieving session state. */ @@ -103,7 +103,6 @@ export interface ServiceBusSessionReceiver extends ServiceBusReceiver { * @throws Error if the underlying connection or receiver is closed. * @throws `ServiceBusError` if the service returns an error while setting the session state. * - * @returns {Promise} */ setSessionState(state: any, options?: OperationOptionsBase): Promise; } @@ -204,7 +203,7 @@ export class ServiceBusSessionReceiverImpl implements ServiceBusSessionReceiver * will land back in the Queue/Subscription with their delivery count incremented. * * @param options - Options bag to pass an abort signal or tracing options. - * @returns Promise - New lock token expiry date and time in UTC format. + * @returns New lock token expiry date and time in UTC format. * @throws Error if the underlying connection or receiver is closed. * @throws `ServiceBusError` if the service returns an error while renewing session lock. */ @@ -267,7 +266,7 @@ export class ServiceBusSessionReceiverImpl implements ServiceBusSessionReceiver * Gets the state of the Session. For more on session states, see * {@link https://docs.microsoft.com/azure/service-bus-messaging/message-sessions#message-session-state Session State} * @param options - Options bag to pass an abort signal or tracing options. - * @returns Promise The state of that session + * @returns The state of that session * @throws Error if the underlying connection or receiver is closed. * @throws `ServiceBusError` if the service returns an error while retrieving session state. */ @@ -461,7 +460,6 @@ export class ServiceBusSessionReceiverImpl implements ServiceBusSessionReceiver * also provide a timeout in milliseconds to denote the amount of time to wait for a new message * before closing the receiver. * - * @returns void * @throws Error if the underlying connection or receiver is closed. * @throws Error if the receiver is already in state of receiving messages. * @throws `ServiceBusError` if the service returns an error while receiving messages. These are bubbled up to be handled by user provided `onError` handler. diff --git a/sdk/servicebus/service-bus/src/sender.ts b/sdk/servicebus/service-bus/src/sender.ts index dc3acd2edba..4fa634bcd68 100644 --- a/sdk/servicebus/service-bus/src/sender.ts +++ b/sdk/servicebus/service-bus/src/sender.ts @@ -42,7 +42,6 @@ export interface ServiceBusSender { * @param messages - A single message or an array of messages or a batch of messages created via the createBatch() * method to send. * @param options - Options bag to pass an abort signal or tracing options. - * @returns Promise * @throws `ServiceBusError` with the code `MessageSizeExceeded` if the provided messages do not fit in a single `ServiceBusMessageBatch`. * @throws Error if the underlying connection, client or sender is closed. * @throws `ServiceBusError` if the service returns an error while sending messages to the service. @@ -58,7 +57,6 @@ export interface ServiceBusSender { * @param options - Configures the behavior of the batch. * - `maxSizeInBytes`: The upper limit for the size of batch. The `tryAdd` function will return `false` after this limit is reached. * - * @returns {Promise} * @throws `ServiceBusError` if an error is encountered while sending a message. * @throws Error if the underlying connection or sender has been closed. */ @@ -88,7 +86,7 @@ export interface ServiceBusSender { * @param messages - Message or an array of messages that need to be scheduled. * @param scheduledEnqueueTimeUtc - The UTC time at which the messages should be enqueued. * @param options - Options bag to pass an abort signal or tracing options. - * @returns Promise - The sequence numbers of messages that were scheduled. + * @returns The sequence numbers of messages that were scheduled. * You will need the sequence number if you intend to cancel the scheduling of the messages. * Save the `Long` type as-is in your application without converting to number. Since JavaScript * only supports 53 bit numbers, converting the `Long` to number will cause loss in precision. @@ -105,7 +103,6 @@ export interface ServiceBusSender { * Cancels multiple messages that were scheduled to appear on a ServiceBus Queue/Subscription. * @param sequenceNumbers - Sequence number or an array of sequence numbers of the messages to be cancelled. * @param options - Options bag to pass an abort signal or tracing options. - * @returns Promise * @throws Error if the underlying connection, client or sender is closed. * @throws `ServiceBusError` if the service returns an error while canceling scheduled messages. */ @@ -122,7 +119,6 @@ export interface ServiceBusSender { * Once closed, the sender cannot be used for any further operations. * Use the `createSender` function on the QueueClient or TopicClient to instantiate a new Sender * - * @returns {Promise} */ close(): Promise; } diff --git a/sdk/servicebus/service-bus/src/serviceBusAtomManagementClient.ts b/sdk/servicebus/service-bus/src/serviceBusAtomManagementClient.ts index 79d0d9a9c96..045345546d9 100644 --- a/sdk/servicebus/service-bus/src/serviceBusAtomManagementClient.ts +++ b/sdk/servicebus/service-bus/src/serviceBusAtomManagementClient.ts @@ -450,10 +450,7 @@ export class ServiceBusAdministrationClient extends ServiceClient { * * .byPage() returns an async iterable iterator to list the queues in pages. * - * @returns {PagedAsyncIterableIterator< - * QueueProperties, - * EntitiesResponse, - * >} An asyncIterableIterator that supports paging. + * @returns An asyncIterableIterator that supports paging. */ public listQueues( options?: OperationOptions @@ -556,10 +553,7 @@ export class ServiceBusAdministrationClient extends ServiceClient { * .byPage() returns an async iterable iterator to list runtime info of the queues in pages. * * - * @returns {PagedAsyncIterableIterator< - * QueueRuntimeProperties, - * EntitiesResponse, - * >} An asyncIterableIterator that supports paging. + * @returns An asyncIterableIterator that supports paging. */ public listQueuesRuntimeProperties( options?: OperationOptions @@ -932,10 +926,7 @@ export class ServiceBusAdministrationClient extends ServiceClient { * .byPage() returns an async iterable iterator to list the topics in pages. * * - * @returns {PagedAsyncIterableIterator< - * TopicProperties, - * EntitiesResponse, - * >} An asyncIterableIterator that supports paging. + * @returns An asyncIterableIterator that supports paging. */ public listTopics( options?: OperationOptions @@ -1038,11 +1029,7 @@ export class ServiceBusAdministrationClient extends ServiceClient { * .byPage() returns an async iterable iterator to list runtime info of the topics in pages. * * - * @returns {PagedAsyncIterableIterator< - * TopicRuntimeProperties, - * EntitiesResponse, - - * >} An asyncIterableIterator that supports paging. + * @returns An asyncIterableIterator that supports paging. */ public listTopicsRuntimeProperties( options?: OperationOptions @@ -1433,10 +1420,7 @@ export class ServiceBusAdministrationClient extends ServiceClient { * * .byPage() returns an async iterable iterator to list the subscriptions in pages. * - * @returns {PagedAsyncIterableIterator< - * SubscriptionProperties, - * EntitiesResponse - * >} An asyncIterableIterator that supports paging. + * @returns An asyncIterableIterator that supports paging. */ public listSubscriptions( topicName: string, @@ -1550,11 +1534,7 @@ export class ServiceBusAdministrationClient extends ServiceClient { * * .byPage() returns an async iterable iterator to list runtime info of subscriptions in pages. * - * @returns {PagedAsyncIterableIterator< - * SubscriptionRuntimeProperties, - * EntitiesResponse, - - * >} An asyncIterableIterator that supports paging. + * @returns An asyncIterableIterator that supports paging. */ public listSubscriptionsRuntimeProperties( topicName: string, @@ -1959,7 +1939,7 @@ export class ServiceBusAdministrationClient extends ServiceClient { * * .byPage() returns an async iterable iterator to list the rules in pages. * - * @returns {PagedAsyncIterableIterator>} An asyncIterableIterator that supports paging. + * @returns An asyncIterableIterator that supports paging. */ public listRules( topicName: string, diff --git a/sdk/servicebus/service-bus/src/serviceBusMessageBatch.ts b/sdk/servicebus/service-bus/src/serviceBusMessageBatch.ts index 4b835d3b752..f3a5e2ac4be 100644 --- a/sdk/servicebus/service-bus/src/serviceBusMessageBatch.ts +++ b/sdk/servicebus/service-bus/src/serviceBusMessageBatch.ts @@ -165,7 +165,6 @@ export class ServiceBusMessageBatchImpl implements ServiceBusMessageBatch { * @param annotations - The message annotations to set on the batch. * @param applicationProperties - The application properties to set on the batch. * @param messageProperties - The message properties to set on the batch. - * @returns {Buffer} */ private _generateBatch( encodedMessages: Buffer[], diff --git a/sdk/servicebus/service-bus/src/session/messageSession.ts b/sdk/servicebus/service-bus/src/session/messageSession.ts index fe260f49a1c..78ab77aa856 100644 --- a/sdk/servicebus/service-bus/src/session/messageSession.ts +++ b/sdk/servicebus/service-bus/src/session/messageSession.ts @@ -581,8 +581,6 @@ export class MessageSession extends LinkEntity { * @param options - Options to control whether messages should be automatically completed. You can * also provide a timeout in milliseconds to denote the amount of time to wait for a new message * before closing the receiver. - * - * @returns void */ subscribe(onMessage: OnMessage, onError: OnError, options: SubscribeOptions): void { if (!options) options = {}; @@ -742,7 +740,7 @@ export class MessageSession extends LinkEntity { * @param maxMessageCount - The maximum number of messages to receive from Queue/Subscription. * @param maxWaitTimeInMs - The total wait time in milliseconds until which the receiver will attempt to receive specified number of messages. * If this time elapses before the `maxMessageCount` is reached, then messages collected till then will be returned to the user. - * @returns Promise A promise that resolves with an array of Message objects. + * @returns A promise that resolves with an array of Message objects. */ async receiveMessages( maxMessageCount: number, diff --git a/sdk/servicebus/service-bus/src/util/atomXmlHelper.ts b/sdk/servicebus/service-bus/src/util/atomXmlHelper.ts index 3ba26a86a78..a5b7486ee55 100644 --- a/sdk/servicebus/service-bus/src/util/atomXmlHelper.ts +++ b/sdk/servicebus/service-bus/src/util/atomXmlHelper.ts @@ -299,7 +299,6 @@ function parseFeedResult(feed: any): object[] & { nextLink?: string } { /** * @internal - * @returns {statusCode is keyof typeof Constants.HttpResponseCodes} */ function isKnownResponseCode( statusCode: number diff --git a/sdk/servicebus/service-bus/src/util/crypto.browser.ts b/sdk/servicebus/service-bus/src/util/crypto.browser.ts index 947aab1fc22..6b884e6b423 100644 --- a/sdk/servicebus/service-bus/src/util/crypto.browser.ts +++ b/sdk/servicebus/service-bus/src/util/crypto.browser.ts @@ -6,7 +6,6 @@ /** * @internal - * @returns {Promise} */ export async function generateKey(secret: string, stringToSign: string): Promise { const key = await window.crypto.subtle.importKey( @@ -41,7 +40,7 @@ function convertToUint8Array(value: string): Uint8Array { * Encodes a byte array in base64 format. * @param value - the Uint8Aray to encode * @internal - * @returns {string} + * */ function encodeByteArray(value: Uint8Array): string { let str = ""; diff --git a/sdk/servicebus/service-bus/src/util/sasServiceClientCredentials.ts b/sdk/servicebus/service-bus/src/util/sasServiceClientCredentials.ts index dbe156919db..011c7ab222f 100644 --- a/sdk/servicebus/service-bus/src/util/sasServiceClientCredentials.ts +++ b/sdk/servicebus/service-bus/src/util/sasServiceClientCredentials.ts @@ -38,7 +38,7 @@ export class SasServiceClientCredentials implements ServiceClientCredentials { * Signs a request with the Authentication header. * * @param webResource - The WebResource to be signed. - * @returns {Promise} The signed request object. + * @returns The signed request object. */ async signRequest(webResource: WebResource): Promise { if (!webResource.headers) webResource.headers = new HttpHeaders(); diff --git a/sdk/servicebus/service-bus/src/util/utils.ts b/sdk/servicebus/service-bus/src/util/utils.ts index 0b0ac16a317..20597a2d90a 100644 --- a/sdk/servicebus/service-bus/src/util/utils.ts +++ b/sdk/servicebus/service-bus/src/util/utils.ts @@ -42,7 +42,7 @@ export function getUniqueName(name: string): string { * different byte order. This is the order of bytes needed to make Service Bus recognize the token. * * @param lockToken - The lock token whose bytes need to be reorded. - * @returns Buffer - Buffer representing reordered bytes. + * @returns Buffer representing reordered bytes. */ export function reorderLockToken(lockTokenBytes: Buffer): Buffer { if (!lockTokenBytes || !Buffer.isBuffer(lockTokenBytes)) { @@ -106,7 +106,7 @@ export function calculateRenewAfterDuration(lockedUntilUtc: Date): number { * - Thus, we `divide` the value by `10000` to convert it to JS Date ticks. * * @param buf - Input as a Buffer - * @returns Date The JS Date object. + * @returns The JS Date object. */ export function convertTicksToDate(buf: number[]): Date { const epochMicroDiff: number = 621355968000000000; @@ -543,7 +543,6 @@ export const StandardAbortMessage = "The operation was aborted."; * @param abortSignal - The abortSignal associated with containing operation. * @param abortErrorMsg - The abort error message associated with containing operation. * @param value - The value to be resolved with after a timeout of t milliseconds. - * @returns {Promise} - Resolved promise * * @internal */ @@ -632,8 +631,6 @@ export const libInfo: string = `azsdk-js-azureservicebus/${Constants.packageJson /** * @internal * Returns the formatted prefix by removing the spaces, by appending the libInfo. - * - * @returns {string} */ export function formatUserAgentPrefix(prefix?: string): string { let userAgentPrefix = `${(prefix || "").replace(" ", "")}`; @@ -644,7 +641,6 @@ export function formatUserAgentPrefix(prefix?: string): string { /** * @internal * Helper method which returns `HttpResponse` from an object of shape `HttpOperationResponse`. - * @returns {HttpResponse} */ export const getHttpResponseOnly = ({ request, diff --git a/sdk/servicebus/service-bus/test/public/utils/managementUtils.ts b/sdk/servicebus/service-bus/test/public/utils/managementUtils.ts index bcb7d726add..54700f5ea4c 100644 --- a/sdk/servicebus/service-bus/test/public/utils/managementUtils.ts +++ b/sdk/servicebus/service-bus/test/public/utils/managementUtils.ts @@ -178,8 +178,6 @@ export async function recreateSubscription( /** * Utility that verifies the message count of an entity. - * - * @returns {Promise} */ export async function verifyMessageCount( expectedMessageCount: number,