Skip to content

Commit

Permalink
SubQueue renamed to _SubQueue and changed to internal for jsdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsin-mehmood committed Sep 23, 2020
1 parent cd31929 commit b97b682
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 17 deletions.
7 changes: 4 additions & 3 deletions sdk/servicebus/service-bus/review/service-bus.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ export interface CreateQueueOptions extends OperationOptions {
// @public
export interface CreateReceiverOptions<ReceiveModeT extends ReceiveMode> {
receiveMode?: ReceiveModeT;
subQueue?: SubQueue;
// @internal
_subQueue?: _SubQueue;
}

// @public
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion sdk/servicebus/service-bus/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export {
ReceiveMessagesOptions,
ReceiveMode,
SessionSubscribeOptions,
SubQueue,
_SubQueue,
SubscribeOptions
} from "./models";
export { OperationOptionsBase } from "./modelsToBeSharedWithEventHubs";
Expand Down
8 changes: 6 additions & 2 deletions sdk/servicebus/service-bus/src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";

/**
*
Expand Down Expand Up @@ -78,8 +80,10 @@ export interface CreateReceiverOptions<ReceiveModeT extends 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,
* see https://docs.microsoft.com/azure/service-bus-messaging/service-bus-dead-letter-queues
* @ignore
* @internal
*/
subQueue?: SubQueue;
_subQueue?: _SubQueue;
}

/**
Expand Down
6 changes: 3 additions & 3 deletions sdk/servicebus/service-bus/src/serviceBusClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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'`
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/servicebus/service-bus/test/invalidParameters.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/servicebus/service-bus/test/propsToModify.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
})
);

Expand Down
4 changes: 2 additions & 2 deletions sdk/servicebus/service-bus/test/serviceBusClient.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand All @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions sdk/servicebus/service-bus/test/utils/testutils2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -425,9 +425,9 @@ export class ServiceBusTestHelpers {
): ServiceBusReceiver<ServiceBusReceivedMessageWithLock> {
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"
})
);
}
Expand Down Expand Up @@ -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, {
Expand All @@ -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}`);
Expand Down

0 comments on commit b97b682

Please sign in to comment.