diff --git a/sdk/servicebus/service-bus/CHANGELOG.md b/sdk/servicebus/service-bus/CHANGELOG.md index 627b1219f547..364ed286e2a7 100644 --- a/sdk/servicebus/service-bus/CHANGELOG.md +++ b/sdk/servicebus/service-bus/CHANGELOG.md @@ -22,6 +22,7 @@ ### Breaking changes +- The methods to complete, abandon, defer and deadletter a message along with the method to renew message lock have been moved from the message to the receiver. - The `createBatch` method on the sender is renamed to `createMessageBatch`. - The interface `CreateBatchOptions` followed by the options that are passed to the `createBatch` method is renamed to `CreateMessageBatchOptions`. - The `tryAdd` method on the message batch object is renamed to `tryAddMessage`. diff --git a/sdk/servicebus/service-bus/review/service-bus.api.md b/sdk/servicebus/service-bus/review/service-bus.api.md index 1e577a213988..2c83fd8ef174 100644 --- a/sdk/servicebus/service-bus/review/service-bus.api.md +++ b/sdk/servicebus/service-bus/review/service-bus.api.md @@ -312,19 +312,13 @@ export class ServiceBusAdministrationClient extends ServiceClient { export class ServiceBusClient { constructor(connectionString: string, options?: ServiceBusClientOptions); constructor(fullyQualifiedNamespace: string, credential: TokenCredential, options?: ServiceBusClientOptions); - acceptNextSession(queueName: string, options?: ServiceBusSessionReceiverOptions<"peekLock">): Promise; - acceptNextSession(queueName: string, options: ServiceBusSessionReceiverOptions<"receiveAndDelete">): Promise; - acceptNextSession(topicName: string, subscriptionName: string, options?: ServiceBusSessionReceiverOptions<"peekLock">): Promise; - acceptNextSession(topicName: string, subscriptionName: string, options: ServiceBusSessionReceiverOptions<"receiveAndDelete">): Promise; - acceptSession(queueName: string, sessionId: string, options?: ServiceBusSessionReceiverOptions<"peekLock">): Promise; - acceptSession(queueName: string, sessionId: string, options: ServiceBusSessionReceiverOptions<"receiveAndDelete">): Promise; - acceptSession(topicName: string, subscriptionName: string, sessionId: string, options?: ServiceBusSessionReceiverOptions<"peekLock">): Promise; - acceptSession(topicName: string, subscriptionName: string, sessionId: string, options: ServiceBusSessionReceiverOptions<"receiveAndDelete">): Promise; + acceptNextSession(queueName: string, options?: ServiceBusSessionReceiverOptions): Promise; + acceptNextSession(topicName: string, subscriptionName: string, options?: ServiceBusSessionReceiverOptions): Promise; + acceptSession(queueName: string, sessionId: string, options?: ServiceBusSessionReceiverOptions): Promise; + acceptSession(topicName: string, subscriptionName: string, sessionId: string, options?: ServiceBusSessionReceiverOptions): Promise; close(): Promise; - createReceiver(queueName: string, options?: ServiceBusReceiverOptions<"peekLock">): ServiceBusReceiver; - createReceiver(queueName: string, options: ServiceBusReceiverOptions<"receiveAndDelete">): ServiceBusReceiver; - createReceiver(topicName: string, subscriptionName: string, options?: ServiceBusReceiverOptions<"peekLock">): ServiceBusReceiver; - createReceiver(topicName: string, subscriptionName: string, options: ServiceBusReceiverOptions<"receiveAndDelete">): ServiceBusReceiver; + createReceiver(queueName: string, options?: ServiceBusReceiverOptions): ServiceBusReceiver; + createReceiver(topicName: string, subscriptionName: string, options?: ServiceBusReceiverOptions): ServiceBusReceiver; createSender(queueOrTopicName: string): ServiceBusSender; fullyQualifiedNamespace: string; } @@ -421,9 +415,9 @@ export interface ServiceBusReceiver { } // @public -export interface ServiceBusReceiverOptions { +export interface ServiceBusReceiverOptions { maxAutoLockRenewalDurationInMs?: number; - receiveMode?: ReceiveModeT; + receiveMode?: ReceiveMode; subQueue?: SubQueue; } @@ -452,9 +446,9 @@ export interface ServiceBusSessionReceiver extends ServiceBusReceiver { } // @public -export interface ServiceBusSessionReceiverOptions extends OperationOptionsBase { +export interface ServiceBusSessionReceiverOptions extends OperationOptionsBase { maxAutoLockRenewalDurationInMs?: number; - receiveMode?: ReceiveModeT; + receiveMode?: ReceiveMode; } // @public diff --git a/sdk/servicebus/service-bus/src/models.ts b/sdk/servicebus/service-bus/src/models.ts index 35a27ae1e412..8863cbc959eb 100644 --- a/sdk/servicebus/service-bus/src/models.ts +++ b/sdk/servicebus/service-bus/src/models.ts @@ -78,9 +78,9 @@ export type ReceiveMode = "peekLock" | "receiveAndDelete"; export type SubQueue = "deadLetter" | "transferDeadLetter"; /** - * @template ReceiveModeT + * Options to use when creating a receiver. */ -export interface ServiceBusReceiverOptions { +export interface ServiceBusReceiverOptions { /** * Represents the receive mode for the receiver. * @@ -100,7 +100,7 @@ export interface ServiceBusReceiverOptions { * https://docs.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock * */ - receiveMode?: ReceiveModeT; + receiveMode?: ReceiveMode; /** * Represents the sub queue that is applicable for any queue or subscription. * Valid values are "deadLetter" and "transferDeadLetter". To learn more about dead letter queues, @@ -177,13 +177,8 @@ export interface SubscribeOptions extends OperationOptionsBase { /** * Describes the options passed to the `acceptSession` and `acceptNextSession` methods * when using a Queue/Subscription that has sessions enabled. - * - * @export - * @extends {OperationOptionsBase} - * @template ReceiveModeT */ -export interface ServiceBusSessionReceiverOptions - extends OperationOptionsBase { +export interface ServiceBusSessionReceiverOptions extends OperationOptionsBase { /** * Represents the receive mode for the receiver. * @@ -203,7 +198,7 @@ export interface ServiceBusSessionReceiverOptions - ): ServiceBusReceiver; + createReceiver(queueName: string, options?: ServiceBusReceiverOptions): ServiceBusReceiver; /** - * Creates a receiver for an Azure Service Bus queue in receiveAndDelete mode. No connection is made + * Creates a receiver for an Azure Service Bus subscription. No connection is made * to the service until one of the methods on the receiver is called. * * To target sub queues like the dead letter queue or the transfer dead letter queue, provide the * `subQueue` in the options. To learn more about dead letter queues, see * https://docs.microsoft.com/azure/service-bus-messaging/service-bus-dead-letter-queues * - * If the receiveMode is not provided in the options, it defaults to the "peekLock" mode. - * In receiveAndDelete mode, messages are deleted from Service Bus as they are received. - * - * @param queueName The name of the queue to receive from. - * @param options Options to pass the receiveMode, defaulted to receiveAndDelete. - * @returns A receiver that can be used to receive messages of the form `ServiceBusReceivedMessage` - */ - createReceiver( - queueName: string, - options: ServiceBusReceiverOptions<"receiveAndDelete"> - ): ServiceBusReceiver; - /** - * Creates a receiver for an Azure Service Bus subscription in peekLock mode. No connection is made - * to the service until one of the methods on the receiver is called. - * - * To target sub queues like the dead letter queue or the transfer dead letter queue, provide the - * `subQueue` in the options. To learn more about dead letter queues, see - * https://docs.microsoft.com/azure/service-bus-messaging/service-bus-dead-letter-queues - * - * If the receiveMode is not provided in the options, it defaults to the "peekLock" mode. - * In peekLock mode, the receiver has a lock on the message for the duration specified on the - * subscription. + * You can choose between two receive modes: "peekLock" (default) and "receiveAndDelete". + * - In peekLock mode, the receiver has a lock on the message for the duration specified on the + * queue. + * - In receiveAndDelete mode, messages are deleted from Service Bus as they are received. * * Messages that are not settled within the lock duration will be redelivered as many times as * the max delivery count set on the subscription, after which they get sent to a separate dead letter * queue. * - * You can settle a message by calling complete(), abandon(), defer() or deadletter() methods on - * the message. + * You can settle a message by calling completeMessage(), abandonMessage(), deferMessage() or + * deadletterMessage() methods on the receiver. * * More information about how peekLock and message settlement works here: * https://docs.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock @@ -169,42 +149,17 @@ export class ServiceBusClient { * @param topicName Name of the topic for the subscription we want to receive from. * @param subscriptionName Name of the subscription (under the `topic`) that we want to receive from. * @param options Options to pass the receiveMode, defaulted to peekLock. - * @returns A receiver that can be used to receive messages of the form `ServiceBusReceivedMessage` + * @returns A receiver that can be used to receive, peek and settle messages. */ createReceiver( topicName: string, subscriptionName: string, - options?: ServiceBusReceiverOptions<"peekLock"> - ): ServiceBusReceiver; - /** - * Creates a receiver for an Azure Service Bus subscription in receiveAndDelete mode. No connection is made - * to the service until one of the methods on the receiver is called. - * - * - * To target sub queues like the dead letter queue or the transfer dead letter queue, provide the - * `subQueue` in the options. To learn more about dead letter queues, see - * https://docs.microsoft.com/azure/service-bus-messaging/service-bus-dead-letter-queues - * - * If the receiveMode is not provided in the options, it defaults to the "peekLock" mode. - * In receiveAndDelete mode, messages are deleted from Service Bus as they are received. - * - * @param topicName Name of the topic for the subscription we want to receive from. - * @param subscriptionName Name of the subscription (under the `topic`) that we want to receive from. - * @param options Options to pass the receiveMode, defaulted to receiveAndDelete. - * @returns A receiver that can be used to receive messages of the form `ServiceBusReceivedMessage` - */ - createReceiver( - topicName: string, - subscriptionName: string, - options: ServiceBusReceiverOptions<"receiveAndDelete"> + options?: ServiceBusReceiverOptions ): ServiceBusReceiver; createReceiver( queueOrTopicName1: string, - optionsOrSubscriptionName2?: - | ServiceBusReceiverOptions<"receiveAndDelete"> - | ServiceBusReceiverOptions<"peekLock"> - | string, - options3?: ServiceBusReceiverOptions<"receiveAndDelete"> | ServiceBusReceiverOptions<"peekLock"> + optionsOrSubscriptionName2?: ServiceBusReceiverOptions | string, + options3?: ServiceBusReceiverOptions ): ServiceBusReceiver { validateEntityPath(this._connectionContext.config, queueOrTopicName1); @@ -237,38 +192,25 @@ export class ServiceBusClient { ? options.maxAutoLockRenewalDurationInMs : 5 * 60 * 1000; - if (receiveMode === "peekLock") { - return new ServiceBusReceiverImpl( - this._connectionContext, - entityPathWithSubQueue, - receiveMode, - maxLockAutoRenewDurationInMs, - this._clientOptions.retryOptions - ); - } else { - return new ServiceBusReceiverImpl( - this._connectionContext, - entityPathWithSubQueue, - receiveMode, - maxLockAutoRenewDurationInMs, - this._clientOptions.retryOptions - ); - } + return new ServiceBusReceiverImpl( + this._connectionContext, + entityPathWithSubQueue, + receiveMode, + maxLockAutoRenewDurationInMs, + this._clientOptions.retryOptions + ); } /** - * Creates a receiver for a session enabled Azure Service Bus queue in peekLock mode. - * If the receiveMode is not provided in the options, it defaults to the "peekLock" mode. + * Creates a receiver for a session enabled Azure Service Bus queue. * - * In peekLock mode, the receiver has a lock on the session for the duration specified on the + * You can choose between two receive modes: "peekLock" (default) and "receiveAndDelete". + * - In peekLock mode, the receiver has a lock on the message for the duration specified on the * queue. + * - In receiveAndDelete mode, messages are deleted from Service Bus as they are received. * - * Messages that are not settled within the lock duration will be redelivered as many times as - * the max delivery count set on the queue, after which they get sent to a separate dead letter - * queue. - * - * You can settle a message by calling complete(), abandon(), defer() or deadletter() methods on - * the message. + * You can settle a message by calling completeMessage(), abandonMessage(), deferMessage() or + * deadletterMessage() methods on the receiver. * * More information about how peekLock and message settlement works here: * https://docs.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock @@ -276,42 +218,23 @@ export class ServiceBusClient { * @param queueName The name of the queue to receive from. * @param sessionId The id of the session from which messages need to be received * @param options Options include receiveMode(defaulted to peekLock), options to create session receiver. - * @returns A receiver that can be used to receive messages of the form `ServiceBusReceivedMessage` + * @returns A receiver that can be used to receive, peek and settle messages. */ acceptSession( queueName: string, sessionId: string, - options?: ServiceBusSessionReceiverOptions<"peekLock"> + options?: ServiceBusSessionReceiverOptions ): Promise; /** - * Creates a receiver for a session enabled Azure Service Bus queue in receiveAndDelete mode. - * If the receiveMode is not provided in the options, it defaults to the "peekLock" mode. - * - * In receiveAndDelete mode, messages are deleted from Service Bus as they are received. + * Creates a receiver for a session enabled Azure Service Bus subscription. * - * @param queueName The name of the queue to receive from. - * @param sessionId The id of the session from which messages need to be received - * @param options Options include receiveMode(defaulted to receiveAndDelete), options to create session receiver. - * @returns A receiver that can be used to receive messages of the form `ServiceBusReceivedMessage` - */ - acceptSession( - queueName: string, - sessionId: string, - options: ServiceBusSessionReceiverOptions<"receiveAndDelete"> - ): Promise; - /** - * Creates a receiver for a session enabled Azure Service Bus subscription in peekLock mode. - * If the receiveMode is not provided in the options, it defaults to the "peekLock" mode. - * - * In peekLock mode, the receiver has a lock on the session for the duration specified on the - * subscription. - * - * Messages that are not settled within the lock duration will be redelivered as many times as - * the max delivery count set on the subscription, after which they get sent to a separate dead letter + * You can choose between two receive modes: "peekLock" (default) and "receiveAndDelete". + * - In peekLock mode, the receiver has a lock on the message for the duration specified on the * queue. + * - In receiveAndDelete mode, messages are deleted from Service Bus as they are received. * - * You can settle a message by calling complete(), abandon(), defer() or deadletter() methods on - * the message. + * You can settle a message by calling completeMessage(), abandonMessage(), deferMessage() or + * deadletterMessage() methods on the receiver. * * More information about how peekLock and message settlement works here: * https://docs.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock @@ -320,55 +243,26 @@ export class ServiceBusClient { * @param subscriptionName Name of the subscription (under the `topic`) that we want to receive from. * @param sessionId The id of the session from which messages need to be received * @param options Options include receiveMode(defaulted to peekLock), options to create session receiver. - * @returns A receiver that can be used to receive messages of the form `ServiceBusReceivedMessage` - */ - acceptSession( - topicName: string, - subscriptionName: string, - sessionId: string, - options?: ServiceBusSessionReceiverOptions<"peekLock"> - ): Promise; - /** - * Creates a receiver for a session enabled Azure Service Bus subscription in receiveAndDelete mode. - * If the receiveMode is not provided in the options, it defaults to the "peekLock" mode. - * - * In receiveAndDelete mode, messages are deleted from Service Bus as they are received. - * - * @param topicName Name of the topic for the subscription we want to receive from. - * @param subscriptionName Name of the subscription (under the `topic`) that we want to receive from. - * @param sessionId The id of the session from which messages need to be received - * @param options Options include receiveMode(defaulted to receiveAndDelete), options to create session receiver. - * @returns A receiver that can be used to receive messages of the form `ServiceBusReceivedMessage` + * @returns A receiver that can be used to receive, peek and settle messages. */ acceptSession( topicName: string, subscriptionName: string, sessionId: string, - options: ServiceBusSessionReceiverOptions<"receiveAndDelete"> + options?: ServiceBusSessionReceiverOptions ): Promise; async acceptSession( queueOrTopicName1: string, - optionsOrSubscriptionNameOrSessionId2?: - | ServiceBusSessionReceiverOptions<"peekLock"> - | ServiceBusSessionReceiverOptions<"receiveAndDelete"> - | string, - optionsOrSessionId3?: - | ServiceBusSessionReceiverOptions<"peekLock"> - | ServiceBusSessionReceiverOptions<"receiveAndDelete"> - | string, - options4?: - | ServiceBusSessionReceiverOptions<"peekLock"> - | ServiceBusSessionReceiverOptions<"receiveAndDelete"> + optionsOrSubscriptionNameOrSessionId2?: ServiceBusSessionReceiverOptions | string, + optionsOrSessionId3?: ServiceBusSessionReceiverOptions | string, + options4?: ServiceBusSessionReceiverOptions ): Promise { validateEntityPath(this._connectionContext.config, queueOrTopicName1); let sessionId: string; let entityPath: string; let receiveMode: "peekLock" | "receiveAndDelete"; - let options: - | ServiceBusSessionReceiverOptions<"peekLock"> - | ServiceBusSessionReceiverOptions<"receiveAndDelete"> - | undefined; + let options: ServiceBusSessionReceiverOptions | undefined; if ( typeof queueOrTopicName1 === "string" && @@ -425,57 +319,37 @@ export class ServiceBusClient { } /** - * Creates a receiver for the next available session in a session-enabled Azure Service Bus queue in peekLock mode. - * If the receiveMode is not provided in the options, it defaults to the "peekLock" mode. - * - * In peekLock mode, the receiver has a lock on the session for the duration specified on the - * queue. + * Creates a receiver for the next available session in a session-enabled Azure Service Bus queue. * - * Messages that are not settled within the lock duration will be redelivered as many times as - * the max delivery count set on the queue, after which they get sent to a separate dead letter + * You can choose between two receive modes: "peekLock" (default) and "receiveAndDelete". + * - In peekLock mode, the receiver has a lock on the message for the duration specified on the * queue. + * - In receiveAndDelete mode, messages are deleted from Service Bus as they are received. * - * You can settle a message by calling complete(), abandon(), defer() or deadletter() methods on - * the message. + * You can settle a message by calling completeMessage(), abandonMessage(), deferMessage() or + * deadletterMessage() methods on the receiver. * * More information about how peekLock and message settlement works here: * https://docs.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock * * @param queueName The name of the queue to receive from. * @param options Options include receiveMode(defaulted to peekLock), options to create session receiver. - * @returns A receiver that can be used to receive messages of the form `ServiceBusReceivedMessage` - */ - acceptNextSession( - queueName: string, - options?: ServiceBusSessionReceiverOptions<"peekLock"> - ): Promise; - /** - * Creates a receiver for the next available session in a session-enabled Azure Service Bus queue in receiveAndDelete mode. - * If the receiveMode is not provided in the options, it defaults to the "peekLock" mode. - * - * In receiveAndDelete mode, messages are deleted from Service Bus as they are received. - * - * @param queueName The name of the queue to receive from. - * @param options Options include receiveMode(defaulted to receiveAndDelete), options to create session receiver. - * @returns A receiver that can be used to receive messages of the form `ServiceBusReceivedMessage` + * @returns A receiver that can be used to receive, peek and settle messages. */ acceptNextSession( queueName: string, - options: ServiceBusSessionReceiverOptions<"receiveAndDelete"> + options?: ServiceBusSessionReceiverOptions ): Promise; /** - * Creates a receiver for the next available session in a session-enabled Azure Service Bus subscription in peekLock mode. - * If the receiveMode is not provided in the options, it defaults to the "peekLock" mode. - * - * In peekLock mode, the receiver has a lock on the session for the duration specified on the - * subscription. + * Creates a receiver for the next available session in a session-enabled Azure Service Bus subscription. * - * Messages that are not settled within the lock duration will be redelivered as many times as - * the max delivery count set on the subscription, after which they get sent to a separate dead letter + * You can choose between two receive modes: "peekLock" (default) and "receiveAndDelete". + * - In peekLock mode, the receiver has a lock on the message for the duration specified on the * queue. + * - In receiveAndDelete mode, messages are deleted from Service Bus as they are received. * - * You can settle a message by calling complete(), abandon(), defer() or deadletter() methods on - * the message. + * You can settle a message by calling completeMessage(), abandonMessage(), deferMessage() or + * deadletterMessage() methods on the receiver. * * More information about how peekLock and message settlement works here: * https://docs.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock @@ -483,38 +357,17 @@ export class ServiceBusClient { * @param topicName Name of the topic for the subscription we want to receive from. * @param subscriptionName Name of the subscription (under the `topic`) that we want to receive from. * @param options Options include receiveMode(defaulted to peekLock), options to create session receiver. - * @returns A receiver that can be used to receive messages of the form `ServiceBusReceivedMessage` - */ - acceptNextSession( - topicName: string, - subscriptionName: string, - options?: ServiceBusSessionReceiverOptions<"peekLock"> - ): Promise; - /** - * Creates a receiver for the next available session in a session-enabled Azure Service Bus subscription in receiveAndDelete mode. - * If the receiveMode is not provided in the options, it defaults to the "peekLock" mode. - * - * In receiveAndDelete mode, messages are deleted from Service Bus as they are received. - * - * @param topicName Name of the topic for the subscription we want to receive from. - * @param subscriptionName Name of the subscription (under the `topic`) that we want to receive from. - * @param options Options include receiveMode(defaulted to receiveAndDelete), options to create session receiver. - * @returns A receiver that can be used to receive messages of the form `ServiceBusReceivedMessage` + * @returns A receiver that can be used to receive, peek and settle messages. */ acceptNextSession( topicName: string, subscriptionName: string, - options: ServiceBusSessionReceiverOptions<"receiveAndDelete"> + options?: ServiceBusSessionReceiverOptions ): Promise; async acceptNextSession( queueOrTopicName1: string, - optionsOrSubscriptionName2?: - | ServiceBusSessionReceiverOptions<"peekLock"> - | ServiceBusSessionReceiverOptions<"receiveAndDelete"> - | string, - options3?: - | ServiceBusSessionReceiverOptions<"peekLock"> - | ServiceBusSessionReceiverOptions<"receiveAndDelete"> + optionsOrSubscriptionName2?: ServiceBusSessionReceiverOptions | string, + options3?: ServiceBusSessionReceiverOptions ): Promise { validateEntityPath(this._connectionContext.config, queueOrTopicName1); diff --git a/sdk/servicebus/service-bus/src/session/messageSession.ts b/sdk/servicebus/service-bus/src/session/messageSession.ts index 4f0af8ef61dd..ac2f49373722 100644 --- a/sdk/servicebus/service-bus/src/session/messageSession.ts +++ b/sdk/servicebus/service-bus/src/session/messageSession.ts @@ -54,7 +54,7 @@ export interface CreateMessageSessionReceiverLinkOptions { * Describes all the options that can be set while instantiating a MessageSession object. */ export type MessageSessionOptions = Pick< - ServiceBusSessionReceiverOptions<"receiveAndDelete">, + ServiceBusSessionReceiverOptions, "maxAutoLockRenewalDurationInMs" | "abortSignal" > & { receiveMode?: ReceiveMode; diff --git a/sdk/servicebus/service-bus/test/internal/serviceBusClient.spec.ts b/sdk/servicebus/service-bus/test/internal/serviceBusClient.spec.ts index 4b61ee116baa..4041acfdd8a5 100644 --- a/sdk/servicebus/service-bus/test/internal/serviceBusClient.spec.ts +++ b/sdk/servicebus/service-bus/test/internal/serviceBusClient.spec.ts @@ -27,9 +27,7 @@ describe("serviceBusClient unit tests", () => { // we pass. // So if we add other options types there's no need to generate a whole // new set of tests for it. :) - const sessionReceiverOptions: - | ServiceBusSessionReceiverOptions<"peekLock"> - | ServiceBusSessionReceiverOptions<"receiveAndDelete"> = {}; + const sessionReceiverOptions: ServiceBusSessionReceiverOptions = {}; const testEntities = [ { queue: "thequeue", entityPath: "thequeue" }, diff --git a/sdk/servicebus/service-bus/test/utils/testutils2.ts b/sdk/servicebus/service-bus/test/utils/testutils2.ts index ea95811021c3..9849b1f2aef8 100644 --- a/sdk/servicebus/service-bus/test/utils/testutils2.ts +++ b/sdk/servicebus/service-bus/test/utils/testutils2.ts @@ -325,7 +325,7 @@ export class ServiceBusTestHelpers { */ async createPeekLockReceiver( entityNames: Omit, "isPartitioned">, - options?: ServiceBusReceiverOptions<"peekLock"> + options?: ServiceBusReceiverOptions ): Promise { if (entityNames.usesSessions) { // if you're creating a receiver this way then you'll just use the default @@ -348,7 +348,7 @@ export class ServiceBusTestHelpers { async acceptNextSessionWithPeekLock( entityNames: Omit, "isPartitioned">, - options?: ServiceBusSessionReceiverOptions<"peekLock"> + options?: ServiceBusSessionReceiverOptions ) { if (!entityNames.usesSessions) { throw new TypeError( @@ -370,7 +370,7 @@ export class ServiceBusTestHelpers { async acceptSessionWithPeekLock( entityNames: Omit, "isPartitioned">, sessionId: string, - options?: ServiceBusSessionReceiverOptions<"peekLock"> + options?: ServiceBusSessionReceiverOptions ): Promise { if (!entityNames.usesSessions) { throw new TypeError(