@azure/functions-extensions-servicebus
Version:
Node.js Azure ServiceBus extension implementations for Azure Functions
1 lines • 79.6 kB
Source Map (JSON)
{"version":3,"file":"azure-functions-extensions-servicebus.min.mjs","mappings":"qFAAAA,EAAOC,QAAUC,EAAyC,O,GCCtDC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaL,QAGrB,IAAID,EAASG,EAAyBE,GAAY,CAGjDJ,QAAS,CAAC,GAOX,OAHAO,EAAoBH,GAAUL,EAAQA,EAAOC,QAASG,GAG/CJ,EAAOC,OACf,CCrBAG,EAAoBK,EAAKT,IACxB,IAAIU,EAASV,GAAUA,EAAOW,WAC7B,IAAOX,EAAiB,QACxB,IAAM,EAEP,OADAI,EAAoBQ,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLRN,EAAoBQ,EAAI,CAACX,EAASa,KACjC,IAAI,IAAIC,KAAOD,EACXV,EAAoBY,EAAEF,EAAYC,KAASX,EAAoBY,EAAEf,EAASc,IAC5EE,OAAOC,eAAejB,EAASc,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3EX,EAAoBY,EAAI,CAACK,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCAlF,MAAM,EAA+BpB,EAAyC,oCCAxE,EAA+BA,EAAyC,oBCAxE,EAA+BA,EAAyC,Q,+BCOvE,MAAMwB,EAST,sBAAOC,CAAgBC,GACnB,MAAO,CACHA,EAAUC,SAAS,EAAG,GAAGC,UAAUC,SAAS,OAC5CH,EAAUC,SAAS,EAAG,GAAGC,UAAUC,SAAS,OAC5CH,EAAUC,SAAS,EAAG,GAAGC,UAAUC,SAAS,OAC5CH,EAAUC,SAAS,EAAG,IAAIE,SAAS,OACnCH,EAAUC,SAAS,IAAIE,SAAS,QAClCC,KAAK,IACX,CAQA,yBAAOC,CAAmBC,EAAyBC,GAC/C,MAAM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K,EAAc,EAAA4B,qBAAqBC,gBAAgBF,GACzD,OAAOpC,EAA8BQ,wCAAwCC,EAAa5K,EAC9F,CAcA,qBAAO8K,CAAe4B,GAClB,GACuB,iBAAZA,GACK,OAAZA,GACA,aAAcA,GACd,YAAaA,GAC4C,iBAAjDA,EAAoCC,UAC5ClM,OAAOC,SAAUgM,EAAoCxL,SACvD,CACE,MAAM,SAAEyL,EAAQ,QAAEzL,GAAYwL,EAG9B,OACWxL,C,CAMf,OAAOwL,CACX,CASQ,gCAAOZ,CAA0Bc,GACrC,GAAIA,QAKJ,OAAIA,aAA2BhI,KACpBgI,EAIoB,iBAApBA,GAA2D,iBAApBA,EACvC,IAAIhI,KAAKgI,QADpB,CAMJ,ECjNJ,MAAMC,EAAoB,iCCuBpBC,EAAc,IAAIC,YAAY,QAAS,CAAEC,OAAO,IAU/C,SAASC,EAAkB3M,GAC9B,MAAMuK,EAAgBvK,EAAQuK,KAC9B,OAAIpK,OAAOC,SAASmK,GACTiC,EAAY7L,OAAO4J,GAEV,iBAATA,EACAA,EAEJqC,KAAKC,UAAUtC,EAC1B,CAWO,SAASuC,EACZ9M,EACA+M,GAEA,OAAOH,KAAKrI,MAAMoI,EAAkB3M,GAAU+M,EAClD,EDzDO,WACH,IACI,MAAMC,EAA0B,EAAAC,wBAAwBjF,cAEnDgF,EAAwBE,mBAAmBX,IAC5CS,EAAwBG,wBACpBZ,EACCxC,GACUF,EAA8BC,2CAA2CC,G,CAI9F,MAAOpG,GACL,MAAM,IAAI7C,MACN,sDACI6C,aAAiB7C,MAAQ6C,EAAM3D,QAAU2B,OAAOgC,K,CAIhE,CErBAyJ,U","sources":["webpack://@azure/functions-extensions-servicebus/external node-commonjs \"rhea\"","webpack://@azure/functions-extensions-servicebus/webpack/bootstrap","webpack://@azure/functions-extensions-servicebus/webpack/runtime/compat get default export","webpack://@azure/functions-extensions-servicebus/webpack/runtime/define property getters","webpack://@azure/functions-extensions-servicebus/webpack/runtime/hasOwnProperty shorthand","webpack://@azure/functions-extensions-servicebus/external node-commonjs \"@azure/functions-extensions-base\"","webpack://@azure/functions-extensions-servicebus/external node-commonjs \"@azure/core-amqp\"","webpack://@azure/functions-extensions-servicebus/external node-commonjs \"long\"","webpack://@azure/functions-extensions-servicebus/./src/util/lockTokenUtil.ts","webpack://@azure/functions-extensions-servicebus/./src/util/serviceBusMessageDecoder.ts","webpack://@azure/functions-extensions-servicebus/external node-commonjs \"@grpc/grpc-js\"","webpack://@azure/functions-extensions-servicebus/external node-commonjs \"@grpc/proto-loader\"","webpack://@azure/functions-extensions-servicebus/external node-commonjs \"fs\"","webpack://@azure/functions-extensions-servicebus/external node-commonjs \"os\"","webpack://@azure/functions-extensions-servicebus/external node-commonjs \"path\"","webpack://@azure/functions-extensions-servicebus/./src/grpcClientFactory.ts","webpack://@azure/functions-extensions-servicebus/./src/util/amqpPropertyEncoder.ts","webpack://@azure/functions-extensions-servicebus/external node-commonjs \"node:util\"","webpack://@azure/functions-extensions-servicebus/./src/util/grpcUriBuilder.ts","webpack://@azure/functions-extensions-servicebus/./src/servicebus/ServiceBusMessageActions.ts","webpack://@azure/functions-extensions-servicebus/./src/constants/settlementProtoConstant.ts","webpack://@azure/functions-extensions-servicebus/./src/servicebus/azureServiceBusMessageFactory.ts","webpack://@azure/functions-extensions-servicebus/./src/servicebus/registerServiceBusMessageFactory.ts","webpack://@azure/functions-extensions-servicebus/./src/util/messageBodyParser.ts","webpack://@azure/functions-extensions-servicebus/./src/index.ts"],"sourcesContent":["module.exports = __WEBPACK_EXTERNAL_createRequire_require(\"rhea\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire_require(\"@azure/functions-extensions-base\");","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire_require(\"@azure/core-amqp\");","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire_require(\"long\");","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\n/**\r\n * Utility class for handling lock tokens in Azure Service Bus messages.\r\n * Provides methods to convert lock tokens to string format and extract them from messages.\r\n */\r\nexport class LockTokenUtil {\r\n static readonly X_OPT_LOCK_TOKEN = Buffer.from('x-opt-lock-token');\r\n\r\n /**\r\n * Converts a lock token from a Buffer to a string format.\r\n * The lock token is expected to be in a specific byte order.\r\n * @param lockToken - The lock token as a Buffer.\r\n * @returns The lock token as a formatted string.\r\n */\r\n static convertToString(lockToken: Buffer): string {\r\n return [\r\n lockToken.subarray(0, 4).reverse().toString('hex'),\r\n lockToken.subarray(4, 6).reverse().toString('hex'),\r\n lockToken.subarray(6, 8).reverse().toString('hex'),\r\n lockToken.subarray(8, 10).toString('hex'),\r\n lockToken.subarray(10).toString('hex'),\r\n ].join('-');\r\n }\r\n\r\n /**\r\n * Extracts the lock token from a Service Bus message.\r\n * @param message - The Service Bus message as a Buffer.\r\n * @param index - The index at which the lock token is located.\r\n * @returns The extracted lock token as a string.\r\n */\r\n static extractFromMessage(message: Buffer | any[], index: number): string {\r\n const raw = Buffer.isBuffer(message) ? message.subarray(0, index) : new Uint8Array(message.slice(0, index));\r\n\r\n return this.convertToString(Buffer.from(raw.subarray(0, 16)));\r\n }\r\n}\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nimport rhea from 'rhea';\r\nimport { LockTokenUtil } from './lockTokenUtil';\r\n\r\nexport class ServiceBusMessageDecoder {\r\n /**\r\n * Decodes a Service Bus message from a buffer.\r\n * @param content Buffer that contains the Service Bus message with lock token\r\n * @returns An object containing the decoded message and the lock token\r\n */\r\n static decode(content: Buffer): { decodedMessage: rhea.Message; lockToken: string } {\r\n if (!content || content.length === 0) throw new Error('Content buffer is empty');\r\n\r\n const index = content.indexOf(LockTokenUtil.X_OPT_LOCK_TOKEN);\r\n if (index === -1) throw new Error('Lock token not found in content');\r\n\r\n const lockToken = LockTokenUtil.extractFromMessage(content, index);\r\n const amqpSlice = content.subarray(16);\r\n\r\n // Suppress rhea warnings about message structure by temporarily overriding console.warn\r\n // This prevents warnings like \"WARNING: expected described message section got {...}\"\r\n const originalWarn = console.warn;\r\n try {\r\n console.warn = () => {};\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any\r\n const decodedMessage = rhea.message.decode(amqpSlice);\r\n return { decodedMessage: decodedMessage as unknown as rhea.Message & { body: unknown }, lockToken };\r\n } finally {\r\n console.warn = originalWarn;\r\n }\r\n }\r\n}\r\n","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire_require(\"@grpc/grpc-js\");","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire_require(\"@grpc/proto-loader\");","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire_require(\"fs\");","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire_require(\"os\");","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire_require(\"path\");","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nimport * as grpc from '@grpc/grpc-js';\r\nimport * as protoLoader from '@grpc/proto-loader';\r\nimport * as fs from 'fs';\r\nimport * as os from 'os';\r\nimport * as path from 'path';\r\nimport { SETTLEMENT_PROTO_CONTENT } from './constants/settlementProtoConstant';\r\n\r\n// Cache for the loaded package definition to avoid repeated parsing\r\nlet cachedPackageDefinition: grpc.GrpcObject | null = null;\r\n\r\n/**\r\n * Creates and returns a gRPC client for the Settlement service using embedded proto definition.\r\n * This approach completely eliminates the need for external .proto files by creating a temporary\r\n * proto file from the embedded content, loading it, and then cleaning up.\r\n *\r\n * @template T - The type of gRPC client to create, extends grpc.Client\r\n *\r\n * @param options - The configuration options for creating the gRPC client\r\n * @param options.serviceName - Name of the service in the proto definition\r\n * @param options.address - The server address to connect to (e.g., \"localhost:50051\")\r\n * @param options.credentials - gRPC channel credentials to use for secure communication (defaults to insecure)\r\n * @param options.grpcMaxMessageLength - Maximum message length in bytes for both sending and receiving gRPC messages\r\n *\r\n * @returns A new instance of the specified gRPC client\r\n */\r\nexport function createGrpcClient<T extends grpc.Client = grpc.Client>({\r\n serviceName,\r\n address,\r\n credentials = grpc.credentials.createInsecure(),\r\n grpcMaxMessageLength,\r\n}: {\r\n serviceName: string;\r\n address: string;\r\n credentials?: grpc.ChannelCredentials;\r\n grpcMaxMessageLength: number;\r\n}): T {\r\n // Load the embedded proto definition if not already cached\r\n if (!cachedPackageDefinition) {\r\n // Create a temporary proto file from the embedded content\r\n const tempDir = os.tmpdir();\r\n const tempProtoFile = path.join(tempDir, `settlement.proto`);\r\n\r\n try {\r\n // Write the proto content to a temporary file\r\n fs.writeFileSync(tempProtoFile, SETTLEMENT_PROTO_CONTENT);\r\n\r\n // Load the proto definition from the temporary file\r\n const packageDefinition = protoLoader.loadSync(tempProtoFile, {\r\n keepCase: false,\r\n longs: String,\r\n enums: String,\r\n defaults: true,\r\n oneofs: true,\r\n includeDirs: [tempDir],\r\n });\r\n\r\n cachedPackageDefinition = grpc.loadPackageDefinition(packageDefinition);\r\n } finally {\r\n // Clean up the temporary file\r\n try {\r\n fs.unlinkSync(tempProtoFile);\r\n } catch {\r\n // Ignore cleanup errors\r\n }\r\n }\r\n }\r\n\r\n // Retrieve the service client constructor from the loaded gRPC object\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\r\n const ServiceClientConstructor = (cachedPackageDefinition as any)[serviceName] as grpc.ServiceClientConstructor;\r\n\r\n // Throw an error if the service is not found\r\n if (!ServiceClientConstructor) {\r\n throw new Error(`Service \"${serviceName}\" not found in embedded proto definition`);\r\n }\r\n\r\n const clientOptions: grpc.ChannelOptions = {\r\n 'grpc.max_send_message_length': grpcMaxMessageLength,\r\n 'grpc.max_receive_message_length': grpcMaxMessageLength,\r\n };\r\n\r\n // Create and return a new instance of the service client\r\n return new ServiceClientConstructor(address, credentials, clientOptions) as unknown as T;\r\n}\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\n/**\r\n * AMQP Property Encoder Utility\r\n *\r\n * Converts TypeScript/JavaScript property values to AMQP-encoded byte arrays.\r\n * Date objects are automatically converted to UTC ISO format for cross-platform compatibility.\r\n */\r\n\r\n/**\r\n * Supported AMQP property types\r\n */\r\nenum AmqpType {\r\n Null = 'null',\r\n Byte = 'byte',\r\n SByte = 'sbyte',\r\n Char = 'char',\r\n Int16 = 'int16',\r\n UInt16 = 'uint16',\r\n Int32 = 'int32',\r\n UInt32 = 'uint32',\r\n Int64 = 'int64',\r\n UInt64 = 'uint64',\r\n Single = 'single',\r\n Double = 'double',\r\n Decimal = 'decimal',\r\n Boolean = 'boolean',\r\n Guid = 'guid',\r\n String = 'string',\r\n Uri = 'uri',\r\n DateTime = 'datetime',\r\n DateTimeOffset = 'datetimeoffset',\r\n TimeSpan = 'timespan',\r\n Stream = 'stream',\r\n Array = 'array',\r\n Unknown = 'unknown',\r\n}\r\n\r\n/**\r\n * Type mapping from JavaScript primitive types to AMQP types\r\n */\r\nconst PRIMITIVE_TYPE_MAP = new Map<string, AmqpType>([\r\n ['number', AmqpType.Double],\r\n ['boolean', AmqpType.Boolean],\r\n ['string', AmqpType.String],\r\n ['bigint', AmqpType.Int64],\r\n]);\r\n\r\n/**\r\n * Type conversion utilities for specific AMQP types\r\n *\r\n * Contains validation functions to determine if JavaScript values fit within\r\n * specific AMQP type ranges and formats.\r\n */\r\nconst TypeConverters = {\r\n /** Checks if number fits in unsigned 8-bit range (0-255) */\r\n isByte: (value: number): boolean => Number.isInteger(value) && value >= 0 && value <= 255,\r\n /** Checks if number fits in signed 8-bit range (-128 to 127) */\r\n isSByte: (value: number): boolean => Number.isInteger(value) && value >= -128 && value <= 127,\r\n /** Checks if number fits in signed 16-bit range (-32,768 to 32,767) */\r\n isInt16: (value: number): boolean => Number.isInteger(value) && value >= -32768 && value <= 32767,\r\n /** Checks if number fits in unsigned 16-bit range (0 to 65,535) */\r\n isUInt16: (value: number): boolean => Number.isInteger(value) && value >= 0 && value <= 65535,\r\n /** Checks if number fits in signed 32-bit range (-2,147,483,648 to 2,147,483,647) */\r\n isInt32: (value: number): boolean => Number.isInteger(value) && value >= -2147483648 && value <= 2147483647,\r\n /** Checks if number fits in unsigned 32-bit range (0 to 4,294,967,295) */\r\n isUInt32: (value: number): boolean => Number.isInteger(value) && value >= 0 && value <= 4294967295,\r\n /** Checks if floating-point number fits in 32-bit single precision range */\r\n isSingle: (value: number): boolean => !Number.isInteger(value) && Math.abs(value) <= 3.4028235e38,\r\n\r\n /** Checks if string is a single character */\r\n isChar: (value: string): boolean => value.length === 1,\r\n /** Checks if string matches GUID/UUID format (8-4-4-4-12 hex digits) */\r\n isGuid: (value: string): boolean =>\r\n /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value),\r\n /** Checks if string is a valid URI by attempting URL construction */\r\n isUri: (value: string): boolean => {\r\n try {\r\n new URL(value);\r\n return true;\r\n } catch {\r\n return false;\r\n }\r\n },\r\n /** Checks if string can be parsed as a date */\r\n isDateTime: (value: string): boolean => !isNaN(Date.parse(value)),\r\n /** Checks if string matches TimeSpan format ([-][d.]hh:mm:ss[.fffffff]) */\r\n isTimeSpan: (value: string): boolean => /^-?(\\d+\\.)?(\\d{2}:)?(\\d{2}:)?\\d{2}(\\.\\d{1,7})?$/.test(value),\r\n};\r\n\r\n/**\r\n * Checks if an object represents a decimal-like value structure\r\n * @param obj - The object to check\r\n * @returns True if the object has properties indicating it's a decimal type\r\n */\r\nfunction isDecimalLike(obj: unknown): boolean {\r\n return (\r\n obj !== null &&\r\n typeof obj === 'object' &&\r\n 'toString' in obj &&\r\n ('precision' in obj || 'scale' in obj || 'value' in obj)\r\n );\r\n}\r\n\r\n/**\r\n * Wraps a value with the appropriate AMQP type using the rhea library\r\n * @param type - The AMQP type string identifier\r\n * @param value - The value to wrap\r\n * @returns The wrapped value ready for AMQP encoding\r\n */\r\nfunction wrapAmqpValue(type: string, value: unknown): unknown {\r\n // eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-unsafe-assignment\r\n const rhea = require('rhea');\r\n\r\n switch (type) {\r\n case 'null':\r\n return null;\r\n case 'boolean':\r\n return value;\r\n case 'byte':\r\n case 'sbyte':\r\n case 'int16':\r\n case 'uint16':\r\n case 'int32':\r\n case 'uint32':\r\n case 'single':\r\n case 'double':\r\n return value;\r\n case 'int64':\r\n case 'uint64':\r\n // Convert BigInt to number for rhea compatibility\r\n if (typeof value === 'bigint') {\r\n // For BigInt values that are within safe integer range, convert to number\r\n if (value >= BigInt(Number.MIN_SAFE_INTEGER) && value <= BigInt(Number.MAX_SAFE_INTEGER)) {\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call\r\n return rhea.types.wrap_long(Number(value));\r\n } else {\r\n // For very large values, handle as number but this may lose precision\r\n // This is a limitation of the JavaScript-AMQP bridge\r\n console.warn(`BigInt value ${value} is outside safe integer range, precision may be lost`);\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call\r\n return rhea.types.wrap_long(Number(value));\r\n }\r\n }\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call\r\n return rhea.types.wrap_long(value);\r\n case 'decimal':\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call\r\n return rhea.types.wrap_decimal128(value);\r\n case 'char':\r\n case 'string':\r\n case 'guid':\r\n case 'uri':\r\n case 'datetime':\r\n case 'datetimeoffset':\r\n case 'timespan':\r\n return value;\r\n case 'stream':\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call\r\n return rhea.types.wrap_binary(value);\r\n default:\r\n return value;\r\n }\r\n}\r\n\r\nconst SUPPORTED_TYPES_MESSAGE =\r\n 'Supported types: ' +\r\n 'Primitives: null, boolean, string (including char, guid, uri, datetime, timespan), ' +\r\n 'Numbers: byte, sbyte, int16, uint16, int32, uint32, int64, uint64, single, double, decimal, ' +\r\n 'Objects: Date (datetimeoffset), URL (uri), Buffer/Uint8Array (stream), arrays of supported types';\r\n\r\n/**\r\n * Converts a Record<string, any> to AMQP-encoded byte array\r\n *\r\n * @param propertiesToModify - The properties to encode\r\n * @returns Uint8Array containing AMQP-encoded properties\r\n */\r\nexport function convertPropertiesToAmqpBytes(propertiesToModify: Record<string, any>): Uint8Array {\r\n const amqpMap = new Map<string, unknown>();\r\n\r\n for (const [key, value] of Object.entries(propertiesToModify)) {\r\n const amqpValue = tryCreateAmqpPropertyValue(value);\r\n if (amqpValue !== null) {\r\n amqpMap.set(key, amqpValue);\r\n } else {\r\n const error = new Error(\r\n `The key '${key}' has a value of type '${typeof value}' which is not supported for AMQP transport. ${SUPPORTED_TYPES_MESSAGE}`\r\n );\r\n throw error;\r\n }\r\n }\r\n\r\n const encodedBytes = encodeAmqpMap(amqpMap);\r\n return encodedBytes;\r\n}\r\n\r\n/**\r\n * Encodes properties for Service Bus message operations with proper error handling\r\n *\r\n * This function provides a safe wrapper around AMQP property encoding specifically\r\n * designed for Service Bus message operations (abandon, deadletter, defer).\r\n * It handles null/undefined properties and provides operation-specific error messages.\r\n *\r\n * @param propertiesToModify - Optional properties to modify on the message\r\n * @param operationName - The name of the operation (for error messages)\r\n * @returns Encoded properties as Uint8Array, or empty array if no properties provided\r\n * @throws Error with operation-specific context if encoding fails\r\n *\r\n * @example\r\n * ```typescript\r\n * // For abandon operation\r\n * const encoded = encodePropertiesForOperation(\r\n * { messageId: 'test-123', priority: 1 },\r\n * 'abandon'\r\n * );\r\n *\r\n * // For operations without properties\r\n * const empty = encodePropertiesForOperation(undefined, 'defer');\r\n * // Returns: new Uint8Array()\r\n * ```\r\n */\r\nexport function encodePropertiesForOperation(\r\n propertiesToModify: Record<string, any> | undefined,\r\n operationName: string\r\n): Uint8Array {\r\n // Return empty array if no properties provided\r\n if (!propertiesToModify || Object.keys(propertiesToModify).length === 0) {\r\n return new Uint8Array();\r\n }\r\n\r\n try {\r\n return new Uint8Array(convertPropertiesToAmqpBytes(propertiesToModify));\r\n } catch (error) {\r\n throw new Error(\r\n `Failed to encode properties for ${operationName} operation: ${\r\n error instanceof Error ? error.message : String(error)\r\n }`\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Attempts to create an AMQP property value from a JavaScript value with intelligent type detection\r\n *\r\n * Performs automatic type detection and conversion:\r\n * - Numbers: Detects optimal integer types (byte, int16, int32, int64) or floating point (single, double)\r\n * - Strings: Detects char, GUID, URI, DateTime, TimeSpan patterns\r\n * - Objects: Handles Date, URL, Buffer/Uint8Array, decimal-like objects, arrays\r\n * - Primitives: Boolean, BigInt, null/undefined\r\n *\r\n * @param propertyValue - The JavaScript value to convert to AMQP format\r\n * @returns Typed AMQP value object with { type, value } structure, or null if conversion fails\r\n */\r\nfunction tryCreateAmqpPropertyValue(propertyValue: unknown): unknown {\r\n if (propertyValue === null || propertyValue === undefined) {\r\n return { type: 'null', value: null };\r\n }\r\n\r\n const valueType = typeof propertyValue;\r\n\r\n switch (valueType) {\r\n case 'string': {\r\n const strValue = propertyValue as string;\r\n\r\n if (strValue === '') return { type: 'string', value: strValue };\r\n if (TypeConverters.isChar(strValue)) return { type: 'char', value: strValue };\r\n if (TypeConverters.isGuid(strValue)) return { type: 'guid', value: strValue };\r\n if (TypeConverters.isUri(strValue)) return { type: 'uri', value: strValue };\r\n if (TypeConverters.isTimeSpan(strValue)) return { type: 'timespan', value: strValue };\r\n if (TypeConverters.isDateTime(strValue)) return { type: 'datetime', value: strValue };\r\n\r\n return { type: 'string', value: strValue };\r\n }\r\n\r\n case 'number': {\r\n const numValue = propertyValue as number;\r\n\r\n if (!Number.isFinite(numValue)) {\r\n return numValue;\r\n }\r\n if (Number.isInteger(numValue)) {\r\n if (TypeConverters.isByte(numValue)) return { type: 'byte', value: numValue };\r\n if (TypeConverters.isSByte(numValue)) return { type: 'sbyte', value: numValue };\r\n if (TypeConverters.isInt16(numValue)) return { type: 'int16', value: numValue };\r\n if (TypeConverters.isUInt16(numValue)) return { type: 'uint16', value: numValue };\r\n if (TypeConverters.isInt32(numValue)) return { type: 'int32', value: numValue };\r\n if (TypeConverters.isUInt32(numValue)) return { type: 'uint32', value: numValue };\r\n return { type: 'int64', value: BigInt(numValue) };\r\n }\r\n if (TypeConverters.isSingle(numValue)) {\r\n return { type: 'single', value: numValue };\r\n }\r\n\r\n return { type: 'double', value: numValue };\r\n }\r\n\r\n case 'boolean':\r\n return { type: 'boolean', value: propertyValue as boolean };\r\n\r\n case 'bigint': {\r\n const bigintValue = propertyValue as bigint;\r\n if (bigintValue >= BigInt(0) && bigintValue <= BigInt('18446744073709551615')) {\r\n return { type: 'uint64', value: bigintValue };\r\n }\r\n return { type: 'int64', value: bigintValue };\r\n }\r\n\r\n case 'object': {\r\n if (propertyValue instanceof Date) {\r\n return { type: 'datetimeoffset', value: propertyValue.toISOString() };\r\n }\r\n\r\n if (propertyValue instanceof Buffer || propertyValue instanceof Uint8Array) {\r\n return { type: 'stream', value: propertyValue };\r\n }\r\n\r\n if (propertyValue instanceof URL) {\r\n return { type: 'uri', value: propertyValue.href };\r\n }\r\n\r\n if (isDecimalLike(propertyValue)) {\r\n return { type: 'decimal', value: propertyValue };\r\n }\r\n\r\n if (Array.isArray(propertyValue)) {\r\n return propertyValue.map((item: unknown) => tryCreateAmqpPropertyValue(item));\r\n }\r\n\r\n return null;\r\n }\r\n\r\n default:\r\n return null;\r\n }\r\n}\r\n\r\n/**\r\n * Encodes an AMQP map to byte array using proper AMQP encoding\r\n *\r\n * Uses the rhea library to create AMQP-encoded bytes compatible with .NET AMQP decoders.\r\n * Handles typed values by applying appropriate AMQP type wrappers before encoding.\r\n *\r\n * @param amqpMap - Map of string keys to AMQP-compatible values\r\n * @returns Uint8Array containing the AMQP-encoded map\r\n * @throws Error if encoding fails\r\n */\r\nfunction encodeAmqpMap(amqpMap: Map<string, unknown>): Uint8Array {\r\n try {\r\n // eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-unsafe-assignment\r\n const rhea = require('rhea');\r\n const objectMap: Record<string, unknown> = {};\r\n for (const [key, value] of amqpMap.entries()) {\r\n if (value && typeof value === 'object' && 'type' in value && 'value' in value) {\r\n const typedValue = value as { type: string; value: unknown };\r\n objectMap[key] = wrapAmqpValue(typedValue.type, typedValue.value);\r\n } else {\r\n objectMap[key] = value;\r\n }\r\n }\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call\r\n const wrappedMap = rhea.types.wrap_map(objectMap);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call\r\n const writer = new rhea.types.Writer();\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call\r\n writer.write(wrappedMap);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call\r\n const buffer = writer.toBuffer();\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\r\n const result = new Uint8Array(buffer);\r\n\r\n return result;\r\n } catch (error) {\r\n throw new Error(`Failed to encode AMQP map: ${error instanceof Error ? error.message : String(error)}`);\r\n }\r\n}\r\n\r\n/**\r\n * Gets the AMQP type identifier for a given value\r\n *\r\n * Analyzes the value to determine its corresponding AMQP type. Handles both\r\n * typed values (from tryCreateAmqpPropertyValue) and raw JavaScript values.\r\n *\r\n * @param value - The value to analyze\r\n * @returns The corresponding AmqpType enum value\r\n */\r\nfunction getAmqpTypeIdentifier(value: unknown): AmqpType {\r\n if (value === null || value === undefined) {\r\n return AmqpType.Null;\r\n }\r\n\r\n if (value && typeof value === 'object' && 'type' in value && 'value' in value) {\r\n const typedValue = value as { type: string; value: unknown };\r\n const amqpType = Object.values(AmqpType).find((type) => type === typedValue.type);\r\n return amqpType || AmqpType.Unknown;\r\n }\r\n\r\n const jsType = typeof value;\r\n const primitiveType = PRIMITIVE_TYPE_MAP.get(jsType);\r\n\r\n if (primitiveType) {\r\n return primitiveType;\r\n }\r\n\r\n if (jsType === 'object') {\r\n if (value instanceof Date) {\r\n return AmqpType.DateTimeOffset;\r\n } else if (value instanceof URL) {\r\n return AmqpType.Uri;\r\n } else if (value instanceof Buffer || value instanceof Uint8Array) {\r\n return AmqpType.Stream;\r\n } else if (Array.isArray(value)) {\r\n // Arrays are supported, determine their type by content\r\n return AmqpType.Array;\r\n }\r\n }\r\n\r\n return AmqpType.Unknown;\r\n}\r\n\r\n/**\r\n * Validates that all properties in the record are supported AMQP types\r\n *\r\n * @param properties - The properties to validate\r\n * @throws Error if any property has an unsupported type\r\n */\r\nexport function validateAmqpProperties(properties: Record<string, any>): void {\r\n for (const [key, value] of Object.entries(properties)) {\r\n const amqpType = getAmqpTypeIdentifier(value);\r\n\r\n if (amqpType === AmqpType.Unknown) {\r\n const error = new Error(\r\n `Property '${key}' has unsupported type '${typeof value}' for AMQP transport. ${SUPPORTED_TYPES_MESSAGE}`\r\n );\r\n throw error;\r\n }\r\n }\r\n}\r\n","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire_require(\"node:util\");","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nimport { parseArgs } from 'node:util';\r\n/**\r\n * GrpcUriBuilder is a utility class to build a gRPC URI from command line arguments.\r\n * It expects two arguments: 'host' and 'port'.\r\n */\r\nexport class GrpcUriBuilder {\r\n /**\r\n * Builds a gRPC URI from command line arguments.\r\n * The expected arguments are 'host' and 'port'.\r\n * @returns A string representing the gRPC URI in the format \"host:port\".\r\n * @throws Error if 'host' or 'port' arguments are missing.\r\n */\r\n static build(): { uri: string; grpcMaxMessageLength: number } {\r\n const { values: parsedArgs } = parseArgs({\r\n args: process.argv.slice(2),\r\n options: {\r\n host: { type: 'string' },\r\n port: { type: 'string' },\r\n 'functions-grpc-max-message-length': { type: 'string' },\r\n },\r\n strict: false,\r\n });\r\n\r\n const { host, port, 'functions-grpc-max-message-length': grpcMaxMessageLength } = parsedArgs;\r\n\r\n const missing: string[] = [];\r\n if (!host) missing.push(\"'host'\");\r\n if (!port) missing.push(\"'port'\");\r\n if (!grpcMaxMessageLength) missing.push(\"'functions-grpc-max-message-length'\");\r\n if (missing.length) {\r\n throw new Error(`Missing required arguments: ${missing.join(', ')}`);\r\n }\r\n\r\n return { uri: `${String(host)}:${String(port)}`, grpcMaxMessageLength: Number(grpcMaxMessageLength) };\r\n }\r\n}\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nimport { ServiceBusReceivedMessage } from '@azure/service-bus';\r\nimport * as grpc from '@grpc/grpc-js';\r\nimport {\r\n AbandonRequest,\r\n CompleteRequest,\r\n DeadletterRequest,\r\n DeferRequest,\r\n IServiceBusMessageActions,\r\n ReleaseSessionRequest,\r\n RenewMessageLockRequest,\r\n RenewSessionLockRequest,\r\n RenewSessionLockResponse,\r\n SetSessionStateRequest,\r\n SettlementServiceClient,\r\n} from '../../types/settlement-types';\r\nimport { createGrpcClient } from '../grpcClientFactory';\r\nimport { encodePropertiesForOperation } from '../util/amqpPropertyEncoder';\r\nimport { GrpcUriBuilder } from '../util/grpcUriBuilder';\r\n\r\n// Using the original proto-loader approach with better path resolution\r\n\r\n// Client implementation with Promise-based methods\r\nexport class ServiceBusMessageActions implements IServiceBusMessageActions {\r\n private static instance: ServiceBusMessageActions | null = null;\r\n private client: SettlementServiceClient;\r\n\r\n private constructor() {\r\n const { uri, grpcMaxMessageLength } = GrpcUriBuilder.build();\r\n this.client = createGrpcClient<SettlementServiceClient>({\r\n serviceName: 'Settlement',\r\n address: uri,\r\n credentials: grpc.credentials.createInsecure(),\r\n grpcMaxMessageLength,\r\n });\r\n }\r\n\r\n static getInstance(): ServiceBusMessageActions {\r\n if (!ServiceBusMessageActions.instance) {\r\n ServiceBusMessageActions.instance = new ServiceBusMessageActions();\r\n }\r\n return ServiceBusMessageActions.instance;\r\n }\r\n\r\n // Add this private helper method to the ServiceBusMessageActions class\r\n private validateLockToken(message: ServiceBusReceivedMessage): string {\r\n const locktoken = message.lockToken;\r\n if (!locktoken) {\r\n throw new Error('ArgumentException: lockToken is required in ServiceBusReceivedMessage.');\r\n }\r\n return locktoken;\r\n }\r\n\r\n /**\r\n * Completes (settles) the specified message, removing it from the queue or subscription.\r\n *\r\n * @param message - The received Service Bus message to complete.\r\n * @returns A promise that resolves when the operation is successful.\r\n * @throws Error if the lockToken is missing or the gRPC call fails.\r\n */\r\n async complete(message: ServiceBusReceivedMessage): Promise<void> {\r\n const locktoken = this.validateLockToken(message);\r\n return new Promise((resolve, reject) => {\r\n const request: CompleteRequest = { locktoken };\r\n this.client.complete(request, (error: grpc.ServiceError | null) => {\r\n if (error) {\r\n console.error('Complete request failed:', {\r\n code: error.code,\r\n message: error.message,\r\n details: error.details,\r\n });\r\n reject(error);\r\n } else {\r\n resolve();\r\n }\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Abandons the specified message, making it available again for processing.\r\n *\r\n * @param message - The received Service Bus message to abandon.\r\n * @param propertiesToModify - Optional properties to modify on the message.\r\n * @returns A promise that resolves when the operation is successful.\r\n * @throws Error if the lockToken is missing or the gRPC call fails.\r\n */\r\n async abandon(message: ServiceBusReceivedMessage, propertiesToModify?: Record<string, any>): Promise<void> {\r\n const locktoken = this.validateLockToken(message);\r\n const encodedProperties = encodePropertiesForOperation(propertiesToModify, 'abandon');\r\n\r\n return new Promise((resolve, reject) => {\r\n const request: AbandonRequest = {\r\n locktoken,\r\n propertiesToModify: encodedProperties,\r\n };\r\n\r\n this.client.abandon(request, (error: grpc.ServiceError | null) => {\r\n if (error) {\r\n console.error('Abandon request failed:', {\r\n code: error.code,\r\n message: error.message,\r\n details: error.details,\r\n });\r\n reject(error);\r\n } else {\r\n resolve();\r\n }\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Deadletters the specified message, moving it to the dead-letter queue.\r\n *\r\n * @param message - The received Service Bus message to deadletter.\r\n * @param propertiesToModify - Optional properties to modify on the message.\r\n * @param deadletterReason - Optional reason for deadlettering the message.\r\n * @param deadletterErrorDescription - Optional error description for deadlettering.\r\n * @returns A promise that resolves when the operation is successful.\r\n * @throws Error if the lockToken is missing or the gRPC cal