diff --git a/sdk/servicebus/service-bus/review/service-bus.api.md b/sdk/servicebus/service-bus/review/service-bus.api.md index e3bd17e72f09..9d47d9647b24 100644 --- a/sdk/servicebus/service-bus/review/service-bus.api.md +++ b/sdk/servicebus/service-bus/review/service-bus.api.md @@ -120,7 +120,8 @@ export interface CreateQueueOptions extends OperationOptions { // @public export interface CreateReceiverOptions { receiveMode?: ReceiveModeT; - subQueue?: SubQueue; + // @internal + _subQueue?: _SubQueue; } // @public @@ -478,8 +479,8 @@ export interface SqlRuleFilter { }; } -// @public -export type SubQueue = "deadLetter" | "transferDeadLetter"; +// @internal +export type _SubQueue = "deadLetter" | "transferDeadLetter"; // @public export interface SubscribeOptions extends MessageHandlerOptions { diff --git a/sdk/servicebus/service-bus/src/index.ts b/sdk/servicebus/service-bus/src/index.ts index 283c4854bf36..23772f60eafc 100644 --- a/sdk/servicebus/service-bus/src/index.ts +++ b/sdk/servicebus/service-bus/src/index.ts @@ -28,7 +28,7 @@ export { ReceiveMessagesOptions, ReceiveMode, SessionSubscribeOptions, - SubQueue, + _SubQueue, SubscribeOptions } from "./models"; export { OperationOptionsBase } from "./modelsToBeSharedWithEventHubs"; diff --git a/sdk/servicebus/service-bus/src/models.ts b/sdk/servicebus/service-bus/src/models.ts index 1d83b6421be6..67847477a7c1 100644 --- a/sdk/servicebus/service-bus/src/models.ts +++ b/sdk/servicebus/service-bus/src/models.ts @@ -44,8 +44,10 @@ export type ReceiveMode = "peekLock" | "receiveAndDelete"; * 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, * see https://docs.microsoft.com/azure/service-bus-messaging/service-bus-dead-letter-queues + * @internal + * @ignore */ -export type SubQueue = "deadLetter" | "transferDeadLetter"; +export type _SubQueue = "deadLetter" | "transferDeadLetter"; /** * @@ -78,8 +80,10 @@ export interface CreateReceiverOptions { * 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, * see https://docs.microsoft.com/azure/service-bus-messaging/service-bus-dead-letter-queues + * @ignore + * @internal */ - subQueue?: SubQueue; + _subQueue?: _SubQueue; } /** diff --git a/sdk/servicebus/service-bus/src/serviceBusClient.ts b/sdk/servicebus/service-bus/src/serviceBusClient.ts index 4185b2c7f59d..350f23fd54e5 100644 --- a/sdk/servicebus/service-bus/src/serviceBusClient.ts +++ b/sdk/servicebus/service-bus/src/serviceBusClient.ts @@ -219,8 +219,8 @@ export class ServiceBusClient { ); let entityPathWithSubQueue = entityPath; - if (options?.subQueue) { - switch (options?.subQueue) { + if (options?._subQueue) { + switch (options?._subQueue) { case "deadLetter": entityPathWithSubQueue += "/$DeadLetterQueue"; break; @@ -229,7 +229,7 @@ export class ServiceBusClient { break; default: throw new Error( - `Invalid subQueue '${options?.subQueue}' provided. Valid values are 'deadLetter' and 'transferDeadLetter'` + `Invalid subQueue '${options?._subQueue}' provided. Valid values are 'deadLetter' and 'transferDeadLetter'` ); } } diff --git a/sdk/servicebus/service-bus/test/invalidParameters.spec.ts b/sdk/servicebus/service-bus/test/invalidParameters.spec.ts index 1fc3620f7038..1af2ae4723ad 100644 --- a/sdk/servicebus/service-bus/test/invalidParameters.spec.ts +++ b/sdk/servicebus/service-bus/test/invalidParameters.spec.ts @@ -233,7 +233,7 @@ describe("invalid parameters", () => { let errorCaught: string = ""; try { // @ts-expect-error - sbClient.createReceiver("dummyQueue", { subQueue: 123 }); + sbClient.createReceiver("dummyQueue", { _subQueue: 123 }); } catch (error) { errorCaught = error.message; } diff --git a/sdk/servicebus/service-bus/test/propsToModify.spec.ts b/sdk/servicebus/service-bus/test/propsToModify.spec.ts index 4e80af4c1b34..fad50c37d342 100644 --- a/sdk/servicebus/service-bus/test/propsToModify.spec.ts +++ b/sdk/servicebus/service-bus/test/propsToModify.spec.ts @@ -47,7 +47,7 @@ describe("dead lettering", () => { // receiveAndDelete since I don't care about further settlement after it's been dead lettered! serviceBusClient.createReceiver(entityNames.queue, { receiveMode: "receiveAndDelete", - subQueue: "deadLetter" + _subQueue: "deadLetter" }) ); diff --git a/sdk/servicebus/service-bus/test/serviceBusClient.spec.ts b/sdk/servicebus/service-bus/test/serviceBusClient.spec.ts index 6c6bcd1e956e..3f7c4c92d29a 100644 --- a/sdk/servicebus/service-bus/test/serviceBusClient.spec.ts +++ b/sdk/servicebus/service-bus/test/serviceBusClient.spec.ts @@ -721,7 +721,7 @@ describe("entityPath on sender and receiver", async () => { it("Entity Path on Queue deadletter Receiver", () => { const dummyQueueName = "dummy"; - const receiver = sbClient.createReceiver(dummyQueueName, { subQueue: "deadLetter" }); + const receiver = sbClient.createReceiver(dummyQueueName, { _subQueue: "deadLetter" }); should.equal( receiver.entityPath, `${dummyQueueName}/$DeadLetterQueue`, @@ -744,7 +744,7 @@ describe("entityPath on sender and receiver", async () => { const dummyTopicName = "dummyTopicName"; const dummySubscriptionName = "dummySubscriptionName"; const receiver = sbClient.createReceiver(dummyTopicName, dummySubscriptionName, { - subQueue: "deadLetter" + _subQueue: "deadLetter" }); should.equal( receiver.entityPath, diff --git a/sdk/servicebus/service-bus/test/utils/testutils2.ts b/sdk/servicebus/service-bus/test/utils/testutils2.ts index 8cd61aa7abeb..df08407c63d5 100644 --- a/sdk/servicebus/service-bus/test/utils/testutils2.ts +++ b/sdk/servicebus/service-bus/test/utils/testutils2.ts @@ -425,9 +425,9 @@ export class ServiceBusTestHelpers { ): ServiceBusReceiver { return this.addToCleanup( entityNames.queue - ? this._serviceBusClient.createReceiver(entityNames.queue, { subQueue: "deadLetter" }) + ? this._serviceBusClient.createReceiver(entityNames.queue, { _subQueue: "deadLetter" }) : this._serviceBusClient.createReceiver(entityNames.topic!, entityNames.subscription!, { - subQueue: "deadLetter" + _subQueue: "deadLetter" }) ); } @@ -459,7 +459,7 @@ async function purgeForTestClientType( receiver = serviceBusClient.createReceiver(entityPaths.queue, "receiveAndDelete"); deadLetterReceiver = serviceBusClient.createReceiver(entityPaths.queue, { receiveMode: "receiveAndDelete", - subQueue: "deadLetter" + _subQueue: "deadLetter" }); } else if (entityPaths.topic && entityPaths.subscription) { receiver = serviceBusClient.createReceiver(entityPaths.topic, entityPaths.subscription, { @@ -468,7 +468,7 @@ async function purgeForTestClientType( deadLetterReceiver = serviceBusClient.createReceiver( entityPaths.topic, entityPaths.subscription, - { receiveMode: "receiveAndDelete", subQueue: "deadLetter" } + { receiveMode: "receiveAndDelete", _subQueue: "deadLetter" } ); } else { throw new Error(`Unsupported TestClientType for purge: ${testClientType}`);