@azure/service-bus 7.10.0-alpha.20250303.1 → 7.10.0-alpha.20250305.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"messageSender.js","sourceRoot":"","sources":["../../../src/core/messageSender.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,YAAY,IAAI,MAAM,EAAE,MAAM,WAAW,CAAC;AAQnD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,cAAc,CAAC;AAO1D,OAAO,EAAE,SAAS,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAElG,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,8BAA8B,EAAE,MAAM,kBAAkB,CAAC;AAClG,OAAO,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAC;AAEjE,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAI1E,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAClF,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/D;;;GAGG;AACH,MAAM,OAAO,aAAc,SAAQ,UAA2B;IAyB5D,YACU,UAAkB,EAC1B,iBAAoC,EACpC,UAAkB,EAClB,YAA0B;QAE1B,KAAK,CAAC,UAAU,EAAE,UAAU,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,EAAE;YACjE,OAAO,EAAE,UAAU;YACnB,QAAQ,EAAE,GAAG,iBAAiB,CAAC,MAAM,CAAC,QAAQ,GAAG,UAAU,EAAE;SAC9D,CAA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c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { senderLogger as logger } from \"../log.js\";\nimport type {\n AmqpError,\n AwaitableSender,\n AwaitableSenderOptions,\n EventContext,\n OnAmqpEvent,\n} from \"rhea-promise\";\nimport { message as RheaMessageUtil } from \"rhea-promise\";\nimport type {\n MessagingError,\n RetryConfig,\n RetryOptions,\n AmqpAnnotatedMessage,\n} from \"@azure/core-amqp\";\nimport { Constants, ErrorNameConditionMapper, RetryOperationType, retry } from \"@azure/core-amqp\";\nimport type { ServiceBusMessage } from \"../serviceBusMessage.js\";\nimport { toRheaMessage } from \"../serviceBusMessage.js\";\nimport type { ConnectionContext } from \"../connectionContext.js\";\nimport { LinkEntity } from \"./linkEntity.js\";\nimport { getUniqueName, waitForSendable, waitForTimeoutOrAbortOrResolve } from \"../util/utils.js\";\nimport { throwErrorIfConnectionClosed } from \"../util/errors.js\";\nimport type { ServiceBusMessageBatch } from \"../serviceBusMessageBatch.js\";\nimport { ServiceBusMessageBatchImpl } from \"../serviceBusMessageBatch.js\";\nimport type { CreateMessageBatchOptions } from \"../models.js\";\nimport type { OperationOptionsBase } from \"../modelsToBeSharedWithEventHubs.js\";\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport { ServiceBusError, translateServiceBusError } from \"../serviceBusError.js\";\nimport { isDefined } from \"@azure/core-util\";\nimport { defaultDataTransformer } from \"../dataTransformer.js\";\n\n/**\n * @internal\n * Describes the MessageSender that will send messages to ServiceBus.\n */\nexport class MessageSender extends LinkEntity<AwaitableSender> {\n /**\n * The handler function to handle errors that happen on the\n * underlying sender.\n * @readonly\n */\n private readonly _onAmqpError: OnAmqpEvent;\n /**\n * The handler function to handle \"sender_close\" event\n * that happens on the underlying sender.\n * @readonly\n */\n private readonly _onAmqpClose: OnAmqpEvent;\n /**\n * The message handler that will be set as the handler on\n * the underlying rhea sender's session for the \"session_error\" event.\n */\n private _onSessionError: OnAmqpEvent;\n /**\n * The message handler that will be set as the handler on\n * the underlying rhea sender's session for the \"session_close\" event.\n */\n private _onSessionClose: OnAmqpEvent;\n private _retryOptions: RetryOptions;\n\n constructor(\n private identifier: string,\n connectionContext: ConnectionContext,\n entityPath: string,\n retryOptions: RetryOptions,\n ) {\n super(entityPath, entityPath, connectionContext, \"sender\", logger, {\n address: entityPath,\n audience: `${connectionContext.config.endpoint}${entityPath}`,\n });\n this._retryOptions = retryOptions;\n this._onAmqpError = (context: EventContext) => {\n const senderError = context.sender && context.sender.error;\n logger.logError(\n senderError,\n \"%s 'sender_error' event occurred on the sender '%s' with address '%s'. \" +\n \"The associated error\",\n this.logPrefix,\n this.name,\n this.address,\n );\n // TODO: Consider rejecting promise in trySendBatch() or createBatch()\n };\n\n this._onSessionError = (context: EventContext) => {\n const sessionError = context.session && context.session.error;\n logger.logError(\n sessionError,\n \"%s 'session_error' event occurred on the session of sender '%s' with address '%s'. \" +\n \"The associated error\",\n this.logPrefix,\n this.name,\n this.address,\n );\n // TODO: Consider rejecting promise in trySendBatch() or createBatch()\n };\n\n this._onAmqpClose = async (context: EventContext) => {\n const senderError = context.sender && context.sender.error;\n\n logger.logError(\n senderError,\n `${this.logPrefix} 'sender_close' event occurred. The associated error is`,\n );\n\n await this.onDetached().catch((err) => {\n logger.logError(\n err,\n `${this.logPrefix} error when closing sender after 'sender_close' event`,\n );\n });\n };\n\n this._onSessionClose = async (context: EventContext) => {\n const sessionError = context.session && context.session.error;\n\n logger.logError(\n sessionError,\n `${this.logPrefix} 'session_close' event occurred. The associated error is`,\n );\n\n await this.onDetached().catch((err) => {\n logger.logError(\n err,\n `${this.logPrefix} error when closing sender after 'session_close' event`,\n );\n });\n };\n }\n\n private _createSenderOptions(newName?: boolean): AwaitableSenderOptions {\n if (newName) this.name = getUniqueName(this.baseName);\n const srOptions: AwaitableSenderOptions = {\n name: this.name,\n target: {\n address: this.address,\n },\n source: this.identifier,\n onError: this._onAmqpError,\n onClose: this._onAmqpClose,\n onSessionError: this._onSessionError,\n onSessionClose: this._onSessionClose,\n };\n logger.verbose(`${this.logPrefix} Creating sender with options: %O`, srOptions);\n return srOptions;\n }\n\n /**\n * Tries to send the message to ServiceBus if there is enough credit to send them\n * and the circular buffer has available space to settle the message after sending them.\n *\n * We have implemented a synchronous send over here in the sense that we shall be waiting\n * for the message to be accepted or rejected and accordingly resolve or reject the promise.\n *\n * @param encodedMessage - The encoded message to be sent to ServiceBus.\n * @param sendBatch - Boolean indicating whether the encoded message represents a batch of messages or not\n */\n private _trySend(\n encodedMessage: Buffer,\n sendBatch: boolean,\n options: OperationOptionsBase | undefined,\n ): Promise<void> {\n const abortSignal = options?.abortSignal;\n const timeoutInMs = !isDefined(this._retryOptions.timeoutInMs)\n ? Constants.defaultOperationTimeoutInMs\n : this._retryOptions.timeoutInMs;\n\n const sendEventPromise = async (): Promise<void> => {\n const initStartTime = Date.now();\n if (!this.isOpen()) {\n try {\n await waitForTimeoutOrAbortOrResolve({\n actionFn: () => this.open(undefined, options?.abortSignal),\n abortSignal: options?.abortSignal,\n timeoutMs: timeoutInMs,\n timeoutMessage:\n `[${this._context.connectionId}] Sender \"${this.name}\" ` +\n `with address \"${this.address}\", was not able to send the message right now, due ` +\n `to operation timeout.`,\n });\n } catch (err: any) {\n const translatedError = translateServiceBusError(err);\n logger.logError(\n translatedError,\n \"%s An error occurred while creating the sender\",\n this.logPrefix,\n this.name,\n );\n throw translatedError;\n }\n }\n\n const timeTakenByInit = Date.now() - initStartTime;\n\n logger.verbose(\n \"%s Sender '%s', credit: %d available: %d\",\n this.logPrefix,\n this.name,\n this.link?.credit,\n this.link?.session?.outgoing?.available(),\n );\n\n const waitingTime = await waitForSendable(\n logger,\n this.logPrefix,\n this.name,\n timeoutInMs - timeTakenByInit,\n this.link,\n this.link?.session?.outgoing?.available(),\n );\n\n if (timeoutInMs <= timeTakenByInit + waitingTime) {\n const desc: string =\n `${this.logPrefix} Sender \"${this.name}\" ` +\n `with address \"${this.address}\", was not able to send the message right now, due ` +\n `to operation timeout.`;\n logger.warning(desc);\n const e: AmqpError = {\n condition: ErrorNameConditionMapper.ServiceUnavailableError,\n description: desc,\n };\n throw translateServiceBusError(e);\n }\n\n if (!this.link) {\n const msg = `[${this.logPrefix}] Cannot send the message. Link is not ready.`;\n logger.warning(msg);\n const amqpError: AmqpError = {\n condition: ErrorNameConditionMapper.SenderNotReadyError,\n description: msg,\n };\n throw translateServiceBusError(amqpError);\n }\n try {\n const delivery = await this.link.send(encodedMessage, {\n format: sendBatch ? 0x80013700 : 0,\n timeoutInSeconds: (timeoutInMs - timeTakenByInit - waitingTime) / 1000,\n abortSignal,\n });\n logger.verbose(\n \"%s Sender '%s', sent message with delivery id: %d\",\n this.logPrefix,\n this.name,\n delivery.id,\n );\n } catch (error: any) {\n const translatedError = translateServiceBusError(error.innerError || error);\n logger.logError(\n translatedError,\n `${this.logPrefix} An error occurred while sending the message`,\n );\n throw translatedError;\n }\n };\n const config: RetryConfig<void> = {\n operation: sendEventPromise,\n connectionId: this._context.connectionId!,\n operationType: RetryOperationType.sendMessage,\n retryOptions: this._retryOptions,\n abortSignal: abortSignal,\n };\n\n return retry<void>(config);\n }\n\n protected createRheaLink(options: AwaitableSenderOptions): Promise<AwaitableSender> {\n return this._context.connection.createAwaitableSender(options);\n }\n\n /**\n * Initializes the sender session on the connection.\n */\n public async open(\n options?: AwaitableSenderOptions,\n abortSignal?: AbortSignalLike,\n ): Promise<void> {\n try {\n if (!options) {\n options = this._createSenderOptions();\n }\n await this.initLink(options, abortSignal);\n } catch (err: any) {\n const translatedError = translateServiceBusError(err);\n logger.logError(\n translatedError,\n `${this.logPrefix} An error occurred while creating the sender`,\n );\n // Fix the unhelpful error messages for the OperationTimeoutError that comes from `rhea-promise`.\n if ((translatedError as MessagingError).code === \"OperationTimeoutError\") {\n translatedError.message =\n \"Failed to create a sender within allocated time and retry attempts.\";\n }\n throw translatedError;\n }\n }\n\n /**\n * Closes the rhea link.\n * To be called when connection is disconnected, onAmqpClose and onSessionClose events.\n */\n async onDetached(): Promise<void> {\n // Clears the token renewal timer. Closes the link and its session if they are open.\n // Removes the link and its session if they are present in rhea's cache.\n await this.closeLink();\n }\n\n /**\n * Determines whether the AMQP sender link is open. If open then returns true else returns false.\n */\n isOpen(): boolean {\n const result: boolean = this.link == null ? false : this.link.isOpen();\n logger.verbose(\n \"%s Sender '%s' with address '%s' is open? -> %s\",\n this.logPrefix,\n this.name,\n this.address,\n result,\n );\n return result;\n }\n\n /**\n * Sends the given message, with the given options on this link\n *\n * @param data - Message to send. Will be sent as UTF8-encoded JSON string.\n */\n async send(\n data: ServiceBusMessage | AmqpAnnotatedMessage,\n options?: OperationOptionsBase,\n ): Promise<void> {\n throwErrorIfConnectionClosed(this._context);\n try {\n const amqpMessage = toRheaMessage(data, defaultDataTransformer);\n\n // TODO: this body of logic is really similar to what's in sendMessages. Unify what we can.\n const encodedMessage = RheaMessageUtil.encode(amqpMessage);\n logger.verbose(\"%s Sender '%s', trying to send message: %O\", this.logPrefix, this.name, data);\n return await this._trySend(encodedMessage, false, options);\n } catch (err: any) {\n logger.logError(\n err,\n \"%s An error occurred while sending the message: %O\\nError\",\n this.logPrefix,\n data,\n );\n throw err;\n }\n }\n\n /**\n * Returns maximum message size on the AMQP sender link.\n *\n * Options to configure the `createBatch` method on the `Sender`.\n * - `maxSizeInBytes`: The upper limit for the size of batch.\n *\n * Example usage:\n * ```js\n * {\n * retryOptions: { maxRetries: 5; timeoutInMs: 10 }\n * }\n * ```\n */\n async getMaxMessageSize(\n options: {\n retryOptions?: RetryOptions;\n } & Pick<OperationOptionsBase, \"abortSignal\"> = {},\n ): Promise<number> {\n const retryOptions = options.retryOptions || {};\n if (this.isOpen()) {\n return this.link!.maxMessageSize;\n }\n\n const config: RetryConfig<number> = {\n operation: async () => {\n await this.open(undefined, options?.abortSignal);\n\n if (this.link) {\n return this.link.maxMessageSize;\n }\n\n throw new ServiceBusError(\n \"Link failed to initialize, cannot get max message size.\",\n \"GeneralError\",\n );\n },\n connectionId: this._context.connectionId,\n operationType: RetryOperationType.senderLink,\n retryOptions: retryOptions,\n abortSignal: options?.abortSignal,\n };\n\n return retry(config);\n }\n\n async createBatch(options?: CreateMessageBatchOptions): Promise<ServiceBusMessageBatch> {\n throwErrorIfConnectionClosed(this._context);\n let maxMessageSize = await this.getMaxMessageSize({\n retryOptions: this._retryOptions,\n abortSignal: options?.abortSignal,\n });\n if (options?.maxSizeInBytes) {\n if (options.maxSizeInBytes > maxMessageSize!) {\n const error = new Error(\n `Max message size (${options.maxSizeInBytes} bytes) is greater than maximum message size (${maxMessageSize} bytes) on the AMQP sender link.`,\n );\n throw error;\n }\n maxMessageSize = options.maxSizeInBytes;\n }\n return new ServiceBusMessageBatchImpl(this._context, maxMessageSize!);\n }\n\n async sendBatch(\n batchMessage: ServiceBusMessageBatch,\n options?: OperationOptionsBase,\n ): Promise<void> {\n throwErrorIfConnectionClosed(this._context);\n try {\n logger.verbose(\n \"%s Sender '%s', sending encoded batch message.\",\n this.logPrefix,\n this.name,\n batchMessage,\n );\n return await this._trySend(batchMessage._generateMessage(), true, options);\n } catch (err: any) {\n logger.logError(\n err,\n \"%s Sender '%s': An error occurred while sending the messages: %O\\nError\",\n this.logPrefix,\n this.name,\n batchMessage,\n );\n throw err;\n }\n }\n\n static create(\n identifier: string,\n context: ConnectionContext,\n entityPath: string,\n retryOptions: RetryOptions,\n ): MessageSender {\n throwErrorIfConnectionClosed(context);\n\n const sbSender = new MessageSender(identifier, context, entityPath, retryOptions);\n context.senders[sbSender.name] = sbSender;\n return sbSender;\n }\n\n protected removeLinkFromContext(): void {\n delete this._context.senders[this.name];\n }\n}\n"]}
1
+ {"version":3,"file":"messageSender.js","sourceRoot":"","sources":["../../../src/core/messageSender.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,YAAY,IAAI,MAAM,EAAE,MAAM,WAAW,CAAC;AAQnD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,cAAc,CAAC;AAO1D,OAAO,EAAE,SA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,EAChD,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,IAAI,EACT,YAAY,CACb,CAAC;YACF,OAAO,MAAM,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QAC7E,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,MAAM,CAAC,QAAQ,CACb,GAAG,EACH,yEAAyE,EACzE,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,IAAI,EACT,YAAY,CACb,CAAC;YACF,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC;IAED,MAAM,CAAC,MAAM,CACX,UAAkB,EAClB,OAA0B,EAC1B,UAAkB,EAClB,YAA0B;QAE1B,4BAA4B,CAAC,OAAO,CAAC,CAAC;QAEtC,MAAM,QAAQ,GAAG,IAAI,aAAa,CAAC,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC;QAClF,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC;QAC1C,OAAO,QAAQ,CAAC;IAClB,CAAC;IAES,qBAAqB;QAC7B,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1C,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { senderLogger as logger } from \"../log.js\";\nimport type {\n AmqpError,\n AwaitableSender,\n AwaitableSenderOptions,\n EventContext,\n OnAmqpEvent,\n} from \"rhea-promise\";\nimport { message as RheaMessageUtil } from \"rhea-promise\";\nimport type {\n MessagingError,\n RetryConfig,\n RetryOptions,\n AmqpAnnotatedMessage,\n} from \"@azure/core-amqp\";\nimport { Constants, ErrorNameConditionMapper, RetryOperationType, retry } from \"@azure/core-amqp\";\nimport type { ServiceBusMessage } from \"../serviceBusMessage.js\";\nimport { toRheaMessage } from \"../serviceBusMessage.js\";\nimport type { ConnectionContext } from \"../connectionContext.js\";\nimport { LinkEntity } from \"./linkEntity.js\";\nimport { getUniqueName, waitForSendable, waitForTimeoutOrAbortOrResolve } from \"../util/utils.js\";\nimport { throwErrorIfConnectionClosed } from \"../util/errors.js\";\nimport type { ServiceBusMessageBatch } from \"../serviceBusMessageBatch.js\";\nimport { ServiceBusMessageBatchImpl } from \"../serviceBusMessageBatch.js\";\nimport type { CreateMessageBatchOptions } from \"../models.js\";\nimport type { OperationOptionsBase } from \"../modelsToBeSharedWithEventHubs.js\";\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport { ServiceBusError, translateServiceBusError } from \"../serviceBusError.js\";\nimport { isDefined } from \"@azure/core-util\";\nimport { defaultDataTransformer } from \"../dataTransformer.js\";\n\n/**\n * @internal\n * Describes the MessageSender that will send messages to ServiceBus.\n */\nexport class MessageSender extends LinkEntity<AwaitableSender> {\n /**\n * The handler function to handle errors that happen on the\n * underlying sender.\n * @readonly\n */\n private readonly _onAmqpError: OnAmqpEvent;\n /**\n * The handler function to handle \"sender_close\" event\n * that happens on the underlying sender.\n * @readonly\n */\n private readonly _onAmqpClose: OnAmqpEvent;\n /**\n * The message handler that will be set as the handler on\n * the underlying rhea sender's session for the \"session_error\" event.\n */\n private _onSessionError: OnAmqpEvent;\n /**\n * The message handler that will be set as the handler on\n * the underlying rhea sender's session for the \"session_close\" event.\n */\n private _onSessionClose: OnAmqpEvent;\n private _retryOptions: RetryOptions;\n\n constructor(\n private identifier: string,\n connectionContext: ConnectionContext,\n entityPath: string,\n retryOptions: RetryOptions,\n ) {\n super(entityPath, entityPath, connectionContext, \"sender\", logger, {\n address: entityPath,\n audience: `${connectionContext.config.endpoint}${entityPath}`,\n });\n this._retryOptions = retryOptions;\n this._onAmqpError = (context: EventContext) => {\n const senderError = context.sender && context.sender.error;\n logger.logError(\n senderError,\n \"%s 'sender_error' event occurred on the sender '%s' with address '%s'. \" +\n \"The associated error\",\n this.logPrefix,\n this.name,\n this.address,\n );\n // TODO: Consider rejecting promise in trySendBatch() or createBatch()\n };\n\n this._onSessionError = (context: EventContext) => {\n const sessionError = context.session && context.session.error;\n logger.logError(\n sessionError,\n \"%s 'session_error' event occurred on the session of sender '%s' with address '%s'. \" +\n \"The associated error\",\n this.logPrefix,\n this.name,\n this.address,\n );\n // TODO: Consider rejecting promise in trySendBatch() or createBatch()\n };\n\n this._onAmqpClose = async (context: EventContext) => {\n const senderError = context.sender && context.sender.error;\n\n logger.logError(\n senderError,\n `${this.logPrefix} 'sender_close' event occurred. The associated error is`,\n );\n\n await this.onDetached().catch((err) => {\n logger.logError(\n err,\n `${this.logPrefix} error when closing sender after 'sender_close' event`,\n );\n });\n };\n\n this._onSessionClose = async (context: EventContext) => {\n const sessionError = context.session && context.session.error;\n\n logger.logError(\n sessionError,\n `${this.logPrefix} 'session_close' event occurred. The associated error is`,\n );\n\n await this.onDetached().catch((err) => {\n logger.logError(\n err,\n `${this.logPrefix} error when closing sender after 'session_close' event`,\n );\n });\n };\n }\n\n private _createSenderOptions(newName?: boolean): AwaitableSenderOptions {\n if (newName) this.name = getUniqueName(this.baseName);\n const srOptions: AwaitableSenderOptions = {\n name: this.name,\n target: {\n address: this.address,\n },\n source: this.identifier,\n onError: this._onAmqpError,\n onClose: this._onAmqpClose,\n onSessionError: this._onSessionError,\n onSessionClose: this._onSessionClose,\n };\n logger.verbose(`${this.logPrefix} Creating sender with options: %O`, srOptions);\n return srOptions;\n }\n\n /**\n * Tries to send the message to ServiceBus if there is enough credit to send them\n * and the circular buffer has available space to settle the message after sending them.\n *\n * We have implemented a synchronous send over here in the sense that we shall be waiting\n * for the message to be accepted or rejected and accordingly resolve or reject the promise.\n *\n * @param encodedMessage - The encoded message to be sent to ServiceBus.\n * @param sendBatch - Boolean indicating whether the encoded message represents a batch of messages or not\n */\n private _trySend(\n encodedMessage: Buffer,\n sendBatch: boolean,\n options: OperationOptionsBase | undefined,\n ): Promise<void> {\n const abortSignal = options?.abortSignal;\n const timeoutInMs = !isDefined(this._retryOptions.timeoutInMs)\n ? Constants.defaultOperationTimeoutInMs\n : this._retryOptions.timeoutInMs;\n\n const sendEventPromise = async (): Promise<void> => {\n const initStartTime = Date.now();\n if (!this.isOpen()) {\n try {\n await waitForTimeoutOrAbortOrResolve({\n actionFn: () => this.open(undefined, options?.abortSignal),\n abortSignal: options?.abortSignal,\n timeoutMs: timeoutInMs,\n timeoutMessage:\n `[${this._context.connectionId}] Sender \"${this.name}\" ` +\n `with address \"${this.address}\", was not able to send the message right now, due ` +\n `to operation timeout.`,\n });\n } catch (err: any) {\n const translatedError = translateServiceBusError(err);\n logger.logError(\n translatedError,\n \"%s An error occurred while creating the sender\",\n this.logPrefix,\n this.name,\n );\n throw translatedError;\n }\n }\n\n const timeTakenByInit = Date.now() - initStartTime;\n\n logger.verbose(\n \"%s Sender '%s', credit: %d available: %d\",\n this.logPrefix,\n this.name,\n this.link?.credit,\n this.link?.session?.outgoing?.available(),\n );\n\n const waitingTime = await waitForSendable(\n logger,\n this.logPrefix,\n this.name,\n timeoutInMs - timeTakenByInit,\n this.link,\n this.link?.session?.outgoing?.available(),\n );\n\n if (timeoutInMs <= timeTakenByInit + waitingTime) {\n const desc: string =\n `${this.logPrefix} Sender \"${this.name}\" ` +\n `with address \"${this.address}\", was not able to send the message right now, due ` +\n `to operation timeout.`;\n logger.warning(desc);\n const e: AmqpError = {\n condition: ErrorNameConditionMapper.ServiceUnavailableError,\n description: desc,\n };\n throw translateServiceBusError(e);\n }\n\n if (!this.link) {\n const msg = `[${this.logPrefix}] Cannot send the message. Link is not ready.`;\n logger.warning(msg);\n const amqpError: AmqpError = {\n condition: ErrorNameConditionMapper.SenderNotReadyError,\n description: msg,\n };\n throw translateServiceBusError(amqpError);\n }\n try {\n const delivery = await this.link.send(encodedMessage, {\n format: sendBatch ? 0x80013700 : 0,\n timeoutInSeconds: (timeoutInMs - timeTakenByInit - waitingTime) / 1000,\n abortSignal,\n });\n logger.verbose(\n \"%s Sender '%s', sent message with delivery id: %d\",\n this.logPrefix,\n this.name,\n delivery.id,\n );\n } catch (error: any) {\n const translatedError = translateServiceBusError(error.innerError || error);\n logger.logError(\n translatedError,\n `${this.logPrefix} An error occurred while sending the message`,\n );\n throw translatedError;\n }\n };\n const config: RetryConfig<void> = {\n operation: sendEventPromise,\n connectionId: this._context.connectionId!,\n operationType: RetryOperationType.sendMessage,\n retryOptions: this._retryOptions,\n abortSignal: abortSignal,\n };\n\n return retry<void>(config);\n }\n\n protected createRheaLink(options: AwaitableSenderOptions): Promise<AwaitableSender> {\n return this._context.connection.createAwaitableSender(options);\n }\n\n /**\n * Initializes the sender session on the connection.\n */\n public async open(\n options?: AwaitableSenderOptions,\n abortSignal?: AbortSignalLike,\n ): Promise<void> {\n try {\n if (!options) {\n options = this._createSenderOptions();\n }\n await this.initLink(options, abortSignal);\n } catch (err: any) {\n const translatedError = translateServiceBusError(err);\n logger.logError(\n translatedError,\n `${this.logPrefix} An error occurred while creating the sender`,\n );\n // Fix the unhelpful error messages for the OperationTimeoutError that comes from `rhea-promise`.\n if ((translatedError as MessagingError).code === \"OperationTimeoutError\") {\n translatedError.message =\n \"Failed to create a sender within allocated time and retry attempts.\";\n }\n throw translatedError;\n }\n }\n\n /**\n * Closes the rhea link.\n * To be called when connection is disconnected, onAmqpClose and onSessionClose events.\n */\n async onDetached(): Promise<void> {\n // Clears the token renewal timer. Closes the link and its session if they are open.\n // Removes the link and its session if they are present in rhea's cache.\n await this.closeLink();\n }\n\n /**\n * Determines whether the AMQP sender link is open. If open then returns true else returns false.\n */\n isOpen(): boolean {\n const result: boolean = this.link == null ? false : this.link.isOpen();\n logger.verbose(\n \"%s Sender '%s' with address '%s' is open? -> %s\",\n this.logPrefix,\n this.name,\n this.address,\n result,\n );\n return result;\n }\n\n /**\n * Sends the given message, with the given options on this link\n *\n * @param data - Message to send. Will be sent as UTF8-encoded JSON string.\n */\n async send(\n data: ServiceBusMessage | AmqpAnnotatedMessage,\n options?: OperationOptionsBase,\n ): Promise<void> {\n throwErrorIfConnectionClosed(this._context);\n try {\n const amqpMessage = toRheaMessage(data, defaultDataTransformer);\n\n // TODO: this body of logic is really similar to what's in sendMessages. Unify what we can.\n const encodedMessage = RheaMessageUtil.encode(amqpMessage);\n logger.verbose(\"%s Sender '%s', trying to send message: %O\", this.logPrefix, this.name, data);\n return await this._trySend(encodedMessage, false, options);\n } catch (err: any) {\n logger.logError(\n err,\n \"%s An error occurred while sending the message: %O\\nError\",\n this.logPrefix,\n data,\n );\n throw err;\n }\n }\n\n /**\n * Returns maximum message size on the AMQP sender link.\n *\n * Options to configure the `createBatch` method on the `Sender`.\n * - `maxSizeInBytes`: The upper limit for the size of batch.\n *\n * Example usage:\n * ```ts snippet:ignore\n * {\n * retryOptions: { maxRetries: 5; timeoutInMs: 10 }\n * }\n * ```\n */\n async getMaxMessageSize(\n options: {\n retryOptions?: RetryOptions;\n } & Pick<OperationOptionsBase, \"abortSignal\"> = {},\n ): Promise<number> {\n const retryOptions = options.retryOptions || {};\n if (this.isOpen()) {\n return this.link!.maxMessageSize;\n }\n\n const config: RetryConfig<number> = {\n operation: async () => {\n await this.open(undefined, options?.abortSignal);\n\n if (this.link) {\n return this.link.maxMessageSize;\n }\n\n throw new ServiceBusError(\n \"Link failed to initialize, cannot get max message size.\",\n \"GeneralError\",\n );\n },\n connectionId: this._context.connectionId,\n operationType: RetryOperationType.senderLink,\n retryOptions: retryOptions,\n abortSignal: options?.abortSignal,\n };\n\n return retry(config);\n }\n\n async createBatch(options?: CreateMessageBatchOptions): Promise<ServiceBusMessageBatch> {\n throwErrorIfConnectionClosed(this._context);\n let maxMessageSize = await this.getMaxMessageSize({\n retryOptions: this._retryOptions,\n abortSignal: options?.abortSignal,\n });\n if (options?.maxSizeInBytes) {\n if (options.maxSizeInBytes > maxMessageSize!) {\n const error = new Error(\n `Max message size (${options.maxSizeInBytes} bytes) is greater than maximum message size (${maxMessageSize} bytes) on the AMQP sender link.`,\n );\n throw error;\n }\n maxMessageSize = options.maxSizeInBytes;\n }\n return new ServiceBusMessageBatchImpl(this._context, maxMessageSize!);\n }\n\n async sendBatch(\n batchMessage: ServiceBusMessageBatch,\n options?: OperationOptionsBase,\n ): Promise<void> {\n throwErrorIfConnectionClosed(this._context);\n try {\n logger.verbose(\n \"%s Sender '%s', sending encoded batch message.\",\n this.logPrefix,\n this.name,\n batchMessage,\n );\n return await this._trySend(batchMessage._generateMessage(), true, options);\n } catch (err: any) {\n logger.logError(\n err,\n \"%s Sender '%s': An error occurred while sending the messages: %O\\nError\",\n this.logPrefix,\n this.name,\n batchMessage,\n );\n throw err;\n }\n }\n\n static create(\n identifier: string,\n context: ConnectionContext,\n entityPath: string,\n retryOptions: RetryOptions,\n ): MessageSender {\n throwErrorIfConnectionClosed(context);\n\n const sbSender = new MessageSender(identifier, context, entityPath, retryOptions);\n context.senders[sbSender.name] = sbSender;\n return sbSender;\n }\n\n protected removeLinkFromContext(): void {\n delete this._context.senders[this.name];\n }\n}\n"]}
@@ -181,7 +181,7 @@ export interface ServiceBusSenderOptions {
181
181
  * - `maxSizeInBytes`: The upper limit for the size of batch.
182
182
  *
183
183
  * Example usage:
184
- * ```js
184
+ * ```ts snippet:ignore
185
185
  * {
186
186
  * maxSizeInBytes: 1024 * 1024 // 1 MB
187
187
  * }
@@ -1 +1 @@
1
- {"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { OperationOptionsBase } from \"./modelsToBeSharedWithEventHubs.js\";\nimport type Long from \"long\";\nimport type { ServiceBusReceivedMessage } from \"./serviceBusMessage.js\";\nimport type { ServiceBusError } from \"./serviceBusError.js\";\n\n/**\n * Arguments to the `processError` callback.\n */\nexport interface ProcessErrorArgs {\n /**\n * The error.\n */\n error: Error | ServiceBusError;\n /**\n * The operation where the error originated.\n *\n * 'abandon': Errors that occur when if `abandon` is triggered automatically.\n * 'complete': Errors that occur when autoComplete completes a message.\n * 'processMessageCallback': Errors thrown from the user's `processMessage` callback passed to `subscribe`.\n * 'receive': Errors thrown when receiving messages.\n * 'renewLock': Errors thrown when automatic lock renewal fails.\n */\n errorSource: \"abandon\" | \"complete\" | \"processMessageCallback\" | \"receive\" | \"renewLock\";\n /**\n * The entity path for the current receiver.\n */\n entityPath: string;\n /**\n * The fully qualified namespace for the Service Bus.\n */\n fullyQualifiedNamespace: string;\n /**\n * The identifier of the client that raised this event.\n */\n identifier: string;\n}\n\n/**\n * @internal\n */\nexport interface InternalProcessErrorArgs extends Omit<ProcessErrorArgs, \"errorSource\"> {\n /**\n * The operation where the error originated.\n *\n * 'abandon': Errors that occur when if `abandon` is triggered automatically.\n * 'complete': Errors that occur when autoComplete completes a message.\n * 'processMessageCallback': Errors thrown from the user's `processMessage` callback passed to `subscribe`.\n * 'receive': Errors thrown when receiving messages.\n * 'renewLock': Errors thrown when automatic lock renewal fails.\n */\n errorSource: ProcessErrorArgs[\"errorSource\"] | \"internal\";\n}\n\n/**\n * The general message handler interface (used for streamMessages).\n */\nexport interface MessageHandlers {\n /**\n * Handler that processes messages from service bus.\n *\n * @param message - A message received from Service Bus.\n */\n processMessage(message: ServiceBusReceivedMessage): Promise<void>;\n /**\n * Handler that processes errors that occur during receiving.\n *\n * This handler will be called for any error that occurs in the receiver when\n * - receiving the message, or\n * - executing your `processMessage` callback, or\n * - receiver is completing the message on your behalf after successfully running your `processMessage` callback and `autoCompleteMessages` is enabled\n * - receiver is abandoning the message on your behalf if running your `processMessage` callback fails and `autoCompleteMessages` is enabled\n * - receiver is renewing the lock on your behalf due to auto lock renewal feature being enabled\n *\n * Note that when receiving messages in a stream using `subscribe()`, the receiver will automatically retry receiving messages on all errors unless\n * `close()` is called on the subscription. It is completely up to users to decide what errors are considered non-recoverable and to handle them\n * accordingly in this callback.\n * For a list of errors occurs within Service Bus, please refer to https://learn.microsoft.com/javascript/api/\\@azure/service-bus/servicebuserror?view=azure-node-latest\n * @param args - The error and additional context to indicate where\n * the error originated.\n */\n processError(args: ProcessErrorArgs): Promise<void>;\n}\n\n/**\n * @internal\n */\nexport interface InternalMessageHandlers extends MessageHandlers {\n /**\n * Called when the connection is initialized but before we've added credits.\n * NOTE: This handler is completely internal and only used for tests.\n */\n postInitialize?: () => Promise<void>;\n\n /**\n * Called before we actually initialize the link itself.\n * NOTE: This handler is completely internal and only used for tests.\n */\n preInitialize?: () => Promise<void>;\n\n /**\n * Forwards internal errors that are not normally reported to the customer to `processError`.\n * (defaults to false)\n */\n forwardInternalErrors?: boolean;\n}\n\n/**\n * Represents the possible receive modes for the receiver.\n * @internal\n */\nexport type ReceiveMode = \"peekLock\" | \"receiveAndDelete\";\n\n/**\n * Options to use when creating a receiver.\n */\nexport interface ServiceBusReceiverOptions {\n /**\n * Represents the receive mode for the receiver.\n *\n * In receiveAndDelete mode, messages are deleted from Service Bus as they are received.\n *\n * In peekLock mode, the receiver has a lock on the message for the duration specified on the\n * queue/subscription.\n *\n * Messages that are not settled within the lock duration will be redelivered as many times as\n * the max delivery count set on the queue/subscription, after which they get sent to a separate\n * dead letter queue.\n *\n * You can settle a message by calling complete(), abandon(), defer() or deadletter() methods on\n * the message.\n *\n * More information about how peekLock and message settlement works here:\n * https://learn.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock\n *\n */\n receiveMode?: \"peekLock\" | \"receiveAndDelete\";\n /**\n * Represents the sub queue that is applicable for any queue or subscription.\n * Valid values are \"deadLetter\" and \"transferDeadLetter\". To learn more about dead letter queues,\n * see https://learn.microsoft.com/azure/service-bus-messaging/service-bus-dead-letter-queues\n */\n subQueueType?: \"deadLetter\" | \"transferDeadLetter\";\n\n /**\n * The maximum duration, in milliseconds, that the lock on the message will be renewed automatically by the client.\n * This auto renewal stops once the message is settled.\n *\n * - **Default**: `300 * 1000` milliseconds (5 minutes).\n * - **To disable autolock renewal**, set this to `0`.\n *\n * **Example:**\n *\n * If the message lock expires in 2 minutes and your message processing time is 8 minutes...\n *\n * Set maxAutoLockRenewalDurationInMs to 10 minutes, and the message lock will be automatically renewed for 4 times\n * (equivalent to having the message locked for 4 times its lock duration by leveraging the lock renewals).\n */\n maxAutoLockRenewalDurationInMs?: number;\n /**\n * Option to disable the client from running JSON.parse() on the message body when receiving the message.\n * Not applicable if the message was sent with AMQP body type value or sequence. Use this option when you\n * prefer to work directly with the bytes present in the message body than have the client attempt to parse it.\n */\n skipParsingBodyAsJson?: boolean;\n /**\n * Whether to skip converting Date type on properties of message annotations\n * or application properties into numbers when receiving the message. By\n * default, properties of Date type is converted into UNIX epoch number for\n * compatibility.\n */\n skipConvertingDate?: boolean;\n /**\n * Sets the name to identify the receiver. This can be used to correlate logs and exceptions.\n * If not specified or empty, a random unique one will be used.\n */\n identifier?: string;\n}\n\n/**\n * Options to use when creating a sender.\n */\nexport interface ServiceBusSenderOptions {\n /**\n * Sets the name to identify the sender. This can be used to correlate logs and exceptions.\n * If not specified or empty, a random unique one will be used.\n */\n identifier?: string;\n}\n\n/**\n * Options to configure the `createBatch` method on the `Sender`.\n * - `maxSizeInBytes`: The upper limit for the size of batch.\n *\n * Example usage:\n * ```js\n * {\n * maxSizeInBytes: 1024 * 1024 // 1 MB\n * }\n * ```\n */\nexport interface CreateMessageBatchOptions extends OperationOptionsBase {\n /**\n * The upper limit for the size of batch. The `tryAdd` function will return `false` after this limit is reached.\n */\n maxSizeInBytes?: number;\n}\n\n/**\n * Options when receiving a batch of messages from Service Bus.\n */\nexport interface ReceiveMessagesOptions extends OperationOptionsBase {\n /**\n * The maximum amount of time to wait for messages to arrive.\n * **Default**: `60000` milliseconds.\n */\n maxWaitTimeInMs?: number;\n}\n\n/**\n * Options when getting an iterable iterator from Service Bus.\n */\nexport interface GetMessageIteratorOptions extends OperationOptionsBase {}\n\n/**\n * Options used when subscribing to a Service Bus queue or subscription.\n */\nexport interface SubscribeOptions extends OperationOptionsBase {\n /**\n * Indicates whether the message should be settled automatically based on the result from the\n * user provided `processMessage` callback.\n *\n * - If an error is thrown from the `processMessage` callback the message will be abandoned\n * using `receiver.abandonMessage()`. Doing so will make the message available again from the\n * queue/subscription and the delivery count will be incremented.\n * - If NO error is thrown from `processMessage` the message will be completed\n * using `receiver.completeMessage()`. Doing so removes the message from the queue/subscription.\n *\n * This option is ignored if messages are received in the `receiveAndDelete` receive mode or if\n * the message is already settled in the user provided message callback.\n *\n * - **Default**: `true`.\n */\n autoCompleteMessages?: boolean;\n /**\n * The maximum number of concurrent calls that the library\n * can make to the user's message handler. Once this limit has been reached, more messages will\n * not be received until at least one of the calls to the user's message handler has completed.\n * - **Default**: `1`.\n */\n maxConcurrentCalls?: number;\n}\n\n/**\n * Describes the options passed to the `acceptSession` and `acceptNextSession` methods\n * when using a Queue/Subscription that has sessions enabled.\n */\nexport interface ServiceBusSessionReceiverOptions extends OperationOptionsBase {\n /**\n * Represents the receive mode for the receiver.\n *\n * In receiveAndDelete mode, messages are deleted from Service Bus as they are received.\n *\n * In peekLock mode, the receiver has a lock on the message for the duration specified on the\n * queue/subscription.\n *\n * Messages that are not settled within the lock duration will be redelivered as many times as\n * the max delivery count set on the queue/subscription, after which they get sent to a separate\n * dead letter queue.\n *\n * You can settle a message by calling complete(), abandon(), defer() or deadletter() methods on\n * the message.\n *\n * More information about how peekLock and message settlement works here:\n * https://learn.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock\n *\n */\n receiveMode?: \"peekLock\" | \"receiveAndDelete\";\n /**\n * The maximum duration, in milliseconds, that the lock on the session will be renewed automatically by the client.\n *\n * - **Default**: `300000` milliseconds (5 minutes).\n * - **To disable autolock renewal**, set this to `0`.\n *\n * **Example:**\n *\n * If the lock expires in 2 minutes and your processing time is 8 minutes...\n *\n * Set maxAutoLockRenewalDurationInMs to 10 minutes, and the lock will be automatically renewed about 4 times\n * (equivalent to having the session locked for 4 times its lock duration by leveraging the lock renewals).\n */\n maxAutoLockRenewalDurationInMs?: number;\n /**\n * Option to disable the client from running JSON.parse() on the message body when receiving the message.\n * Not applicable if the message was sent with AMQP body type value or sequence. Use this option when you\n * prefer to work directly with the bytes present in the message body than have the client attempt to parse it.\n */\n skipParsingBodyAsJson?: boolean;\n /**\n * Whether to skip converting Date type on properties of message annotations\n * or application properties into numbers when receiving the message. By\n * default, properties of Date type is converted into UNIX epoch number for\n * compatibility.\n */\n skipConvertingDate?: boolean;\n /**\n * Sets the name to identify the session receiver. This can be used to correlate logs and exceptions.\n * If not specified or empty, a random unique one will be used.\n */\n identifier?: string;\n}\n\n/**\n * Describes the options passed to the `peekMessages` method on a receiver.\n */\nexport interface PeekMessagesOptions extends OperationOptionsBase {\n /**\n * The sequence number to start peeking messages from (inclusive).\n */\n fromSequenceNumber?: Long;\n}\n\n/**\n * Options to configure messages deletion.\n */\nexport interface DeleteMessagesOptions extends OperationOptionsBase {\n /**\n * If specified, only messages enqueued before this time are deleted.\n */\n beforeEnqueueTime?: Date;\n /**\n * Up to `maxMessageCount` messages will be deleted.\n */\n maxMessageCount: number;\n}\n\n/**\n * Options to configure deletion of all messages in an entity.\n */\nexport interface PurgeMessagesOptions extends OperationOptionsBase {\n /**\n * If specified, only messages enqueued before this time are deleted.\n */\n beforeEnqueueTime?: Date;\n}\n"]}
1
+ {"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { OperationOptionsBase } from \"./modelsToBeSharedWithEventHubs.js\";\nimport type Long from \"long\";\nimport type { ServiceBusReceivedMessage } from \"./serviceBusMessage.js\";\nimport type { ServiceBusError } from \"./serviceBusError.js\";\n\n/**\n * Arguments to the `processError` callback.\n */\nexport interface ProcessErrorArgs {\n /**\n * The error.\n */\n error: Error | ServiceBusError;\n /**\n * The operation where the error originated.\n *\n * 'abandon': Errors that occur when if `abandon` is triggered automatically.\n * 'complete': Errors that occur when autoComplete completes a message.\n * 'processMessageCallback': Errors thrown from the user's `processMessage` callback passed to `subscribe`.\n * 'receive': Errors thrown when receiving messages.\n * 'renewLock': Errors thrown when automatic lock renewal fails.\n */\n errorSource: \"abandon\" | \"complete\" | \"processMessageCallback\" | \"receive\" | \"renewLock\";\n /**\n * The entity path for the current receiver.\n */\n entityPath: string;\n /**\n * The fully qualified namespace for the Service Bus.\n */\n fullyQualifiedNamespace: string;\n /**\n * The identifier of the client that raised this event.\n */\n identifier: string;\n}\n\n/**\n * @internal\n */\nexport interface InternalProcessErrorArgs extends Omit<ProcessErrorArgs, \"errorSource\"> {\n /**\n * The operation where the error originated.\n *\n * 'abandon': Errors that occur when if `abandon` is triggered automatically.\n * 'complete': Errors that occur when autoComplete completes a message.\n * 'processMessageCallback': Errors thrown from the user's `processMessage` callback passed to `subscribe`.\n * 'receive': Errors thrown when receiving messages.\n * 'renewLock': Errors thrown when automatic lock renewal fails.\n */\n errorSource: ProcessErrorArgs[\"errorSource\"] | \"internal\";\n}\n\n/**\n * The general message handler interface (used for streamMessages).\n */\nexport interface MessageHandlers {\n /**\n * Handler that processes messages from service bus.\n *\n * @param message - A message received from Service Bus.\n */\n processMessage(message: ServiceBusReceivedMessage): Promise<void>;\n /**\n * Handler that processes errors that occur during receiving.\n *\n * This handler will be called for any error that occurs in the receiver when\n * - receiving the message, or\n * - executing your `processMessage` callback, or\n * - receiver is completing the message on your behalf after successfully running your `processMessage` callback and `autoCompleteMessages` is enabled\n * - receiver is abandoning the message on your behalf if running your `processMessage` callback fails and `autoCompleteMessages` is enabled\n * - receiver is renewing the lock on your behalf due to auto lock renewal feature being enabled\n *\n * Note that when receiving messages in a stream using `subscribe()`, the receiver will automatically retry receiving messages on all errors unless\n * `close()` is called on the subscription. It is completely up to users to decide what errors are considered non-recoverable and to handle them\n * accordingly in this callback.\n * For a list of errors occurs within Service Bus, please refer to https://learn.microsoft.com/javascript/api/\\@azure/service-bus/servicebuserror?view=azure-node-latest\n * @param args - The error and additional context to indicate where\n * the error originated.\n */\n processError(args: ProcessErrorArgs): Promise<void>;\n}\n\n/**\n * @internal\n */\nexport interface InternalMessageHandlers extends MessageHandlers {\n /**\n * Called when the connection is initialized but before we've added credits.\n * NOTE: This handler is completely internal and only used for tests.\n */\n postInitialize?: () => Promise<void>;\n\n /**\n * Called before we actually initialize the link itself.\n * NOTE: This handler is completely internal and only used for tests.\n */\n preInitialize?: () => Promise<void>;\n\n /**\n * Forwards internal errors that are not normally reported to the customer to `processError`.\n * (defaults to false)\n */\n forwardInternalErrors?: boolean;\n}\n\n/**\n * Represents the possible receive modes for the receiver.\n * @internal\n */\nexport type ReceiveMode = \"peekLock\" | \"receiveAndDelete\";\n\n/**\n * Options to use when creating a receiver.\n */\nexport interface ServiceBusReceiverOptions {\n /**\n * Represents the receive mode for the receiver.\n *\n * In receiveAndDelete mode, messages are deleted from Service Bus as they are received.\n *\n * In peekLock mode, the receiver has a lock on the message for the duration specified on the\n * queue/subscription.\n *\n * Messages that are not settled within the lock duration will be redelivered as many times as\n * the max delivery count set on the queue/subscription, after which they get sent to a separate\n * dead letter queue.\n *\n * You can settle a message by calling complete(), abandon(), defer() or deadletter() methods on\n * the message.\n *\n * More information about how peekLock and message settlement works here:\n * https://learn.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock\n *\n */\n receiveMode?: \"peekLock\" | \"receiveAndDelete\";\n /**\n * Represents the sub queue that is applicable for any queue or subscription.\n * Valid values are \"deadLetter\" and \"transferDeadLetter\". To learn more about dead letter queues,\n * see https://learn.microsoft.com/azure/service-bus-messaging/service-bus-dead-letter-queues\n */\n subQueueType?: \"deadLetter\" | \"transferDeadLetter\";\n\n /**\n * The maximum duration, in milliseconds, that the lock on the message will be renewed automatically by the client.\n * This auto renewal stops once the message is settled.\n *\n * - **Default**: `300 * 1000` milliseconds (5 minutes).\n * - **To disable autolock renewal**, set this to `0`.\n *\n * **Example:**\n *\n * If the message lock expires in 2 minutes and your message processing time is 8 minutes...\n *\n * Set maxAutoLockRenewalDurationInMs to 10 minutes, and the message lock will be automatically renewed for 4 times\n * (equivalent to having the message locked for 4 times its lock duration by leveraging the lock renewals).\n */\n maxAutoLockRenewalDurationInMs?: number;\n /**\n * Option to disable the client from running JSON.parse() on the message body when receiving the message.\n * Not applicable if the message was sent with AMQP body type value or sequence. Use this option when you\n * prefer to work directly with the bytes present in the message body than have the client attempt to parse it.\n */\n skipParsingBodyAsJson?: boolean;\n /**\n * Whether to skip converting Date type on properties of message annotations\n * or application properties into numbers when receiving the message. By\n * default, properties of Date type is converted into UNIX epoch number for\n * compatibility.\n */\n skipConvertingDate?: boolean;\n /**\n * Sets the name to identify the receiver. This can be used to correlate logs and exceptions.\n * If not specified or empty, a random unique one will be used.\n */\n identifier?: string;\n}\n\n/**\n * Options to use when creating a sender.\n */\nexport interface ServiceBusSenderOptions {\n /**\n * Sets the name to identify the sender. This can be used to correlate logs and exceptions.\n * If not specified or empty, a random unique one will be used.\n */\n identifier?: string;\n}\n\n/**\n * Options to configure the `createBatch` method on the `Sender`.\n * - `maxSizeInBytes`: The upper limit for the size of batch.\n *\n * Example usage:\n * ```ts snippet:ignore\n * {\n * maxSizeInBytes: 1024 * 1024 // 1 MB\n * }\n * ```\n */\nexport interface CreateMessageBatchOptions extends OperationOptionsBase {\n /**\n * The upper limit for the size of batch. The `tryAdd` function will return `false` after this limit is reached.\n */\n maxSizeInBytes?: number;\n}\n\n/**\n * Options when receiving a batch of messages from Service Bus.\n */\nexport interface ReceiveMessagesOptions extends OperationOptionsBase {\n /**\n * The maximum amount of time to wait for messages to arrive.\n * **Default**: `60000` milliseconds.\n */\n maxWaitTimeInMs?: number;\n}\n\n/**\n * Options when getting an iterable iterator from Service Bus.\n */\nexport interface GetMessageIteratorOptions extends OperationOptionsBase {}\n\n/**\n * Options used when subscribing to a Service Bus queue or subscription.\n */\nexport interface SubscribeOptions extends OperationOptionsBase {\n /**\n * Indicates whether the message should be settled automatically based on the result from the\n * user provided `processMessage` callback.\n *\n * - If an error is thrown from the `processMessage` callback the message will be abandoned\n * using `receiver.abandonMessage()`. Doing so will make the message available again from the\n * queue/subscription and the delivery count will be incremented.\n * - If NO error is thrown from `processMessage` the message will be completed\n * using `receiver.completeMessage()`. Doing so removes the message from the queue/subscription.\n *\n * This option is ignored if messages are received in the `receiveAndDelete` receive mode or if\n * the message is already settled in the user provided message callback.\n *\n * - **Default**: `true`.\n */\n autoCompleteMessages?: boolean;\n /**\n * The maximum number of concurrent calls that the library\n * can make to the user's message handler. Once this limit has been reached, more messages will\n * not be received until at least one of the calls to the user's message handler has completed.\n * - **Default**: `1`.\n */\n maxConcurrentCalls?: number;\n}\n\n/**\n * Describes the options passed to the `acceptSession` and `acceptNextSession` methods\n * when using a Queue/Subscription that has sessions enabled.\n */\nexport interface ServiceBusSessionReceiverOptions extends OperationOptionsBase {\n /**\n * Represents the receive mode for the receiver.\n *\n * In receiveAndDelete mode, messages are deleted from Service Bus as they are received.\n *\n * In peekLock mode, the receiver has a lock on the message for the duration specified on the\n * queue/subscription.\n *\n * Messages that are not settled within the lock duration will be redelivered as many times as\n * the max delivery count set on the queue/subscription, after which they get sent to a separate\n * dead letter queue.\n *\n * You can settle a message by calling complete(), abandon(), defer() or deadletter() methods on\n * the message.\n *\n * More information about how peekLock and message settlement works here:\n * https://learn.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock\n *\n */\n receiveMode?: \"peekLock\" | \"receiveAndDelete\";\n /**\n * The maximum duration, in milliseconds, that the lock on the session will be renewed automatically by the client.\n *\n * - **Default**: `300000` milliseconds (5 minutes).\n * - **To disable autolock renewal**, set this to `0`.\n *\n * **Example:**\n *\n * If the lock expires in 2 minutes and your processing time is 8 minutes...\n *\n * Set maxAutoLockRenewalDurationInMs to 10 minutes, and the lock will be automatically renewed about 4 times\n * (equivalent to having the session locked for 4 times its lock duration by leveraging the lock renewals).\n */\n maxAutoLockRenewalDurationInMs?: number;\n /**\n * Option to disable the client from running JSON.parse() on the message body when receiving the message.\n * Not applicable if the message was sent with AMQP body type value or sequence. Use this option when you\n * prefer to work directly with the bytes present in the message body than have the client attempt to parse it.\n */\n skipParsingBodyAsJson?: boolean;\n /**\n * Whether to skip converting Date type on properties of message annotations\n * or application properties into numbers when receiving the message. By\n * default, properties of Date type is converted into UNIX epoch number for\n * compatibility.\n */\n skipConvertingDate?: boolean;\n /**\n * Sets the name to identify the session receiver. This can be used to correlate logs and exceptions.\n * If not specified or empty, a random unique one will be used.\n */\n identifier?: string;\n}\n\n/**\n * Describes the options passed to the `peekMessages` method on a receiver.\n */\nexport interface PeekMessagesOptions extends OperationOptionsBase {\n /**\n * The sequence number to start peeking messages from (inclusive).\n */\n fromSequenceNumber?: Long;\n}\n\n/**\n * Options to configure messages deletion.\n */\nexport interface DeleteMessagesOptions extends OperationOptionsBase {\n /**\n * If specified, only messages enqueued before this time are deleted.\n */\n beforeEnqueueTime?: Date;\n /**\n * Up to `maxMessageCount` messages will be deleted.\n */\n maxMessageCount: number;\n}\n\n/**\n * Options to configure deletion of all messages in an entity.\n */\nexport interface PurgeMessagesOptions extends OperationOptionsBase {\n /**\n * If specified, only messages enqueued before this time are deleted.\n */\n beforeEnqueueTime?: Date;\n}\n"]}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@azure/service-bus",
3
3
  "sdk-type": "client",
4
4
  "author": "Microsoft Corporation",
5
- "version": "7.10.0-alpha.20250303.1",
5
+ "version": "7.10.0-alpha.20250305.1",
6
6
  "license": "MIT",
7
7
  "description": "Azure Service Bus SDK for JavaScript",
8
8
  "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/servicebus/service-bus/",
@@ -38,7 +38,7 @@
38
38
  "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
39
39
  "clean": "dev-tool run vendored rimraf --glob dist dist-* types *.tgz *.log coverage coverage-browser .nyc_output",
40
40
  "execute:samples": "dev-tool samples run samples-dev",
41
- "extract-api": "tsc -p . && dev-tool run extract-api",
41
+ "extract-api": "dev-tool run build-package && dev-tool run extract-api",
42
42
  "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"samples/**/*.{ts,js}\" \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
43
43
  "integration-test": "npm run integration-test:node && npm run integration-test:browser",
44
44
  "integration-test:browser": "dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --browser --no-test-proxy",
@@ -46,14 +46,14 @@
46
46
  "lint": "eslint package.json api-extractor.json README.md src test",
47
47
  "lint:fix": "eslint package.json api-extractor.json README.md src test --fix --fix-type [problem,suggestion]",
48
48
  "pack": "npm pack 2>&1",
49
- "perf-test:node": "tsc -p . --module \"commonjs\" && node dist-esm/test/perf/track-2/index.spec.js",
49
+ "perf-test:node": "dev-tool run build-package --module \"commonjs\" && node dist-esm/test/perf/track-2/index.spec.js",
50
50
  "test": "npm run test:node && npm run test:browser",
51
51
  "test:browser": "npm run clean && npm run integration-test:browser",
52
52
  "test:node": "npm run clean && npm run integration-test:node",
53
53
  "unit-test": "npm run unit-test:node && npm run unit-test:browser",
54
54
  "unit-test:browser": "echo skipped",
55
55
  "unit-test:node": "dev-tool run test:vitest --no-test-proxy -- -c vitest.unit.config.ts",
56
- "update-snippets": "echo skipped"
56
+ "update-snippets": "dev-tool run update-snippets"
57
57
  },
58
58
  "sideEffects": false,
59
59
  "//metadata": {
@@ -88,21 +88,21 @@
88
88
  "dependencies": {
89
89
  "@azure/abort-controller": "^2.1.2",
90
90
  "@azure/core-amqp": "^4.3.2",
91
- "@azure/core-auth": "^1.8.0",
91
+ "@azure/core-auth": "^1.9.0",
92
92
  "@azure/core-client": "^1.9.2",
93
93
  "@azure/core-paging": "^1.6.2",
94
- "@azure/core-rest-pipeline": "^1.17.0",
94
+ "@azure/core-rest-pipeline": "^1.19.0",
95
95
  "@azure/core-tracing": "^1.2.0",
96
- "@azure/core-util": "^1.10.0",
96
+ "@azure/core-util": "^1.11.0",
97
97
  "@azure/core-xml": "^1.4.3",
98
98
  "@azure/logger": "^1.1.4",
99
- "buffer": "^6.0.0",
100
- "is-buffer": "^2.0.3",
99
+ "buffer": "^6.0.3",
100
+ "is-buffer": "^2.0.5",
101
101
  "jssha": "^3.3.1",
102
102
  "long": "^5.3.1",
103
103
  "process": "^0.11.10",
104
- "rhea-promise": "^3.0.0",
105
- "tslib": "^2.7.0"
104
+ "rhea-promise": "^3.0.3",
105
+ "tslib": "^2.8.1"
106
106
  },
107
107
  "devDependencies": {
108
108
  "@azure-tools/test-credential": "^2.1.0",
@@ -111,15 +111,15 @@
111
111
  "@azure-tools/vite-plugin-browser-test-map": ">=1.0.0-alpha <1.0.0-alphb",
112
112
  "@azure/dev-tool": ">=1.0.0-alpha <1.0.0-alphb",
113
113
  "@azure/eslint-plugin-azure-sdk": ">=3.0.0-alpha <3.0.0-alphb",
114
- "@azure/identity": "^4.4.1",
114
+ "@azure/identity": "^4.7.0",
115
115
  "@rollup/plugin-inject": "^5.0.5",
116
116
  "@types/chai-as-promised": "^8.0.1",
117
117
  "@types/debug": "^4.1.4",
118
118
  "@types/is-buffer": "^2.0.0",
119
119
  "@types/node": "^18.0.0",
120
120
  "@types/ws": "^7.2.4",
121
- "@vitest/browser": "^3.0.3",
122
- "@vitest/coverage-istanbul": "^3.0.3",
121
+ "@vitest/browser": "^3.0.6",
122
+ "@vitest/coverage-istanbul": "^3.0.6",
123
123
  "chai": "^5.1.1",
124
124
  "chai-as-promised": "^8.0.0",
125
125
  "chai-exclude": "^3.0.0",
@@ -128,9 +128,9 @@
128
128
  "eslint": "^9.9.0",
129
129
  "events": "^3.0.0",
130
130
  "https-proxy-agent": "^7.0.0",
131
- "playwright": "^1.46.1",
131
+ "playwright": "^1.50.1",
132
132
  "typescript": "~5.7.2",
133
- "vitest": "^3.0.3",
133
+ "vitest": "^3.0.6",
134
134
  "ws": "^8.0.0"
135
135
  },
136
136
  "type": "module",
@@ -189,5 +189,6 @@
189
189
  "default": "./dist/commonjs/experimental/index.js"
190
190
  }
191
191
  }
192
- }
192
+ },
193
+ "react-native": "./dist/react-native/index.js"
193
194
  }