@azure/service-bus 7.10.0-alpha.20250107.2 → 7.10.0-alpha.20250109.3
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.
- package/dist/browser/core/managementClient.js +1 -1
- package/dist/browser/core/managementClient.js.map +1 -1
- package/dist/browser/models.d.ts +4 -4
- package/dist/browser/models.js.map +1 -1
- package/dist/browser/receivers/sessionReceiver.d.ts +4 -4
- package/dist/browser/receivers/sessionReceiver.js +2 -2
- package/dist/browser/receivers/sessionReceiver.js.map +1 -1
- package/dist/browser/sender.d.ts +1 -1
- package/dist/browser/sender.js.map +1 -1
- package/dist/browser/serviceBusClient.d.ts +8 -8
- package/dist/browser/serviceBusClient.js.map +1 -1
- package/dist/browser/serviceBusMessage.d.ts +19 -19
- package/dist/browser/serviceBusMessage.js.map +1 -1
- package/dist/browser/util/constants.d.ts +1 -1
- package/dist/browser/util/constants.js +1 -1
- package/dist/browser/util/constants.js.map +1 -1
- package/dist/commonjs/core/managementClient.js +1 -1
- package/dist/commonjs/core/managementClient.js.map +1 -1
- package/dist/commonjs/models.d.ts +4 -4
- package/dist/commonjs/models.js.map +1 -1
- package/dist/commonjs/receivers/sessionReceiver.d.ts +4 -4
- package/dist/commonjs/receivers/sessionReceiver.js +2 -2
- package/dist/commonjs/receivers/sessionReceiver.js.map +1 -1
- package/dist/commonjs/sender.d.ts +1 -1
- package/dist/commonjs/sender.js.map +1 -1
- package/dist/commonjs/serviceBusClient.d.ts +8 -8
- package/dist/commonjs/serviceBusClient.js.map +1 -1
- package/dist/commonjs/serviceBusMessage.d.ts +19 -19
- package/dist/commonjs/serviceBusMessage.js.map +1 -1
- package/dist/commonjs/util/constants.d.ts +1 -1
- package/dist/commonjs/util/constants.js +1 -1
- package/dist/commonjs/util/constants.js.map +1 -1
- package/dist/esm/core/managementClient.js +1 -1
- package/dist/esm/core/managementClient.js.map +1 -1
- package/dist/esm/models.d.ts +4 -4
- package/dist/esm/models.js.map +1 -1
- package/dist/esm/receivers/sessionReceiver.d.ts +4 -4
- package/dist/esm/receivers/sessionReceiver.js +2 -2
- package/dist/esm/receivers/sessionReceiver.js.map +1 -1
- package/dist/esm/sender.d.ts +1 -1
- package/dist/esm/sender.js.map +1 -1
- package/dist/esm/serviceBusClient.d.ts +8 -8
- package/dist/esm/serviceBusClient.js.map +1 -1
- package/dist/esm/serviceBusMessage.d.ts +19 -19
- package/dist/esm/serviceBusMessage.js.map +1 -1
- package/dist/esm/util/constants.d.ts +1 -1
- package/dist/esm/util/constants.js +1 -1
- package/dist/esm/util/constants.js.map +1 -1
- package/dist/react-native/core/managementClient.js +1 -1
- package/dist/react-native/core/managementClient.js.map +1 -1
- package/dist/react-native/models.d.ts +4 -4
- package/dist/react-native/models.js.map +1 -1
- package/dist/react-native/receivers/sessionReceiver.d.ts +4 -4
- package/dist/react-native/receivers/sessionReceiver.js +2 -2
- package/dist/react-native/receivers/sessionReceiver.js.map +1 -1
- package/dist/react-native/sender.d.ts +1 -1
- package/dist/react-native/sender.js.map +1 -1
- package/dist/react-native/serviceBusClient.d.ts +8 -8
- package/dist/react-native/serviceBusClient.js.map +1 -1
- package/dist/react-native/serviceBusMessage.d.ts +19 -19
- package/dist/react-native/serviceBusMessage.js.map +1 -1
- package/dist/react-native/util/constants.d.ts +1 -1
- package/dist/react-native/util/constants.js +1 -1
- package/dist/react-native/util/constants.js.map +1 -1
- package/package.json +2 -2
|
@@ -111,12 +111,12 @@ export interface ServiceBusMessage {
|
|
|
111
111
|
* The correlation identifier that allows an
|
|
112
112
|
* application to specify a context for the message for the purposes of correlation, for example
|
|
113
113
|
* reflecting the MessageId of a message that is being replied to.
|
|
114
|
-
* See {@link https://
|
|
114
|
+
* See {@link https://learn.microsoft.com/azure/service-bus-messaging/service-bus-messages-payloads?#message-routing-and-correlation | Message Routing and Correlation}.
|
|
115
115
|
*/
|
|
116
116
|
correlationId?: string | number | Buffer;
|
|
117
117
|
/**
|
|
118
118
|
* The partition key for sending a message to a partitioned entity.
|
|
119
|
-
* Maximum length is 128 characters. For {@link https://
|
|
119
|
+
* Maximum length is 128 characters. For {@link https://learn.microsoft.com/azure/service-bus-messaging/service-bus-partitioning | partitioned entities},
|
|
120
120
|
* setting this value enables assigning related messages to the same internal partition,
|
|
121
121
|
* so that submission sequence order is correctly recorded. The partition is chosen by a hash
|
|
122
122
|
* function over this value and cannot be chosen directly.
|
|
@@ -131,7 +131,7 @@ export interface ServiceBusMessage {
|
|
|
131
131
|
* transfer queue in the scope of a transaction, this value selects the transfer queue partition:
|
|
132
132
|
* This is functionally equivalent to `partitionKey` property and ensures that messages are kept
|
|
133
133
|
* together and in order as they are transferred.
|
|
134
|
-
* See {@link https://
|
|
134
|
+
* See {@link https://learn.microsoft.com/azure/service-bus-messaging/service-bus-transactions#transfers-and-send-via | Transfers and Send Via}.
|
|
135
135
|
*/
|
|
136
136
|
/**
|
|
137
137
|
* The session identifier for a session-aware entity. Maximum
|
|
@@ -139,14 +139,14 @@ export interface ServiceBusMessage {
|
|
|
139
139
|
* the session affiliation of the message. Messages with the same session identifier are subject
|
|
140
140
|
* to summary locking and enable exact in-order processing and demultiplexing. For
|
|
141
141
|
* session-unaware entities, this value is ignored.
|
|
142
|
-
* {@link https://
|
|
142
|
+
* {@link https://learn.microsoft.com/azure/service-bus-messaging/message-sessions | Message Sessions}.
|
|
143
143
|
*/
|
|
144
144
|
sessionId?: string;
|
|
145
145
|
/**
|
|
146
146
|
* The session identifier augmenting the `replyTo` address.
|
|
147
147
|
* Maximum length is 128 characters. This value augments the ReplyTo information and specifies
|
|
148
148
|
* which SessionId should be set for the reply when sent to the reply entity.
|
|
149
|
-
* See {@link https://
|
|
149
|
+
* See {@link https://learn.microsoft.com/azure/service-bus-messaging/service-bus-messages-payloads?#message-routing-and-correlation | Message Routing and Correlation}.
|
|
150
150
|
*/
|
|
151
151
|
replyToSessionId?: string;
|
|
152
152
|
/**
|
|
@@ -156,7 +156,7 @@ export interface ServiceBusMessage {
|
|
|
156
156
|
* the assumed value is the DefaultTimeToLive for the respective queue or topic. A message-level
|
|
157
157
|
* `timeToLive` value cannot be longer than the entity's DefaultTimeToLive setting and it is
|
|
158
158
|
* silently adjusted if it does. See
|
|
159
|
-
* {@link https://
|
|
159
|
+
* {@link https://learn.microsoft.com/azure/service-bus-messaging/message-expiration | Expiration}.
|
|
160
160
|
*/
|
|
161
161
|
timeToLive?: number;
|
|
162
162
|
/**
|
|
@@ -168,7 +168,7 @@ export interface ServiceBusMessage {
|
|
|
168
168
|
/**
|
|
169
169
|
* The "to" address. This property is reserved for future use in routing
|
|
170
170
|
* scenarios and presently ignored by the broker itself. Applications can use this value in
|
|
171
|
-
* rule-driven {@link https://
|
|
171
|
+
* rule-driven {@link https://learn.microsoft.com/azure/service-bus-messaging/service-bus-auto-forwarding | auto-forward chaining}
|
|
172
172
|
* scenarios to indicate the intended logical destination of the message.
|
|
173
173
|
*/
|
|
174
174
|
to?: string;
|
|
@@ -177,7 +177,7 @@ export interface ServiceBusMessage {
|
|
|
177
177
|
* application-defined value is a standard way to express a reply path to the receiver of the
|
|
178
178
|
* message. When a sender expects a reply, it sets the value to the absolute or relative path of
|
|
179
179
|
* the queue or topic it expects the reply to be sent to. See
|
|
180
|
-
* {@link https://
|
|
180
|
+
* {@link https://learn.microsoft.com/azure/service-bus-messaging/service-bus-messages-payloads?#message-routing-and-correlation | Message Routing and Correlation}.
|
|
181
181
|
*/
|
|
182
182
|
replyTo?: string;
|
|
183
183
|
/**
|
|
@@ -228,7 +228,7 @@ export interface ServiceBusReceivedMessage extends ServiceBusMessage {
|
|
|
228
228
|
/**
|
|
229
229
|
* The lock token is a reference to the lock that is being held by the broker in
|
|
230
230
|
* `peekLock` receive mode. Locks are used internally settle messages as explained in the
|
|
231
|
-
* {@link https://
|
|
231
|
+
* {@link https://learn.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement | product documentation in more detail}
|
|
232
232
|
* - Not applicable when the message is received in `receiveAndDelete` receive mode.
|
|
233
233
|
* mode.
|
|
234
234
|
* @readonly
|
|
@@ -343,7 +343,7 @@ export declare class ServiceBusMessageImpl implements ServiceBusReceivedMessage
|
|
|
343
343
|
* application-defined value that uniquely identifies the message and its payload. The identifier
|
|
344
344
|
* is a free-form string and can reflect a GUID or an identifier derived from the application
|
|
345
345
|
* context. If enabled, the
|
|
346
|
-
* {@link https://
|
|
346
|
+
* {@link https://learn.microsoft.com/azure/service-bus-messaging/duplicate-detection | duplicate detection}
|
|
347
347
|
* identifies and removes second and further submissions of messages with the same MessageId.
|
|
348
348
|
*/
|
|
349
349
|
messageId?: string | number | Buffer;
|
|
@@ -357,12 +357,12 @@ export declare class ServiceBusMessageImpl implements ServiceBusReceivedMessage
|
|
|
357
357
|
* The correlation identifier that allows an
|
|
358
358
|
* application to specify a context for the message for the purposes of correlation, for example
|
|
359
359
|
* reflecting the MessageId of a message that is being replied to.
|
|
360
|
-
* See {@link https://
|
|
360
|
+
* See {@link https://learn.microsoft.com/azure/service-bus-messaging/service-bus-messages-payloads?#message-routing-and-correlation | Message Routing and Correlation}.
|
|
361
361
|
*/
|
|
362
362
|
correlationId?: string | number | Buffer;
|
|
363
363
|
/**
|
|
364
364
|
* The partition key for sending a message to a
|
|
365
|
-
* partitioned entity. Maximum length is 128 characters. For {@link https://
|
|
365
|
+
* partitioned entity. Maximum length is 128 characters. For {@link https://learn.microsoft.com/azure/service-bus-messaging/service-bus-partitioning | partitioned entities},
|
|
366
366
|
* setting this value enables assigning related messages to the same internal partition,
|
|
367
367
|
* so that submission sequence order is correctly recorded. The partition is chosen by a hash
|
|
368
368
|
* function over this value and cannot be chosen directly. For session-aware entities,
|
|
@@ -375,7 +375,7 @@ export declare class ServiceBusMessageImpl implements ServiceBusReceivedMessage
|
|
|
375
375
|
* transfer queue in the scope of a transaction, this value selects the transfer queue partition:
|
|
376
376
|
* This is functionally equivalent to `partitionKey` property and ensures that messages are kept
|
|
377
377
|
* together and in order as they are transferred.
|
|
378
|
-
* See {@link https://
|
|
378
|
+
* See {@link https://learn.microsoft.com/azure/service-bus-messaging/service-bus-transactions#transfers-and-send-via | Transfers and Send Via}.
|
|
379
379
|
*/
|
|
380
380
|
/**
|
|
381
381
|
* The session identifier for a session-aware entity. Maximum
|
|
@@ -383,14 +383,14 @@ export declare class ServiceBusMessageImpl implements ServiceBusReceivedMessage
|
|
|
383
383
|
* the session affiliation of the message. Messages with the same session identifier are subject
|
|
384
384
|
* to summary locking and enable exact in-order processing and demultiplexing. For
|
|
385
385
|
* session-unaware entities, this value is ignored.
|
|
386
|
-
* {@link https://
|
|
386
|
+
* {@link https://learn.microsoft.com/azure/service-bus-messaging/message-sessions | Message Sessions}.
|
|
387
387
|
*/
|
|
388
388
|
sessionId?: string;
|
|
389
389
|
/**
|
|
390
390
|
* The session identifier augmenting the `replyTo` address.
|
|
391
391
|
* Maximum length is 128 characters. This value augments the ReplyTo information and specifies
|
|
392
392
|
* which SessionId should be set for the reply when sent to the reply entity.
|
|
393
|
-
* See {@link https://
|
|
393
|
+
* See {@link https://learn.microsoft.com/azure/service-bus-messaging/service-bus-messages-payloads?#message-routing-and-correlation | Message Routing and Correlation}.
|
|
394
394
|
*/
|
|
395
395
|
replyToSessionId?: string;
|
|
396
396
|
/**
|
|
@@ -400,7 +400,7 @@ export declare class ServiceBusMessageImpl implements ServiceBusReceivedMessage
|
|
|
400
400
|
* the assumed value is the DefaultTimeToLive for the respective queue or topic. A message-level
|
|
401
401
|
* `timeToLive` value cannot be longer than the entity's DefaultTimeToLive setting and it is
|
|
402
402
|
* silently adjusted if it does. See
|
|
403
|
-
* {@link https://
|
|
403
|
+
* {@link https://learn.microsoft.com/azure/service-bus-messaging/message-expiration | Expiration}.
|
|
404
404
|
*/
|
|
405
405
|
timeToLive?: number;
|
|
406
406
|
/**
|
|
@@ -412,7 +412,7 @@ export declare class ServiceBusMessageImpl implements ServiceBusReceivedMessage
|
|
|
412
412
|
/**
|
|
413
413
|
* The "to" address. This property is reserved for future use in routing
|
|
414
414
|
* scenarios and presently ignored by the broker itself. Applications can use this value in
|
|
415
|
-
* rule-driven {@link https://
|
|
415
|
+
* rule-driven {@link https://learn.microsoft.com/azure/service-bus-messaging/service-bus-auto-forwarding | auto-forward chaining}
|
|
416
416
|
* scenarios to indicate the intended logical destination of the message.
|
|
417
417
|
*/
|
|
418
418
|
to?: string;
|
|
@@ -421,7 +421,7 @@ export declare class ServiceBusMessageImpl implements ServiceBusReceivedMessage
|
|
|
421
421
|
* application-defined value is a standard way to express a reply path to the receiver of the
|
|
422
422
|
* message. When a sender expects a reply, it sets the value to the absolute or relative path of
|
|
423
423
|
* the queue or topic it expects the reply to be sent to. See
|
|
424
|
-
* {@link https://
|
|
424
|
+
* {@link https://learn.microsoft.com/azure/service-bus-messaging/service-bus-messages-payloads?#message-routing-and-correlation | Message Routing and Correlation}.
|
|
425
425
|
*/
|
|
426
426
|
replyTo?: string;
|
|
427
427
|
/**
|
|
@@ -436,7 +436,7 @@ export declare class ServiceBusMessageImpl implements ServiceBusReceivedMessage
|
|
|
436
436
|
/**
|
|
437
437
|
* The lock token is a reference to the lock that is being held by the broker in
|
|
438
438
|
* `peekLock` receive mode. Locks are used internally settle messages as explained in the
|
|
439
|
-
* {@link https://
|
|
439
|
+
* {@link https://learn.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement | product documentation in more detail}
|
|
440
440
|
* - Not applicable when the message is received in `receiveAndDelete` receive mode.
|
|
441
441
|
* mode.
|
|
442
442
|
* @readonly
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serviceBusMessage.js","sourceRoot":"","sources":["../../src/serviceBusMessage.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AA8NlC,kFAmDC;AAMD,sCAgHC;AAGD,0CAaC;AAGD,kDAQC;AAgGD,0CA8KC;AAKD,kDAEC;AAKD,wDAKC;AAKD,kEAIC;;AAxsBD,gDAAmE;AACnE,mCAAgC;AAChC,wDAAwB;AAOxB,+CAA8C;AAC9C,6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ACZ,IAAI,CAAC,IAAA,qBAAS,EAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAEpC,2DAA2D;IAC3D,IACE,OAAO,KAAK,KAAK,QAAQ;QACzB,IAAA,kCAAsB,EAAC,KAAK,EAAE,CAAC,SAAS,CAAC,CAAC;QAC1C,OAAO,KAAK,CAAC,OAAO,KAAK,UAAU,EACnC,CAAC;QACD,OAAO,KAAK,CAAC,OAAO,EAAE,CAAC;IACzB,CAAC;IAED;;;MAGE;IACF,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,MAAM,MAAM,GAAG,EAAE,CAAC;QAClB,KAAK,MAAM,OAAO,IAAI,KAAK,EAAE,CAAC;YAC5B,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC;QAC9C,CAAC;QACD,OAAO,MAAsB,CAAC;IAChC,CAAC;IAED;;;MAGE;IACF,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,IAAA,qBAAS,EAAS,KAAK,CAAC,EAAE,CAAC;QAC1D,MAAM,gBAAgB,qBAAQ,KAAK,CAAE,CAAC;QACtC,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE,CAAC;YAC/C,gBAAwB,CAAC,GAAG,CAAC,GAAG,qBAAqB,CAAE,gBAAwB,CAAC,GAAG,CAAC,CAAC,CAAC;QACzF,CAAC;QACD,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AmqpAnnotatedMessage, Constants } from \"@azure/core-amqp\";\nimport { Buffer } from \"buffer\";\nimport Long from \"long\";\nimport type {\n Delivery,\n DeliveryAnnotations,\n MessageAnnotations,\n Message as RheaMessage,\n} from \"rhea-promise\";\nimport { uuid_to_string } from \"rhea-promise\";\nimport { defaultDataTransformer } from \"./dataTransformer.js\";\nimport { messageLogger as logger } from \"./log.js\";\nimport type { ReceiveMode } from \"./models.js\";\nimport { isDefined, isObjectWithProperties } from \"@azure/core-util\";\nimport { reorderLockToken } from \"./util/utils.js\";\n\n/**\n * @internal\n */\nexport enum DispositionType {\n complete = \"complete\",\n deadletter = \"deadletter\",\n abandon = \"abandon\",\n defer = \"defer\",\n}\n\n/**\n * @internal\n * Describes the delivery annotations for Service Bus.\n */\nexport interface ServiceBusDeliveryAnnotations extends DeliveryAnnotations {\n /**\n * The offset of the last event.\n */\n last_enqueued_offset?: string;\n /**\n * The sequence number of the last event.\n */\n last_enqueued_sequence_number?: number;\n /**\n * The enqueued time of the last event.\n */\n last_enqueued_time_utc?: number;\n /**\n * The retrieval time of the last event.\n */\n runtime_info_retrieval_time_utc?: number;\n /**\n * Any unknown delivery annotations.\n */\n [x: string]: any;\n}\n\n/**\n * @internal\n * Describes the message annotations for Service Bus.\n */\nexport interface ServiceBusMessageAnnotations extends MessageAnnotations {\n /**\n * Annotation for the partition key set for the event.\n */\n \"x-opt-partition-key\"?: string | null;\n /**\n * Annontation for the sequence number of the event.\n */\n \"x-opt-sequence-number\"?: number;\n /**\n * Annotation for the enqueued time of the event.\n */\n \"x-opt-enqueued-time\"?: number;\n /**\n * Annotation for the offset of the event.\n */\n \"x-opt-offset\"?: string;\n /**\n * Annotation for the message being locked until.\n */\n \"x-opt-locked-until\"?: Date | number;\n /**\n * Annotation for the message state.\n */\n \"x-opt-message-state\"?: number;\n}\n\n/**\n * Describes the reason and error description for dead lettering a message using the `deadLetter()`\n * method on the message received from Service Bus.\n */\nexport interface DeadLetterOptions {\n /**\n * The reason for deadlettering the message.\n */\n deadLetterReason: string;\n /**\n * The error description for deadlettering the message.\n */\n deadLetterErrorDescription: string;\n}\n\n/**\n * Describes the message to be sent to Service Bus.\n */\nexport interface ServiceBusMessage {\n /**\n * The message body that needs to be sent or is received.\n * If the application receiving the message is not using this SDK,\n * convert your body payload to a byte array or Buffer for better\n * cross-language compatibility.\n */\n body: any;\n /**\n * The message identifier is an\n * application-defined value that uniquely identifies the message and its payload.\n *\n * Note: Numbers that are not whole integers are not allowed.\n */\n messageId?: string | number | Buffer;\n /**\n * The content type of the message. Optionally describes\n * the payload of the message, with a descriptor following the format of RFC2045, Section 5, for\n * example \"application/json\".\n */\n contentType?: string;\n /**\n * The correlation identifier that allows an\n * application to specify a context for the message for the purposes of correlation, for example\n * reflecting the MessageId of a message that is being replied to.\n * See {@link https://docs.microsoft.com/azure/service-bus-messaging/service-bus-messages-payloads?#message-routing-and-correlation | Message Routing and Correlation}.\n */\n correlationId?: string | number | Buffer;\n /**\n * The partition key for sending a message to a partitioned entity.\n * Maximum length is 128 characters. For {@link https://docs.microsoft.com/azure/service-bus-messaging/service-bus-partitioning | partitioned entities},\n * setting this value enables assigning related messages to the same internal partition,\n * so that submission sequence order is correctly recorded. The partition is chosen by a hash\n * function over this value and cannot be chosen directly.\n * - For session-aware entities, the `sessionId` property overrides this value.\n * - For non partitioned entities, partition key will be ignored\n *\n */\n partitionKey?: string;\n /**\n * The partition key for sending a message into an entity\n * via a partitioned transfer queue. Maximum length is 128 characters. If a message is sent via a\n * transfer queue in the scope of a transaction, this value selects the transfer queue partition:\n * This is functionally equivalent to `partitionKey` property and ensures that messages are kept\n * together and in order as they are transferred.\n * See {@link https://docs.microsoft.com/azure/service-bus-messaging/service-bus-transactions#transfers-and-send-via | Transfers and Send Via}.\n */\n\n // Will be required later for implementing Transactions\n // viaPartitionKey?: string;\n\n /**\n * The session identifier for a session-aware entity. Maximum\n * length is 128 characters. For session-aware entities, this application-defined value specifies\n * the session affiliation of the message. Messages with the same session identifier are subject\n * to summary locking and enable exact in-order processing and demultiplexing. For\n * session-unaware entities, this value is ignored.\n * {@link https://docs.microsoft.com/azure/service-bus-messaging/message-sessions | Message Sessions}.\n */\n sessionId?: string;\n /**\n * The session identifier augmenting the `replyTo` address.\n * Maximum length is 128 characters. This value augments the ReplyTo information and specifies\n * which SessionId should be set for the reply when sent to the reply entity.\n * See {@link https://docs.microsoft.com/azure/service-bus-messaging/service-bus-messages-payloads?#message-routing-and-correlation | Message Routing and Correlation}.\n */\n replyToSessionId?: string;\n /**\n * The message’s time to live value. This value is the relative\n * duration after which the message expires, starting from the instant the message has been\n * accepted and stored by the broker, as captured in `enqueuedTimeUtc`. When not set explicitly,\n * the assumed value is the DefaultTimeToLive for the respective queue or topic. A message-level\n * `timeToLive` value cannot be longer than the entity's DefaultTimeToLive setting and it is\n * silently adjusted if it does. See\n * {@link https://docs.microsoft.com/azure/service-bus-messaging/message-expiration | Expiration}.\n */\n timeToLive?: number;\n /**\n * The application specific label. This property enables the\n * application to indicate the purpose of the message to the receiver in a standardized. fashion,\n * similar to an email subject line. The mapped AMQP property is \"subject\".\n */\n subject?: string;\n /**\n * The \"to\" address. This property is reserved for future use in routing\n * scenarios and presently ignored by the broker itself. Applications can use this value in\n * rule-driven {@link https://docs.microsoft.com/azure/service-bus-messaging/service-bus-auto-forwarding | auto-forward chaining}\n * scenarios to indicate the intended logical destination of the message.\n */\n to?: string;\n /**\n * The address of an entity to send replies to. This optional and\n * application-defined value is a standard way to express a reply path to the receiver of the\n * message. When a sender expects a reply, it sets the value to the absolute or relative path of\n * the queue or topic it expects the reply to be sent to. See\n * {@link https://docs.microsoft.com/azure/service-bus-messaging/service-bus-messages-payloads?#message-routing-and-correlation | Message Routing and Correlation}.\n */\n replyTo?: string;\n /**\n * The date and time in UTC at which the message will\n * be enqueued. This property returns the time in UTC; when setting the property, the\n * supplied DateTime value must also be in UTC. This value is for delayed message sending.\n * It is utilized to delay messages sending to a specific time in the future. Message enqueuing\n * time does not mean that the message will be sent at the same time. It will get enqueued,\n * but the actual sending time depends on the queue's workload and its state.\n */\n scheduledEnqueueTimeUtc?: Date;\n /**\n * The application specific properties which can be\n * used for custom message metadata.\n */\n applicationProperties?: { [key: string]: number | boolean | string | Date | null };\n}\n\n/**\n * @internal\n * Gets the error message for when a property on given message is not of expected type\n */\nexport function getMessagePropertyTypeMismatchError(msg: ServiceBusMessage): Error | undefined {\n if (msg.contentType != null && typeof msg.contentType !== \"string\") {\n return new TypeError(\"The property 'contentType' on the message must be of type 'string'\");\n }\n\n if (msg.subject != null && typeof msg.subject !== \"string\") {\n return new TypeError(\"The property 'label' on the message must be of type 'string'\");\n }\n\n if (msg.to != null && typeof msg.to !== \"string\") {\n return new TypeError(\"The property 'to' on the message must be of type 'string'\");\n }\n\n if (msg.replyTo != null && typeof msg.replyTo !== \"string\") {\n return new TypeError(\"The property 'replyTo' on the message must be of type 'string'\");\n }\n\n if (msg.replyToSessionId != null && typeof msg.replyToSessionId !== \"string\") {\n return new TypeError(\"The property 'replyToSessionId' on the message must be of type 'string'\");\n }\n\n if (msg.timeToLive != null && typeof msg.timeToLive !== \"number\") {\n return new TypeError(\"The property 'timeToLive' on the message must be of type 'number'\");\n }\n\n if (msg.sessionId != null && typeof msg.sessionId !== \"string\") {\n return new TypeError(\"The property 'sessionId' on the message must be of type 'string'\");\n }\n\n if (\n msg.messageId != null &&\n typeof msg.messageId !== \"string\" &&\n typeof msg.messageId !== \"number\" &&\n !Buffer.isBuffer(msg.messageId)\n ) {\n return new TypeError(\n \"The property 'messageId' on the message must be of type string, number or Buffer\",\n );\n }\n\n if (\n msg.correlationId != null &&\n typeof msg.correlationId !== \"string\" &&\n typeof msg.correlationId !== \"number\" &&\n !Buffer.isBuffer(msg.correlationId)\n ) {\n return new TypeError(\n \"The property 'correlationId' on the message must be of type string, number or Buffer\",\n );\n }\n return;\n}\n\n/**\n * @internal\n * Converts given ServiceBusMessage to RheaMessage\n */\nexport function toRheaMessage(\n msg: ServiceBusMessage | ServiceBusReceivedMessage | AmqpAnnotatedMessage,\n encoder: Pick<typeof defaultDataTransformer, \"encode\">,\n): RheaMessage {\n let amqpMsg: RheaMessage;\n if (isAmqpAnnotatedMessage(msg)) {\n amqpMsg = {\n ...AmqpAnnotatedMessage.toRheaMessage(msg),\n body: encoder.encode(msg.body, msg.bodyType ?? \"data\"),\n };\n } else {\n let bodyType: \"data\" | \"sequence\" | \"value\" = \"data\";\n\n if (isServiceBusReceivedMessage(msg)) {\n /*\n * TODO: this is a bit complicated.\n *\n * It seems reasonable to expect to be able to round-trip a message (ie,\n * receive a message, and then send it again, possibly to another queue / topic).\n * If the user does that we need to make sure to respect their original AMQP\n * type so when the message is re - encoded we don't put 'body' into the wrong spot.\n *\n * The complication is that we need to decide if we're okay with respecting a field\n * from the rawAmqpMessage, which up until now we've treated as just vestigial\n * information on send. My hope is that the use case of \"alter the sb message in some\n * incompatible way with the underying _rawAmqpMessage.bodyType\" is not common\n * enough for us to try to do anything more than what I'm doing here.\n */\n bodyType = msg._rawAmqpMessage.bodyType ?? \"data\";\n }\n\n // TODO: it seems sensible that we'd also do this for AMQPAnnotated message.\n const validationError = getMessagePropertyTypeMismatchError(msg);\n\n if (validationError) {\n throw validationError;\n }\n\n amqpMsg = {\n body: encoder.encode(msg.body, bodyType),\n message_annotations: {},\n };\n\n if (msg.timeToLive) {\n amqpMsg.ttl = Math.min(msg.timeToLive, Constants.maxUint32Value);\n amqpMsg.creation_time = new Date();\n amqpMsg.absolute_expiry_time = new Date(\n Math.min(amqpMsg.creation_time.getTime() + amqpMsg.ttl, Constants.maxAbsoluteExpiryTime),\n );\n }\n }\n\n if (isAmqpAnnotatedMessage(msg)) {\n return amqpMsg;\n }\n\n if (msg.applicationProperties != null) {\n amqpMsg.application_properties = msg.applicationProperties;\n }\n if (msg.contentType != null) {\n amqpMsg.content_type = msg.contentType;\n }\n if (msg.sessionId != null) {\n if (msg.sessionId.length > Constants.maxSessionIdLength) {\n throw new Error(\n \"Length of 'sessionId' property on the message cannot be greater than 128 characters.\",\n );\n }\n\n amqpMsg.group_id = msg.sessionId;\n }\n if (msg.replyTo != null) {\n amqpMsg.reply_to = msg.replyTo;\n }\n if (msg.to != null) {\n amqpMsg.to = msg.to;\n }\n if (msg.subject != null) {\n amqpMsg.subject = msg.subject;\n }\n\n updateMessageId(amqpMsg, msg.messageId);\n\n if (msg.correlationId != null) {\n amqpMsg.correlation_id = msg.correlationId;\n }\n if (msg.replyToSessionId != null) {\n amqpMsg.reply_to_group_id = msg.replyToSessionId;\n }\n if (msg.partitionKey != null) {\n if (msg.partitionKey.length > Constants.maxPartitionKeyLength) {\n throw new Error(\n \"Length of 'partitionKey' property on the message cannot be greater than 128 characters.\",\n );\n }\n amqpMsg.message_annotations![Constants.partitionKey] = msg.partitionKey;\n }\n\n // Will be required later for implementing Transactions\n // if (msg.viaPartitionKey != null) {\n // if (msg.viaPartitionKey.length > Constants.maxPartitionKeyLength) {\n // throw new Error(\n // \"Length of 'viaPartitionKey' property on the message cannot be greater than 128 characters.\"\n // );\n // }\n // amqpMsg.message_annotations![Constants.viaPartitionKey] = msg.viaPartitionKey;\n // }\n\n updateScheduledTime(amqpMsg, msg.scheduledEnqueueTimeUtc);\n\n logger.verbose(\"SBMessage to RheaMessage: %O\", amqpMsg);\n return amqpMsg;\n}\n\n/** @internal */\nexport function updateMessageId(\n rheaMessage: RheaMessage,\n messageId: RheaMessage[\"message_id\"],\n): void {\n if (messageId != null) {\n if (typeof messageId === \"string\" && messageId.length > Constants.maxMessageIdLength) {\n throw new Error(\n `Length of 'messageId' property on the message cannot be greater than ${Constants.maxMessageIdLength} characters.`,\n );\n }\n\n rheaMessage.message_id = messageId;\n }\n}\n\n/** @internal */\nexport function updateScheduledTime(\n rheaMessage: RheaMessage,\n scheduledEnqueuedTimeUtc: Date | undefined,\n): void {\n if (scheduledEnqueuedTimeUtc != null) {\n rheaMessage.message_annotations = rheaMessage.message_annotations ?? {};\n rheaMessage.message_annotations[Constants.scheduledEnqueueTime] = scheduledEnqueuedTimeUtc;\n }\n}\n\n/**\n * Describes the message received from Service Bus during peek operations and so cannot be settled.\n */\nexport interface ServiceBusReceivedMessage extends ServiceBusMessage {\n /**\n * The reason for deadlettering the message.\n * @readonly\n */\n readonly deadLetterReason?: string;\n /**\n * The error description for deadlettering the message.\n * @readonly\n */\n readonly deadLetterErrorDescription?: string;\n /**\n * The lock token is a reference to the lock that is being held by the broker in\n * `peekLock` receive mode. Locks are used internally settle messages as explained in the\n * {@link https://docs.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement | product documentation in more detail}\n * - Not applicable when the message is received in `receiveAndDelete` receive mode.\n * mode.\n * @readonly\n */\n readonly lockToken?: string;\n /**\n * Number of deliveries that have been attempted for this message. The count is\n * incremented when a message lock expires, or the message is explicitly abandoned using the\n * `abandon()` method on the message.\n * @readonly\n */\n readonly deliveryCount?: number;\n /**\n * The UTC instant at which the message has been accepted and stored in Service Bus.\n * @readonly\n */\n readonly enqueuedTimeUtc?: Date;\n /**\n * The UTC instant at which the message is marked for removal and no longer available for\n * retrieval from the entity due to expiration. This property is computed from 2 other properties\n * on the message: `enqueuedTimeUtc` + `timeToLive`.\n */\n readonly expiresAtUtc?: Date;\n /**\n * The UTC instant until which the message is held locked in the queue/subscription.\n * When the lock expires, the `deliveryCount` is incremented and the message is again available\n * for retrieval.\n * - Not applicable when the message is received in `receiveAndDelete` receive mode.\n * mode.\n */\n lockedUntilUtc?: Date;\n /**\n * The original sequence number of the message. For\n * messages that have been auto-forwarded, this property reflects the sequence number that had\n * first been assigned to the message at its original point of submission.\n * @readonly\n */\n readonly enqueuedSequenceNumber?: number;\n /**\n * The unique number assigned to a message by Service Bus.\n * The sequence number is a unique 64-bit integer assigned to a message as it is accepted\n * and stored by the broker and functions as its true identifier. For partitioned entities,\n * the topmost 16 bits reflect the partition identifier. Sequence numbers monotonically increase.\n * They roll over to 0 when the 48-64 bit range is exhausted.\n *\n * **Max safe integer** that Javascript currently supports is `2^53 - 1`. The sequence number\n * is an AMQP `Long` type which can be upto 64 bits long. To represent that we are using a\n * library named {@link https://github.com/dcodeIO/long.js | long.js}. We expect customers\n * to use the **`Long`** type exported by this library.\n * @readonly\n */\n readonly sequenceNumber?: Long;\n /**\n * The name of the queue or subscription that this message\n * was enqueued on, before it was deadlettered. Only set in messages that have been dead-lettered\n * and subsequently auto-forwarded from the dead-letter sub-queue to another entity. Indicates the\n * entity in which the message was dead-lettered.\n * @readonly\n */\n readonly deadLetterSource?: string;\n /**\n * State of the message can be active, deferred or scheduled. Deferred messages have deferred state,\n * scheduled messages have scheduled state, all other messages have active state.\n */\n readonly state: \"active\" | \"deferred\" | \"scheduled\";\n /**\n * The underlying raw amqp message.\n * @readonly\n */\n readonly _rawAmqpMessage: AmqpAnnotatedMessage;\n}\n\n/**\n * @internal\n * Converts given RheaMessage to ServiceBusReceivedMessage\n */\nexport function fromRheaMessage(\n rheaMessage: RheaMessage,\n options: {\n skipParsingBodyAsJson: boolean;\n skipConvertingDate?: boolean;\n delivery?: Delivery;\n shouldReorderLockToken?: boolean;\n },\n): ServiceBusReceivedMessage {\n if (!rheaMessage) {\n rheaMessage = {\n body: undefined,\n };\n }\n const {\n skipParsingBodyAsJson,\n delivery,\n shouldReorderLockToken,\n skipConvertingDate = false,\n } = options;\n const { body, bodyType } = defaultDataTransformer.decodeWithType(\n rheaMessage.body,\n skipParsingBodyAsJson,\n );\n\n const sbmsg: ServiceBusMessage = {\n body: body,\n };\n\n if (rheaMessage.application_properties != null) {\n sbmsg.applicationProperties = skipConvertingDate\n ? rheaMessage.application_properties\n : convertDatesToNumbers(rheaMessage.application_properties);\n }\n if (rheaMessage.content_type != null) {\n sbmsg.contentType = rheaMessage.content_type;\n }\n if (rheaMessage.group_id != null) {\n sbmsg.sessionId = rheaMessage.group_id;\n }\n if (rheaMessage.reply_to != null) {\n sbmsg.replyTo = rheaMessage.reply_to;\n }\n if (rheaMessage.to != null) {\n sbmsg.to = rheaMessage.to;\n }\n if (rheaMessage.subject != null) {\n sbmsg.subject = rheaMessage.subject;\n }\n if (rheaMessage.message_id != null) {\n sbmsg.messageId = rheaMessage.message_id;\n }\n if (rheaMessage.correlation_id != null) {\n sbmsg.correlationId = rheaMessage.correlation_id;\n }\n if (rheaMessage.reply_to_group_id != null) {\n sbmsg.replyToSessionId = rheaMessage.reply_to_group_id;\n }\n\n if (rheaMessage.message_annotations != null) {\n if (rheaMessage.message_annotations[Constants.partitionKey] != null) {\n sbmsg.partitionKey = rheaMessage.message_annotations[Constants.partitionKey];\n }\n\n // Will be required later for implementing Transactions\n // if (msg.message_annotations[Constants.viaPartitionKey] != null) {\n // sbmsg.viaPartitionKey = msg.message_annotations[Constants.viaPartitionKey];\n // }\n\n if (rheaMessage.message_annotations[Constants.scheduledEnqueueTime] != null) {\n sbmsg.scheduledEnqueueTimeUtc =\n rheaMessage.message_annotations[Constants.scheduledEnqueueTime];\n }\n }\n\n type PartialWritable<T> = Partial<{\n -readonly [P in keyof T]: T[P];\n }>;\n const props: PartialWritable<ServiceBusReceivedMessage> & {\n state: \"active\" | \"deferred\" | \"scheduled\";\n } = { state: \"active\" };\n if (rheaMessage.message_annotations != null) {\n if (rheaMessage.message_annotations[Constants.deadLetterSource] != null) {\n props.deadLetterSource = rheaMessage.message_annotations[Constants.deadLetterSource];\n }\n const messageState = rheaMessage.message_annotations[Constants.messageState];\n if (messageState === 1) {\n props.state = \"deferred\";\n } else if (messageState === 2) {\n props.state = \"scheduled\";\n }\n if (rheaMessage.message_annotations[Constants.enqueueSequenceNumber] != null) {\n props.enqueuedSequenceNumber =\n rheaMessage.message_annotations[Constants.enqueueSequenceNumber];\n }\n if (rheaMessage.message_annotations[Constants.sequenceNumber] != null) {\n if (Buffer.isBuffer(rheaMessage.message_annotations[Constants.sequenceNumber])) {\n props.sequenceNumber = Long.fromBytesBE(\n rheaMessage.message_annotations[Constants.sequenceNumber],\n );\n } else {\n props.sequenceNumber = Long.fromNumber(\n rheaMessage.message_annotations[Constants.sequenceNumber],\n );\n }\n }\n if (rheaMessage.message_annotations[Constants.enqueuedTime] != null) {\n props.enqueuedTimeUtc = new Date(\n rheaMessage.message_annotations[Constants.enqueuedTime] as number,\n );\n }\n if (rheaMessage.message_annotations[Constants.lockedUntil] != null) {\n props.lockedUntilUtc = new Date(\n rheaMessage.message_annotations[Constants.lockedUntil] as number,\n );\n }\n }\n\n const rawMessage = AmqpAnnotatedMessage.fromRheaMessage(rheaMessage);\n rawMessage.bodyType = bodyType;\n if (rheaMessage.ttl == null) {\n rheaMessage.ttl = rawMessage.header?.timeToLive ?? Constants.maxDurationValue;\n }\n if (props.enqueuedTimeUtc) {\n props.expiresAtUtc = new Date(\n Math.min(props.enqueuedTimeUtc.getTime() + rheaMessage.ttl, Constants.maxDurationValue),\n );\n }\n\n if (rawMessage.applicationProperties) {\n rawMessage.applicationProperties = skipConvertingDate\n ? rawMessage.applicationProperties\n : convertDatesToNumbers(rawMessage.applicationProperties);\n }\n if (rawMessage.deliveryAnnotations) {\n rawMessage.deliveryAnnotations = skipConvertingDate\n ? rawMessage.deliveryAnnotations\n : convertDatesToNumbers(rawMessage.deliveryAnnotations);\n }\n if (rawMessage.messageAnnotations) {\n rawMessage.messageAnnotations = skipConvertingDate\n ? rawMessage.messageAnnotations\n : convertDatesToNumbers(rawMessage.messageAnnotations);\n }\n\n if (rawMessage.header?.timeToLive) {\n sbmsg.timeToLive = rawMessage.header.timeToLive;\n }\n\n const rcvdsbmsg: ServiceBusReceivedMessage = {\n _rawAmqpMessage: rawMessage,\n deliveryCount: rheaMessage.delivery_count,\n lockToken:\n delivery && delivery.tag && delivery.tag.length !== 0\n ? uuid_to_string(\n shouldReorderLockToken === true\n ? reorderLockToken(\n typeof delivery.tag === \"string\" ? Buffer.from(delivery.tag) : delivery.tag,\n )\n : typeof delivery.tag === \"string\"\n ? Buffer.from(delivery.tag)\n : delivery.tag,\n )\n : undefined,\n ...sbmsg,\n ...props,\n deadLetterReason: sbmsg.applicationProperties?.DeadLetterReason as string | undefined,\n deadLetterErrorDescription: sbmsg.applicationProperties?.DeadLetterErrorDescription as\n | string\n | undefined,\n };\n\n logger.verbose(\"AmqpMessage to ServiceBusReceivedMessage: %O\", rcvdsbmsg);\n return rcvdsbmsg;\n}\n\n/**\n * @internal\n */\nexport function isServiceBusMessage(possible: unknown): possible is ServiceBusMessage {\n return isObjectWithProperties(possible, [\"body\"]);\n}\n\n/**\n * @internal\n */\nexport function isAmqpAnnotatedMessage(possible: unknown): possible is AmqpAnnotatedMessage {\n return (\n isObjectWithProperties(possible, [\"body\", \"bodyType\"]) &&\n possible.constructor.name !== ServiceBusMessageImpl.name\n );\n}\n\n/**\n * @internal\n */\nexport function isServiceBusReceivedMessage(\n possible: unknown,\n): possible is ServiceBusReceivedMessage {\n return isServiceBusMessage(possible) && \"_rawAmqpMessage\" in possible;\n}\n\n/**\n * Describes the message received from Service Bus.\n *\n * @internal\n */\nexport class ServiceBusMessageImpl implements ServiceBusReceivedMessage {\n /**\n * The message body that needs to be sent or is received.\n */\n body: any;\n /**\n * The application specific properties.\n */\n applicationProperties?: { [key: string]: any };\n /**\n * The message identifier is an\n * application-defined value that uniquely identifies the message and its payload. The identifier\n * is a free-form string and can reflect a GUID or an identifier derived from the application\n * context. If enabled, the\n * {@link https://docs.microsoft.com/azure/service-bus-messaging/duplicate-detection | duplicate detection}\n * identifies and removes second and further submissions of messages with the same MessageId.\n */\n messageId?: string | number | Buffer;\n /**\n * The content type of the message. Optionally describes\n * the payload of the message, with a descriptor following the format of RFC2045, Section 5, for\n * example \"application/json\".\n */\n contentType?: string;\n /**\n * The correlation identifier that allows an\n * application to specify a context for the message for the purposes of correlation, for example\n * reflecting the MessageId of a message that is being replied to.\n * See {@link https://docs.microsoft.com/azure/service-bus-messaging/service-bus-messages-payloads?#message-routing-and-correlation | Message Routing and Correlation}.\n */\n correlationId?: string | number | Buffer;\n /**\n * The partition key for sending a message to a\n * partitioned entity. Maximum length is 128 characters. For {@link https://docs.microsoft.com/azure/service-bus-messaging/service-bus-partitioning | partitioned entities},\n * setting this value enables assigning related messages to the same internal partition,\n * so that submission sequence order is correctly recorded. The partition is chosen by a hash\n * function over this value and cannot be chosen directly. For session-aware entities,\n * the `sessionId` property overrides this value.\n */\n partitionKey?: string;\n /**\n * The partition key for sending a message into an entity\n * via a partitioned transfer queue. Maximum length is 128 characters. If a message is sent via a\n * transfer queue in the scope of a transaction, this value selects the transfer queue partition:\n * This is functionally equivalent to `partitionKey` property and ensures that messages are kept\n * together and in order as they are transferred.\n * See {@link https://docs.microsoft.com/azure/service-bus-messaging/service-bus-transactions#transfers-and-send-via | Transfers and Send Via}.\n */\n // Will be required later for implementing Transactions\n // viaPartitionKey?: string;\n /**\n * The session identifier for a session-aware entity. Maximum\n * length is 128 characters. For session-aware entities, this application-defined value specifies\n * the session affiliation of the message. Messages with the same session identifier are subject\n * to summary locking and enable exact in-order processing and demultiplexing. For\n * session-unaware entities, this value is ignored.\n * {@link https://docs.microsoft.com/azure/service-bus-messaging/message-sessions | Message Sessions}.\n */\n sessionId?: string;\n /**\n * The session identifier augmenting the `replyTo` address.\n * Maximum length is 128 characters. This value augments the ReplyTo information and specifies\n * which SessionId should be set for the reply when sent to the reply entity.\n * See {@link https://docs.microsoft.com/azure/service-bus-messaging/service-bus-messages-payloads?#message-routing-and-correlation | Message Routing and Correlation}.\n */\n replyToSessionId?: string;\n /**\n * The message’s time to live value. This value is the relative\n * duration after which the message expires, starting from the instant the message has been\n * accepted and stored by the broker, as captured in `enqueuedTimeUtc`. When not set explicitly,\n * the assumed value is the DefaultTimeToLive for the respective queue or topic. A message-level\n * `timeToLive` value cannot be longer than the entity's DefaultTimeToLive setting and it is\n * silently adjusted if it does. See\n * {@link https://docs.microsoft.com/azure/service-bus-messaging/message-expiration | Expiration}.\n */\n timeToLive?: number;\n /**\n * The application specific label. This property enables the\n * application to indicate the purpose of the message to the receiver in a standardized. fashion,\n * similar to an email subject line. The mapped AMQP property is \"subject\".\n */\n subject?: string;\n /**\n * The \"to\" address. This property is reserved for future use in routing\n * scenarios and presently ignored by the broker itself. Applications can use this value in\n * rule-driven {@link https://docs.microsoft.com/azure/service-bus-messaging/service-bus-auto-forwarding | auto-forward chaining}\n * scenarios to indicate the intended logical destination of the message.\n */\n to?: string;\n /**\n * The address of an entity to send replies to. This optional and\n * application-defined value is a standard way to express a reply path to the receiver of the\n * message. When a sender expects a reply, it sets the value to the absolute or relative path of\n * the queue or topic it expects the reply to be sent to. See\n * {@link https://docs.microsoft.com/azure/service-bus-messaging/service-bus-messages-payloads?#message-routing-and-correlation | Message Routing and Correlation}.\n */\n replyTo?: string;\n /**\n * The date and time in UTC at which the message will\n * be enqueued. This property returns the time in UTC; when setting the property, the\n * supplied DateTime value must also be in UTC. This value is for delayed message sending.\n * It is utilized to delay messages sending to a specific time in the future. Message enqueuing\n * time does not mean that the message will be sent at the same time. It will get enqueued,\n * but the actual sending time depends on the queue's workload and its state.\n */\n scheduledEnqueueTimeUtc?: Date;\n /**\n * The lock token is a reference to the lock that is being held by the broker in\n * `peekLock` receive mode. Locks are used internally settle messages as explained in the\n * {@link https://docs.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement | product documentation in more detail}\n * - Not applicable when the message is received in `receiveAndDelete` receive mode.\n * mode.\n * @readonly\n */\n readonly lockToken?: string;\n /**\n * Number of deliveries that have been attempted for this message. The count is\n * incremented when a message lock expires, or the message is explicitly abandoned using the\n * `abandon()` method on the message.\n * @readonly\n */\n readonly deliveryCount?: number;\n /**\n * The UTC instant at which the message has been accepted and stored in Service Bus.\n * @readonly\n */\n readonly enqueuedTimeUtc?: Date;\n /**\n * The UTC instant at which the message is marked for removal and no longer available for\n * retrieval from the entity due to expiration. This property is computed from 2 other properties\n * on the message: `enqueuedTimeUtc` + `timeToLive`.\n */\n readonly expiresAtUtc?: Date;\n /**\n * The UTC instant until which the message is held locked in the queue/subscription.\n * When the lock expires, the `deliveryCount` is incremented and the message is again available\n * for retrieval.\n * - Not applicable when the message is received in `receiveAndDelete` receive mode.\n * mode.\n */\n lockedUntilUtc?: Date;\n /**\n * The original sequence number of the message. For\n * messages that have been auto-forwarded, this property reflects the sequence number that had\n * first been assigned to the message at its original point of submission.\n * @readonly\n */\n readonly enqueuedSequenceNumber?: number;\n /**\n * The unique number assigned to a message by Service Bus.\n * The sequence number is a unique 64-bit integer assigned to a message as it is accepted\n * and stored by the broker and functions as its true identifier. For partitioned entities,\n * the topmost 16 bits reflect the partition identifier. Sequence numbers monotonically increase.\n * They roll over to 0 when the 48-64 bit range is exhausted.\n * @readonly\n */\n readonly sequenceNumber?: Long;\n /**\n * The name of the queue or subscription that this message\n * was enqueued on, before it was deadlettered. Only set in messages that have been dead-lettered\n * and subsequently auto-forwarded from the dead-letter sub-queue to another entity. Indicates the\n * entity in which the message was dead-lettered.\n * @readonly\n */\n readonly deadLetterSource?: string;\n /**\n * State of the message can be active, deferred or scheduled. Deferred messages have deferred state,\n * scheduled messages have scheduled state, all other messages have active state.\n */\n readonly state: \"active\" | \"deferred\" | \"scheduled\";\n /**\n * The associated delivery of the received message.\n */\n readonly delivery: Delivery;\n /**\n * The underlying raw amqp annotated message.\n * @readonly\n */\n readonly _rawAmqpMessage: AmqpAnnotatedMessage;\n /**\n * The reason for deadlettering the message.\n * @readonly\n */\n readonly deadLetterReason?: string;\n /**\n * The error description for deadlettering the message.\n * @readonly\n */\n readonly deadLetterErrorDescription?: string;\n /**\n * @internal\n */\n constructor(\n msg: RheaMessage,\n delivery: Delivery,\n shouldReorderLockToken: boolean,\n receiveMode: ReceiveMode,\n skipParsingBodyAsJson: boolean,\n skipConvertingDate: boolean,\n ) {\n const { _rawAmqpMessage, ...restOfMessageProps } = fromRheaMessage(\n msg,\n\n { skipParsingBodyAsJson, delivery, shouldReorderLockToken, skipConvertingDate },\n );\n this._rawAmqpMessage = _rawAmqpMessage; // need to initialize _rawAmqpMessage property to make compiler happy\n Object.assign(this, restOfMessageProps);\n this.state = restOfMessageProps.state; // to suppress error TS2564: Property 'state' has no initializer and is not definitely assigned in the constructor.\n\n // Lock on a message is applicable only in peekLock mode, but the service sets\n // the lock token even in receiveAndDelete mode if the entity in question is partitioned.\n if (receiveMode === \"receiveAndDelete\") {\n this.lockToken = undefined;\n }\n this.delivery = delivery;\n }\n\n /**\n * Creates a clone of the current message to allow it to be re-sent to the queue\n * @returns ServiceBusMessage\n */\n clone(): ServiceBusMessage {\n // We are returning a ServiceBusMessage object because that object can then be sent to Service Bus\n const clone: ServiceBusMessage = {\n body: this.body,\n contentType: this.contentType,\n correlationId: this.correlationId,\n subject: this.subject,\n messageId: this.messageId,\n partitionKey: this.partitionKey,\n replyTo: this.replyTo,\n replyToSessionId: this.replyToSessionId,\n scheduledEnqueueTimeUtc: this.scheduledEnqueueTimeUtc,\n sessionId: this.sessionId,\n timeToLive: this.timeToLive,\n to: this.to,\n applicationProperties: this.applicationProperties,\n // Will be required later for implementing Transactions\n // viaPartitionKey: this.viaPartitionKey\n };\n\n return clone;\n }\n}\n\n/**\n * Converts any Date objects into a number representing date.getTime().\n * Recursively checks for any Date objects in arrays and objects.\n * @internal\n */\nfunction convertDatesToNumbers<T = unknown>(thing: T): T {\n // fast exit\n if (!isDefined(thing)) return thing;\n\n // When 'thing' is a Date, return the number representation\n if (\n typeof thing === \"object\" &&\n isObjectWithProperties(thing, [\"getTime\"]) &&\n typeof thing.getTime === \"function\"\n ) {\n return thing.getTime();\n }\n\n /*\n Examples:\n [0, 'foo', new Date(), { nested: new Date()}]\n */\n if (Array.isArray(thing)) {\n const result = [];\n for (const element of thing) {\n result.push(convertDatesToNumbers(element));\n }\n return result as unknown as T;\n }\n\n /*\n Examples:\n { foo: new Date(), children: { nested: new Date() }}\n */\n if (typeof thing === \"object\" && isDefined<object>(thing)) {\n const thingShallowCopy = { ...thing };\n for (const key of Object.keys(thingShallowCopy)) {\n (thingShallowCopy as any)[key] = convertDatesToNumbers((thingShallowCopy as any)[key]);\n }\n return thingShallowCopy;\n }\n\n return thing;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"serviceBusMessage.js","sourceRoot":"","sources":["../../src/serviceBusMessage.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AA8NlC,kFAmDC;AAMD,sCAgHC;AAGD,0CAaC;AAGD,kDAQC;AAgGD,0CA8KC;AAKD,kDAEC;AAKD,wDAKC;AAKD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ACF;AAnPD,sDAmPC;AAED;;;;GAIG;AACH,SAAS,qBAAqB,CAAc,KAAQ;IAClD,YAAY;IACZ,IAAI,CAAC,IAAA,qBAAS,EAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAEpC,2DAA2D;IAC3D,IACE,OAAO,KAAK,KAAK,QAAQ;QACzB,IAAA,kCAAsB,EAAC,KAAK,EAAE,CAAC,SAAS,CAAC,CAAC;QAC1C,OAAO,KAAK,CAAC,OAAO,KAAK,UAAU,EACnC,CAAC;QACD,OAAO,KAAK,CAAC,OAAO,EAAE,CAAC;IACzB,CAAC;IAED;;;MAGE;IACF,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,MAAM,MAAM,GAAG,EAAE,CAAC;QAClB,KAAK,MAAM,OAAO,IAAI,KAAK,EAAE,CAAC;YAC5B,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC;QAC9C,CAAC;QACD,OAAO,MAAsB,CAAC;IAChC,CAAC;IAED;;;MAGE;IACF,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,IAAA,qBAAS,EAAS,KAAK,CAAC,EAAE,CAAC;QAC1D,MAAM,gBAAgB,qBAAQ,KAAK,CAAE,CAAC;QACtC,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE,CAAC;YAC/C,gBAAwB,CAAC,GAAG,CAAC,GAAG,qBAAqB,CAAE,gBAAwB,CAAC,GAAG,CAAC,CAAC,CAAC;QACzF,CAAC;QACD,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AmqpAnnotatedMessage, Constants } from \"@azure/core-amqp\";\nimport { Buffer } from \"buffer\";\nimport Long from \"long\";\nimport type {\n Delivery,\n DeliveryAnnotations,\n MessageAnnotations,\n Message as RheaMessage,\n} from \"rhea-promise\";\nimport { uuid_to_string } from \"rhea-promise\";\nimport { defaultDataTransformer } from \"./dataTransformer.js\";\nimport { messageLogger as logger } from \"./log.js\";\nimport type { ReceiveMode } from \"./models.js\";\nimport { isDefined, isObjectWithProperties } from \"@azure/core-util\";\nimport { reorderLockToken } from \"./util/utils.js\";\n\n/**\n * @internal\n */\nexport enum DispositionType {\n complete = \"complete\",\n deadletter = \"deadletter\",\n abandon = \"abandon\",\n defer = \"defer\",\n}\n\n/**\n * @internal\n * Describes the delivery annotations for Service Bus.\n */\nexport interface ServiceBusDeliveryAnnotations extends DeliveryAnnotations {\n /**\n * The offset of the last event.\n */\n last_enqueued_offset?: string;\n /**\n * The sequence number of the last event.\n */\n last_enqueued_sequence_number?: number;\n /**\n * The enqueued time of the last event.\n */\n last_enqueued_time_utc?: number;\n /**\n * The retrieval time of the last event.\n */\n runtime_info_retrieval_time_utc?: number;\n /**\n * Any unknown delivery annotations.\n */\n [x: string]: any;\n}\n\n/**\n * @internal\n * Describes the message annotations for Service Bus.\n */\nexport interface ServiceBusMessageAnnotations extends MessageAnnotations {\n /**\n * Annotation for the partition key set for the event.\n */\n \"x-opt-partition-key\"?: string | null;\n /**\n * Annontation for the sequence number of the event.\n */\n \"x-opt-sequence-number\"?: number;\n /**\n * Annotation for the enqueued time of the event.\n */\n \"x-opt-enqueued-time\"?: number;\n /**\n * Annotation for the offset of the event.\n */\n \"x-opt-offset\"?: string;\n /**\n * Annotation for the message being locked until.\n */\n \"x-opt-locked-until\"?: Date | number;\n /**\n * Annotation for the message state.\n */\n \"x-opt-message-state\"?: number;\n}\n\n/**\n * Describes the reason and error description for dead lettering a message using the `deadLetter()`\n * method on the message received from Service Bus.\n */\nexport interface DeadLetterOptions {\n /**\n * The reason for deadlettering the message.\n */\n deadLetterReason: string;\n /**\n * The error description for deadlettering the message.\n */\n deadLetterErrorDescription: string;\n}\n\n/**\n * Describes the message to be sent to Service Bus.\n */\nexport interface ServiceBusMessage {\n /**\n * The message body that needs to be sent or is received.\n * If the application receiving the message is not using this SDK,\n * convert your body payload to a byte array or Buffer for better\n * cross-language compatibility.\n */\n body: any;\n /**\n * The message identifier is an\n * application-defined value that uniquely identifies the message and its payload.\n *\n * Note: Numbers that are not whole integers are not allowed.\n */\n messageId?: string | number | Buffer;\n /**\n * The content type of the message. Optionally describes\n * the payload of the message, with a descriptor following the format of RFC2045, Section 5, for\n * example \"application/json\".\n */\n contentType?: string;\n /**\n * The correlation identifier that allows an\n * application to specify a context for the message for the purposes of correlation, for example\n * reflecting the MessageId of a message that is being replied to.\n * See {@link https://learn.microsoft.com/azure/service-bus-messaging/service-bus-messages-payloads?#message-routing-and-correlation | Message Routing and Correlation}.\n */\n correlationId?: string | number | Buffer;\n /**\n * The partition key for sending a message to a partitioned entity.\n * Maximum length is 128 characters. For {@link https://learn.microsoft.com/azure/service-bus-messaging/service-bus-partitioning | partitioned entities},\n * setting this value enables assigning related messages to the same internal partition,\n * so that submission sequence order is correctly recorded. The partition is chosen by a hash\n * function over this value and cannot be chosen directly.\n * - For session-aware entities, the `sessionId` property overrides this value.\n * - For non partitioned entities, partition key will be ignored\n *\n */\n partitionKey?: string;\n /**\n * The partition key for sending a message into an entity\n * via a partitioned transfer queue. Maximum length is 128 characters. If a message is sent via a\n * transfer queue in the scope of a transaction, this value selects the transfer queue partition:\n * This is functionally equivalent to `partitionKey` property and ensures that messages are kept\n * together and in order as they are transferred.\n * See {@link https://learn.microsoft.com/azure/service-bus-messaging/service-bus-transactions#transfers-and-send-via | Transfers and Send Via}.\n */\n\n // Will be required later for implementing Transactions\n // viaPartitionKey?: string;\n\n /**\n * The session identifier for a session-aware entity. Maximum\n * length is 128 characters. For session-aware entities, this application-defined value specifies\n * the session affiliation of the message. Messages with the same session identifier are subject\n * to summary locking and enable exact in-order processing and demultiplexing. For\n * session-unaware entities, this value is ignored.\n * {@link https://learn.microsoft.com/azure/service-bus-messaging/message-sessions | Message Sessions}.\n */\n sessionId?: string;\n /**\n * The session identifier augmenting the `replyTo` address.\n * Maximum length is 128 characters. This value augments the ReplyTo information and specifies\n * which SessionId should be set for the reply when sent to the reply entity.\n * See {@link https://learn.microsoft.com/azure/service-bus-messaging/service-bus-messages-payloads?#message-routing-and-correlation | Message Routing and Correlation}.\n */\n replyToSessionId?: string;\n /**\n * The message’s time to live value. This value is the relative\n * duration after which the message expires, starting from the instant the message has been\n * accepted and stored by the broker, as captured in `enqueuedTimeUtc`. When not set explicitly,\n * the assumed value is the DefaultTimeToLive for the respective queue or topic. A message-level\n * `timeToLive` value cannot be longer than the entity's DefaultTimeToLive setting and it is\n * silently adjusted if it does. See\n * {@link https://learn.microsoft.com/azure/service-bus-messaging/message-expiration | Expiration}.\n */\n timeToLive?: number;\n /**\n * The application specific label. This property enables the\n * application to indicate the purpose of the message to the receiver in a standardized. fashion,\n * similar to an email subject line. The mapped AMQP property is \"subject\".\n */\n subject?: string;\n /**\n * The \"to\" address. This property is reserved for future use in routing\n * scenarios and presently ignored by the broker itself. Applications can use this value in\n * rule-driven {@link https://learn.microsoft.com/azure/service-bus-messaging/service-bus-auto-forwarding | auto-forward chaining}\n * scenarios to indicate the intended logical destination of the message.\n */\n to?: string;\n /**\n * The address of an entity to send replies to. This optional and\n * application-defined value is a standard way to express a reply path to the receiver of the\n * message. When a sender expects a reply, it sets the value to the absolute or relative path of\n * the queue or topic it expects the reply to be sent to. See\n * {@link https://learn.microsoft.com/azure/service-bus-messaging/service-bus-messages-payloads?#message-routing-and-correlation | Message Routing and Correlation}.\n */\n replyTo?: string;\n /**\n * The date and time in UTC at which the message will\n * be enqueued. This property returns the time in UTC; when setting the property, the\n * supplied DateTime value must also be in UTC. This value is for delayed message sending.\n * It is utilized to delay messages sending to a specific time in the future. Message enqueuing\n * time does not mean that the message will be sent at the same time. It will get enqueued,\n * but the actual sending time depends on the queue's workload and its state.\n */\n scheduledEnqueueTimeUtc?: Date;\n /**\n * The application specific properties which can be\n * used for custom message metadata.\n */\n applicationProperties?: { [key: string]: number | boolean | string | Date | null };\n}\n\n/**\n * @internal\n * Gets the error message for when a property on given message is not of expected type\n */\nexport function getMessagePropertyTypeMismatchError(msg: ServiceBusMessage): Error | undefined {\n if (msg.contentType != null && typeof msg.contentType !== \"string\") {\n return new TypeError(\"The property 'contentType' on the message must be of type 'string'\");\n }\n\n if (msg.subject != null && typeof msg.subject !== \"string\") {\n return new TypeError(\"The property 'label' on the message must be of type 'string'\");\n }\n\n if (msg.to != null && typeof msg.to !== \"string\") {\n return new TypeError(\"The property 'to' on the message must be of type 'string'\");\n }\n\n if (msg.replyTo != null && typeof msg.replyTo !== \"string\") {\n return new TypeError(\"The property 'replyTo' on the message must be of type 'string'\");\n }\n\n if (msg.replyToSessionId != null && typeof msg.replyToSessionId !== \"string\") {\n return new TypeError(\"The property 'replyToSessionId' on the message must be of type 'string'\");\n }\n\n if (msg.timeToLive != null && typeof msg.timeToLive !== \"number\") {\n return new TypeError(\"The property 'timeToLive' on the message must be of type 'number'\");\n }\n\n if (msg.sessionId != null && typeof msg.sessionId !== \"string\") {\n return new TypeError(\"The property 'sessionId' on the message must be of type 'string'\");\n }\n\n if (\n msg.messageId != null &&\n typeof msg.messageId !== \"string\" &&\n typeof msg.messageId !== \"number\" &&\n !Buffer.isBuffer(msg.messageId)\n ) {\n return new TypeError(\n \"The property 'messageId' on the message must be of type string, number or Buffer\",\n );\n }\n\n if (\n msg.correlationId != null &&\n typeof msg.correlationId !== \"string\" &&\n typeof msg.correlationId !== \"number\" &&\n !Buffer.isBuffer(msg.correlationId)\n ) {\n return new TypeError(\n \"The property 'correlationId' on the message must be of type string, number or Buffer\",\n );\n }\n return;\n}\n\n/**\n * @internal\n * Converts given ServiceBusMessage to RheaMessage\n */\nexport function toRheaMessage(\n msg: ServiceBusMessage | ServiceBusReceivedMessage | AmqpAnnotatedMessage,\n encoder: Pick<typeof defaultDataTransformer, \"encode\">,\n): RheaMessage {\n let amqpMsg: RheaMessage;\n if (isAmqpAnnotatedMessage(msg)) {\n amqpMsg = {\n ...AmqpAnnotatedMessage.toRheaMessage(msg),\n body: encoder.encode(msg.body, msg.bodyType ?? \"data\"),\n };\n } else {\n let bodyType: \"data\" | \"sequence\" | \"value\" = \"data\";\n\n if (isServiceBusReceivedMessage(msg)) {\n /*\n * TODO: this is a bit complicated.\n *\n * It seems reasonable to expect to be able to round-trip a message (ie,\n * receive a message, and then send it again, possibly to another queue / topic).\n * If the user does that we need to make sure to respect their original AMQP\n * type so when the message is re - encoded we don't put 'body' into the wrong spot.\n *\n * The complication is that we need to decide if we're okay with respecting a field\n * from the rawAmqpMessage, which up until now we've treated as just vestigial\n * information on send. My hope is that the use case of \"alter the sb message in some\n * incompatible way with the underying _rawAmqpMessage.bodyType\" is not common\n * enough for us to try to do anything more than what I'm doing here.\n */\n bodyType = msg._rawAmqpMessage.bodyType ?? \"data\";\n }\n\n // TODO: it seems sensible that we'd also do this for AMQPAnnotated message.\n const validationError = getMessagePropertyTypeMismatchError(msg);\n\n if (validationError) {\n throw validationError;\n }\n\n amqpMsg = {\n body: encoder.encode(msg.body, bodyType),\n message_annotations: {},\n };\n\n if (msg.timeToLive) {\n amqpMsg.ttl = Math.min(msg.timeToLive, Constants.maxUint32Value);\n amqpMsg.creation_time = new Date();\n amqpMsg.absolute_expiry_time = new Date(\n Math.min(amqpMsg.creation_time.getTime() + amqpMsg.ttl, Constants.maxAbsoluteExpiryTime),\n );\n }\n }\n\n if (isAmqpAnnotatedMessage(msg)) {\n return amqpMsg;\n }\n\n if (msg.applicationProperties != null) {\n amqpMsg.application_properties = msg.applicationProperties;\n }\n if (msg.contentType != null) {\n amqpMsg.content_type = msg.contentType;\n }\n if (msg.sessionId != null) {\n if (msg.sessionId.length > Constants.maxSessionIdLength) {\n throw new Error(\n \"Length of 'sessionId' property on the message cannot be greater than 128 characters.\",\n );\n }\n\n amqpMsg.group_id = msg.sessionId;\n }\n if (msg.replyTo != null) {\n amqpMsg.reply_to = msg.replyTo;\n }\n if (msg.to != null) {\n amqpMsg.to = msg.to;\n }\n if (msg.subject != null) {\n amqpMsg.subject = msg.subject;\n }\n\n updateMessageId(amqpMsg, msg.messageId);\n\n if (msg.correlationId != null) {\n amqpMsg.correlation_id = msg.correlationId;\n }\n if (msg.replyToSessionId != null) {\n amqpMsg.reply_to_group_id = msg.replyToSessionId;\n }\n if (msg.partitionKey != null) {\n if (msg.partitionKey.length > Constants.maxPartitionKeyLength) {\n throw new Error(\n \"Length of 'partitionKey' property on the message cannot be greater than 128 characters.\",\n );\n }\n amqpMsg.message_annotations![Constants.partitionKey] = msg.partitionKey;\n }\n\n // Will be required later for implementing Transactions\n // if (msg.viaPartitionKey != null) {\n // if (msg.viaPartitionKey.length > Constants.maxPartitionKeyLength) {\n // throw new Error(\n // \"Length of 'viaPartitionKey' property on the message cannot be greater than 128 characters.\"\n // );\n // }\n // amqpMsg.message_annotations![Constants.viaPartitionKey] = msg.viaPartitionKey;\n // }\n\n updateScheduledTime(amqpMsg, msg.scheduledEnqueueTimeUtc);\n\n logger.verbose(\"SBMessage to RheaMessage: %O\", amqpMsg);\n return amqpMsg;\n}\n\n/** @internal */\nexport function updateMessageId(\n rheaMessage: RheaMessage,\n messageId: RheaMessage[\"message_id\"],\n): void {\n if (messageId != null) {\n if (typeof messageId === \"string\" && messageId.length > Constants.maxMessageIdLength) {\n throw new Error(\n `Length of 'messageId' property on the message cannot be greater than ${Constants.maxMessageIdLength} characters.`,\n );\n }\n\n rheaMessage.message_id = messageId;\n }\n}\n\n/** @internal */\nexport function updateScheduledTime(\n rheaMessage: RheaMessage,\n scheduledEnqueuedTimeUtc: Date | undefined,\n): void {\n if (scheduledEnqueuedTimeUtc != null) {\n rheaMessage.message_annotations = rheaMessage.message_annotations ?? {};\n rheaMessage.message_annotations[Constants.scheduledEnqueueTime] = scheduledEnqueuedTimeUtc;\n }\n}\n\n/**\n * Describes the message received from Service Bus during peek operations and so cannot be settled.\n */\nexport interface ServiceBusReceivedMessage extends ServiceBusMessage {\n /**\n * The reason for deadlettering the message.\n * @readonly\n */\n readonly deadLetterReason?: string;\n /**\n * The error description for deadlettering the message.\n * @readonly\n */\n readonly deadLetterErrorDescription?: string;\n /**\n * The lock token is a reference to the lock that is being held by the broker in\n * `peekLock` receive mode. Locks are used internally settle messages as explained in the\n * {@link https://learn.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement | product documentation in more detail}\n * - Not applicable when the message is received in `receiveAndDelete` receive mode.\n * mode.\n * @readonly\n */\n readonly lockToken?: string;\n /**\n * Number of deliveries that have been attempted for this message. The count is\n * incremented when a message lock expires, or the message is explicitly abandoned using the\n * `abandon()` method on the message.\n * @readonly\n */\n readonly deliveryCount?: number;\n /**\n * The UTC instant at which the message has been accepted and stored in Service Bus.\n * @readonly\n */\n readonly enqueuedTimeUtc?: Date;\n /**\n * The UTC instant at which the message is marked for removal and no longer available for\n * retrieval from the entity due to expiration. This property is computed from 2 other properties\n * on the message: `enqueuedTimeUtc` + `timeToLive`.\n */\n readonly expiresAtUtc?: Date;\n /**\n * The UTC instant until which the message is held locked in the queue/subscription.\n * When the lock expires, the `deliveryCount` is incremented and the message is again available\n * for retrieval.\n * - Not applicable when the message is received in `receiveAndDelete` receive mode.\n * mode.\n */\n lockedUntilUtc?: Date;\n /**\n * The original sequence number of the message. For\n * messages that have been auto-forwarded, this property reflects the sequence number that had\n * first been assigned to the message at its original point of submission.\n * @readonly\n */\n readonly enqueuedSequenceNumber?: number;\n /**\n * The unique number assigned to a message by Service Bus.\n * The sequence number is a unique 64-bit integer assigned to a message as it is accepted\n * and stored by the broker and functions as its true identifier. For partitioned entities,\n * the topmost 16 bits reflect the partition identifier. Sequence numbers monotonically increase.\n * They roll over to 0 when the 48-64 bit range is exhausted.\n *\n * **Max safe integer** that Javascript currently supports is `2^53 - 1`. The sequence number\n * is an AMQP `Long` type which can be upto 64 bits long. To represent that we are using a\n * library named {@link https://github.com/dcodeIO/long.js | long.js}. We expect customers\n * to use the **`Long`** type exported by this library.\n * @readonly\n */\n readonly sequenceNumber?: Long;\n /**\n * The name of the queue or subscription that this message\n * was enqueued on, before it was deadlettered. Only set in messages that have been dead-lettered\n * and subsequently auto-forwarded from the dead-letter sub-queue to another entity. Indicates the\n * entity in which the message was dead-lettered.\n * @readonly\n */\n readonly deadLetterSource?: string;\n /**\n * State of the message can be active, deferred or scheduled. Deferred messages have deferred state,\n * scheduled messages have scheduled state, all other messages have active state.\n */\n readonly state: \"active\" | \"deferred\" | \"scheduled\";\n /**\n * The underlying raw amqp message.\n * @readonly\n */\n readonly _rawAmqpMessage: AmqpAnnotatedMessage;\n}\n\n/**\n * @internal\n * Converts given RheaMessage to ServiceBusReceivedMessage\n */\nexport function fromRheaMessage(\n rheaMessage: RheaMessage,\n options: {\n skipParsingBodyAsJson: boolean;\n skipConvertingDate?: boolean;\n delivery?: Delivery;\n shouldReorderLockToken?: boolean;\n },\n): ServiceBusReceivedMessage {\n if (!rheaMessage) {\n rheaMessage = {\n body: undefined,\n };\n }\n const {\n skipParsingBodyAsJson,\n delivery,\n shouldReorderLockToken,\n skipConvertingDate = false,\n } = options;\n const { body, bodyType } = defaultDataTransformer.decodeWithType(\n rheaMessage.body,\n skipParsingBodyAsJson,\n );\n\n const sbmsg: ServiceBusMessage = {\n body: body,\n };\n\n if (rheaMessage.application_properties != null) {\n sbmsg.applicationProperties = skipConvertingDate\n ? rheaMessage.application_properties\n : convertDatesToNumbers(rheaMessage.application_properties);\n }\n if (rheaMessage.content_type != null) {\n sbmsg.contentType = rheaMessage.content_type;\n }\n if (rheaMessage.group_id != null) {\n sbmsg.sessionId = rheaMessage.group_id;\n }\n if (rheaMessage.reply_to != null) {\n sbmsg.replyTo = rheaMessage.reply_to;\n }\n if (rheaMessage.to != null) {\n sbmsg.to = rheaMessage.to;\n }\n if (rheaMessage.subject != null) {\n sbmsg.subject = rheaMessage.subject;\n }\n if (rheaMessage.message_id != null) {\n sbmsg.messageId = rheaMessage.message_id;\n }\n if (rheaMessage.correlation_id != null) {\n sbmsg.correlationId = rheaMessage.correlation_id;\n }\n if (rheaMessage.reply_to_group_id != null) {\n sbmsg.replyToSessionId = rheaMessage.reply_to_group_id;\n }\n\n if (rheaMessage.message_annotations != null) {\n if (rheaMessage.message_annotations[Constants.partitionKey] != null) {\n sbmsg.partitionKey = rheaMessage.message_annotations[Constants.partitionKey];\n }\n\n // Will be required later for implementing Transactions\n // if (msg.message_annotations[Constants.viaPartitionKey] != null) {\n // sbmsg.viaPartitionKey = msg.message_annotations[Constants.viaPartitionKey];\n // }\n\n if (rheaMessage.message_annotations[Constants.scheduledEnqueueTime] != null) {\n sbmsg.scheduledEnqueueTimeUtc =\n rheaMessage.message_annotations[Constants.scheduledEnqueueTime];\n }\n }\n\n type PartialWritable<T> = Partial<{\n -readonly [P in keyof T]: T[P];\n }>;\n const props: PartialWritable<ServiceBusReceivedMessage> & {\n state: \"active\" | \"deferred\" | \"scheduled\";\n } = { state: \"active\" };\n if (rheaMessage.message_annotations != null) {\n if (rheaMessage.message_annotations[Constants.deadLetterSource] != null) {\n props.deadLetterSource = rheaMessage.message_annotations[Constants.deadLetterSource];\n }\n const messageState = rheaMessage.message_annotations[Constants.messageState];\n if (messageState === 1) {\n props.state = \"deferred\";\n } else if (messageState === 2) {\n props.state = \"scheduled\";\n }\n if (rheaMessage.message_annotations[Constants.enqueueSequenceNumber] != null) {\n props.enqueuedSequenceNumber =\n rheaMessage.message_annotations[Constants.enqueueSequenceNumber];\n }\n if (rheaMessage.message_annotations[Constants.sequenceNumber] != null) {\n if (Buffer.isBuffer(rheaMessage.message_annotations[Constants.sequenceNumber])) {\n props.sequenceNumber = Long.fromBytesBE(\n rheaMessage.message_annotations[Constants.sequenceNumber],\n );\n } else {\n props.sequenceNumber = Long.fromNumber(\n rheaMessage.message_annotations[Constants.sequenceNumber],\n );\n }\n }\n if (rheaMessage.message_annotations[Constants.enqueuedTime] != null) {\n props.enqueuedTimeUtc = new Date(\n rheaMessage.message_annotations[Constants.enqueuedTime] as number,\n );\n }\n if (rheaMessage.message_annotations[Constants.lockedUntil] != null) {\n props.lockedUntilUtc = new Date(\n rheaMessage.message_annotations[Constants.lockedUntil] as number,\n );\n }\n }\n\n const rawMessage = AmqpAnnotatedMessage.fromRheaMessage(rheaMessage);\n rawMessage.bodyType = bodyType;\n if (rheaMessage.ttl == null) {\n rheaMessage.ttl = rawMessage.header?.timeToLive ?? Constants.maxDurationValue;\n }\n if (props.enqueuedTimeUtc) {\n props.expiresAtUtc = new Date(\n Math.min(props.enqueuedTimeUtc.getTime() + rheaMessage.ttl, Constants.maxDurationValue),\n );\n }\n\n if (rawMessage.applicationProperties) {\n rawMessage.applicationProperties = skipConvertingDate\n ? rawMessage.applicationProperties\n : convertDatesToNumbers(rawMessage.applicationProperties);\n }\n if (rawMessage.deliveryAnnotations) {\n rawMessage.deliveryAnnotations = skipConvertingDate\n ? rawMessage.deliveryAnnotations\n : convertDatesToNumbers(rawMessage.deliveryAnnotations);\n }\n if (rawMessage.messageAnnotations) {\n rawMessage.messageAnnotations = skipConvertingDate\n ? rawMessage.messageAnnotations\n : convertDatesToNumbers(rawMessage.messageAnnotations);\n }\n\n if (rawMessage.header?.timeToLive) {\n sbmsg.timeToLive = rawMessage.header.timeToLive;\n }\n\n const rcvdsbmsg: ServiceBusReceivedMessage = {\n _rawAmqpMessage: rawMessage,\n deliveryCount: rheaMessage.delivery_count,\n lockToken:\n delivery && delivery.tag && delivery.tag.length !== 0\n ? uuid_to_string(\n shouldReorderLockToken === true\n ? reorderLockToken(\n typeof delivery.tag === \"string\" ? Buffer.from(delivery.tag) : delivery.tag,\n )\n : typeof delivery.tag === \"string\"\n ? Buffer.from(delivery.tag)\n : delivery.tag,\n )\n : undefined,\n ...sbmsg,\n ...props,\n deadLetterReason: sbmsg.applicationProperties?.DeadLetterReason as string | undefined,\n deadLetterErrorDescription: sbmsg.applicationProperties?.DeadLetterErrorDescription as\n | string\n | undefined,\n };\n\n logger.verbose(\"AmqpMessage to ServiceBusReceivedMessage: %O\", rcvdsbmsg);\n return rcvdsbmsg;\n}\n\n/**\n * @internal\n */\nexport function isServiceBusMessage(possible: unknown): possible is ServiceBusMessage {\n return isObjectWithProperties(possible, [\"body\"]);\n}\n\n/**\n * @internal\n */\nexport function isAmqpAnnotatedMessage(possible: unknown): possible is AmqpAnnotatedMessage {\n return (\n isObjectWithProperties(possible, [\"body\", \"bodyType\"]) &&\n possible.constructor.name !== ServiceBusMessageImpl.name\n );\n}\n\n/**\n * @internal\n */\nexport function isServiceBusReceivedMessage(\n possible: unknown,\n): possible is ServiceBusReceivedMessage {\n return isServiceBusMessage(possible) && \"_rawAmqpMessage\" in possible;\n}\n\n/**\n * Describes the message received from Service Bus.\n *\n * @internal\n */\nexport class ServiceBusMessageImpl implements ServiceBusReceivedMessage {\n /**\n * The message body that needs to be sent or is received.\n */\n body: any;\n /**\n * The application specific properties.\n */\n applicationProperties?: { [key: string]: any };\n /**\n * The message identifier is an\n * application-defined value that uniquely identifies the message and its payload. The identifier\n * is a free-form string and can reflect a GUID or an identifier derived from the application\n * context. If enabled, the\n * {@link https://learn.microsoft.com/azure/service-bus-messaging/duplicate-detection | duplicate detection}\n * identifies and removes second and further submissions of messages with the same MessageId.\n */\n messageId?: string | number | Buffer;\n /**\n * The content type of the message. Optionally describes\n * the payload of the message, with a descriptor following the format of RFC2045, Section 5, for\n * example \"application/json\".\n */\n contentType?: string;\n /**\n * The correlation identifier that allows an\n * application to specify a context for the message for the purposes of correlation, for example\n * reflecting the MessageId of a message that is being replied to.\n * See {@link https://learn.microsoft.com/azure/service-bus-messaging/service-bus-messages-payloads?#message-routing-and-correlation | Message Routing and Correlation}.\n */\n correlationId?: string | number | Buffer;\n /**\n * The partition key for sending a message to a\n * partitioned entity. Maximum length is 128 characters. For {@link https://learn.microsoft.com/azure/service-bus-messaging/service-bus-partitioning | partitioned entities},\n * setting this value enables assigning related messages to the same internal partition,\n * so that submission sequence order is correctly recorded. The partition is chosen by a hash\n * function over this value and cannot be chosen directly. For session-aware entities,\n * the `sessionId` property overrides this value.\n */\n partitionKey?: string;\n /**\n * The partition key for sending a message into an entity\n * via a partitioned transfer queue. Maximum length is 128 characters. If a message is sent via a\n * transfer queue in the scope of a transaction, this value selects the transfer queue partition:\n * This is functionally equivalent to `partitionKey` property and ensures that messages are kept\n * together and in order as they are transferred.\n * See {@link https://learn.microsoft.com/azure/service-bus-messaging/service-bus-transactions#transfers-and-send-via | Transfers and Send Via}.\n */\n // Will be required later for implementing Transactions\n // viaPartitionKey?: string;\n /**\n * The session identifier for a session-aware entity. Maximum\n * length is 128 characters. For session-aware entities, this application-defined value specifies\n * the session affiliation of the message. Messages with the same session identifier are subject\n * to summary locking and enable exact in-order processing and demultiplexing. For\n * session-unaware entities, this value is ignored.\n * {@link https://learn.microsoft.com/azure/service-bus-messaging/message-sessions | Message Sessions}.\n */\n sessionId?: string;\n /**\n * The session identifier augmenting the `replyTo` address.\n * Maximum length is 128 characters. This value augments the ReplyTo information and specifies\n * which SessionId should be set for the reply when sent to the reply entity.\n * See {@link https://learn.microsoft.com/azure/service-bus-messaging/service-bus-messages-payloads?#message-routing-and-correlation | Message Routing and Correlation}.\n */\n replyToSessionId?: string;\n /**\n * The message’s time to live value. This value is the relative\n * duration after which the message expires, starting from the instant the message has been\n * accepted and stored by the broker, as captured in `enqueuedTimeUtc`. When not set explicitly,\n * the assumed value is the DefaultTimeToLive for the respective queue or topic. A message-level\n * `timeToLive` value cannot be longer than the entity's DefaultTimeToLive setting and it is\n * silently adjusted if it does. See\n * {@link https://learn.microsoft.com/azure/service-bus-messaging/message-expiration | Expiration}.\n */\n timeToLive?: number;\n /**\n * The application specific label. This property enables the\n * application to indicate the purpose of the message to the receiver in a standardized. fashion,\n * similar to an email subject line. The mapped AMQP property is \"subject\".\n */\n subject?: string;\n /**\n * The \"to\" address. This property is reserved for future use in routing\n * scenarios and presently ignored by the broker itself. Applications can use this value in\n * rule-driven {@link https://learn.microsoft.com/azure/service-bus-messaging/service-bus-auto-forwarding | auto-forward chaining}\n * scenarios to indicate the intended logical destination of the message.\n */\n to?: string;\n /**\n * The address of an entity to send replies to. This optional and\n * application-defined value is a standard way to express a reply path to the receiver of the\n * message. When a sender expects a reply, it sets the value to the absolute or relative path of\n * the queue or topic it expects the reply to be sent to. See\n * {@link https://learn.microsoft.com/azure/service-bus-messaging/service-bus-messages-payloads?#message-routing-and-correlation | Message Routing and Correlation}.\n */\n replyTo?: string;\n /**\n * The date and time in UTC at which the message will\n * be enqueued. This property returns the time in UTC; when setting the property, the\n * supplied DateTime value must also be in UTC. This value is for delayed message sending.\n * It is utilized to delay messages sending to a specific time in the future. Message enqueuing\n * time does not mean that the message will be sent at the same time. It will get enqueued,\n * but the actual sending time depends on the queue's workload and its state.\n */\n scheduledEnqueueTimeUtc?: Date;\n /**\n * The lock token is a reference to the lock that is being held by the broker in\n * `peekLock` receive mode. Locks are used internally settle messages as explained in the\n * {@link https://learn.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement | product documentation in more detail}\n * - Not applicable when the message is received in `receiveAndDelete` receive mode.\n * mode.\n * @readonly\n */\n readonly lockToken?: string;\n /**\n * Number of deliveries that have been attempted for this message. The count is\n * incremented when a message lock expires, or the message is explicitly abandoned using the\n * `abandon()` method on the message.\n * @readonly\n */\n readonly deliveryCount?: number;\n /**\n * The UTC instant at which the message has been accepted and stored in Service Bus.\n * @readonly\n */\n readonly enqueuedTimeUtc?: Date;\n /**\n * The UTC instant at which the message is marked for removal and no longer available for\n * retrieval from the entity due to expiration. This property is computed from 2 other properties\n * on the message: `enqueuedTimeUtc` + `timeToLive`.\n */\n readonly expiresAtUtc?: Date;\n /**\n * The UTC instant until which the message is held locked in the queue/subscription.\n * When the lock expires, the `deliveryCount` is incremented and the message is again available\n * for retrieval.\n * - Not applicable when the message is received in `receiveAndDelete` receive mode.\n * mode.\n */\n lockedUntilUtc?: Date;\n /**\n * The original sequence number of the message. For\n * messages that have been auto-forwarded, this property reflects the sequence number that had\n * first been assigned to the message at its original point of submission.\n * @readonly\n */\n readonly enqueuedSequenceNumber?: number;\n /**\n * The unique number assigned to a message by Service Bus.\n * The sequence number is a unique 64-bit integer assigned to a message as it is accepted\n * and stored by the broker and functions as its true identifier. For partitioned entities,\n * the topmost 16 bits reflect the partition identifier. Sequence numbers monotonically increase.\n * They roll over to 0 when the 48-64 bit range is exhausted.\n * @readonly\n */\n readonly sequenceNumber?: Long;\n /**\n * The name of the queue or subscription that this message\n * was enqueued on, before it was deadlettered. Only set in messages that have been dead-lettered\n * and subsequently auto-forwarded from the dead-letter sub-queue to another entity. Indicates the\n * entity in which the message was dead-lettered.\n * @readonly\n */\n readonly deadLetterSource?: string;\n /**\n * State of the message can be active, deferred or scheduled. Deferred messages have deferred state,\n * scheduled messages have scheduled state, all other messages have active state.\n */\n readonly state: \"active\" | \"deferred\" | \"scheduled\";\n /**\n * The associated delivery of the received message.\n */\n readonly delivery: Delivery;\n /**\n * The underlying raw amqp annotated message.\n * @readonly\n */\n readonly _rawAmqpMessage: AmqpAnnotatedMessage;\n /**\n * The reason for deadlettering the message.\n * @readonly\n */\n readonly deadLetterReason?: string;\n /**\n * The error description for deadlettering the message.\n * @readonly\n */\n readonly deadLetterErrorDescription?: string;\n /**\n * @internal\n */\n constructor(\n msg: RheaMessage,\n delivery: Delivery,\n shouldReorderLockToken: boolean,\n receiveMode: ReceiveMode,\n skipParsingBodyAsJson: boolean,\n skipConvertingDate: boolean,\n ) {\n const { _rawAmqpMessage, ...restOfMessageProps } = fromRheaMessage(\n msg,\n\n { skipParsingBodyAsJson, delivery, shouldReorderLockToken, skipConvertingDate },\n );\n this._rawAmqpMessage = _rawAmqpMessage; // need to initialize _rawAmqpMessage property to make compiler happy\n Object.assign(this, restOfMessageProps);\n this.state = restOfMessageProps.state; // to suppress error TS2564: Property 'state' has no initializer and is not definitely assigned in the constructor.\n\n // Lock on a message is applicable only in peekLock mode, but the service sets\n // the lock token even in receiveAndDelete mode if the entity in question is partitioned.\n if (receiveMode === \"receiveAndDelete\") {\n this.lockToken = undefined;\n }\n this.delivery = delivery;\n }\n\n /**\n * Creates a clone of the current message to allow it to be re-sent to the queue\n * @returns ServiceBusMessage\n */\n clone(): ServiceBusMessage {\n // We are returning a ServiceBusMessage object because that object can then be sent to Service Bus\n const clone: ServiceBusMessage = {\n body: this.body,\n contentType: this.contentType,\n correlationId: this.correlationId,\n subject: this.subject,\n messageId: this.messageId,\n partitionKey: this.partitionKey,\n replyTo: this.replyTo,\n replyToSessionId: this.replyToSessionId,\n scheduledEnqueueTimeUtc: this.scheduledEnqueueTimeUtc,\n sessionId: this.sessionId,\n timeToLive: this.timeToLive,\n to: this.to,\n applicationProperties: this.applicationProperties,\n // Will be required later for implementing Transactions\n // viaPartitionKey: this.viaPartitionKey\n };\n\n return clone;\n }\n}\n\n/**\n * Converts any Date objects into a number representing date.getTime().\n * Recursively checks for any Date objects in arrays and objects.\n * @internal\n */\nfunction convertDatesToNumbers<T = unknown>(thing: T): T {\n // fast exit\n if (!isDefined(thing)) return thing;\n\n // When 'thing' is a Date, return the number representation\n if (\n typeof thing === \"object\" &&\n isObjectWithProperties(thing, [\"getTime\"]) &&\n typeof thing.getTime === \"function\"\n ) {\n return thing.getTime();\n }\n\n /*\n Examples:\n [0, 'foo', new Date(), { nested: new Date()}]\n */\n if (Array.isArray(thing)) {\n const result = [];\n for (const element of thing) {\n result.push(convertDatesToNumbers(element));\n }\n return result as unknown as T;\n }\n\n /*\n Examples:\n { foo: new Date(), children: { nested: new Date() }}\n */\n if (typeof thing === \"object\" && isDefined<object>(thing)) {\n const thingShallowCopy = { ...thing };\n for (const key of Object.keys(thingShallowCopy)) {\n (thingShallowCopy as any)[key] = convertDatesToNumbers((thingShallowCopy as any)[key]);\n }\n return thingShallowCopy;\n }\n\n return thing;\n}\n"]}
|
|
@@ -274,7 +274,7 @@ export declare const XML_VALUE_MARKER = "_";
|
|
|
274
274
|
export declare const ATOM_METADATA_MARKER = "_";
|
|
275
275
|
/**
|
|
276
276
|
* Known HTTP status codes as documented and referenced in ATOM based management API feature
|
|
277
|
-
* https://
|
|
277
|
+
* https://learn.microsoft.com/dotnet/api/system.net.httpstatuscode?view=netframework-4.8
|
|
278
278
|
* @internal
|
|
279
279
|
*/
|
|
280
280
|
export declare const HttpResponseCodes: {
|
|
@@ -279,7 +279,7 @@ exports.XML_VALUE_MARKER = "_";
|
|
|
279
279
|
exports.ATOM_METADATA_MARKER = "_";
|
|
280
280
|
/**
|
|
281
281
|
* Known HTTP status codes as documented and referenced in ATOM based management API feature
|
|
282
|
-
* https://
|
|
282
|
+
* https://learn.microsoft.com/dotnet/api/system.net.httpstatuscode?view=netframework-4.8
|
|
283
283
|
* @internal
|
|
284
284
|
*/
|
|
285
285
|
exports.HttpResponseCodes = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/util/constants.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC;;GAEG;AACU,QAAA,eAAe,GAAG;IAC7B,IAAI,EAAE,oBAAoB;IAC1B,OAAO,EAAE,QAAQ;CAClB,CAAC;AAEF;;GAEG;AACU,QAAA,yBAAyB,GAAG,KAAK,CAAC;AAE/C;;;;GAIG;AACU,QAAA,uBAAuB,GAAG,GAAG,CAAC;AAE3C;;GAEG;AACU,QAAA,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC;AAElD;;;GAGG;AACU,QAAA,UAAU,GAAG,WAAW,CAAC;AAEtC;;;GAGG;AACU,QAAA,UAAU,GAAG,WAAW,CAAC;AAEtC;;;GAGG;AACU,QAAA,iBAAiB,GAAG,kBAAkB,CAAC;AAEpD;;;GAGG;AACU,QAAA,SAAS,GAAG,UAAU,CAAC;AAEpC;;;GAGG;AACU,QAAA,WAAW,GAAG,YAAY,CAAC;AAExC;;;GAGG;AACU,QAAA,UAAU,GAAG,WAAW,CAAC;AAEtC;;;GAGG;AACU,QAAA,UAAU,GAAG,W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,GAAG,EAAE,YAAY;IACjB,GAAG,EAAE,cAAc;IACnB,GAAG,EAAE,iBAAiB;IACtB,GAAG,EAAE,WAAW;IAChB,GAAG,EAAE,UAAU;IACf,GAAG,EAAE,kBAAkB;IACvB,GAAG,EAAE,eAAe;IACpB,GAAG,EAAE,6BAA6B;IAClC,GAAG,EAAE,UAAU;IACf,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,gBAAgB;IACrB,GAAG,EAAE,oBAAoB;IACzB,GAAG,EAAE,uBAAuB;IAC5B,GAAG,EAAE,mBAAmB;IACxB,GAAG,EAAE,sBAAsB;IAC3B,GAAG,EAAE,4BAA4B;IACjC,GAAG,EAAE,mBAAmB;IACxB,GAAG,EAAE,iBAAiB;IACtB,GAAG,EAAE,qBAAqB;IAC1B,GAAG,EAAE,gBAAgB;IACrB,GAAG,EAAE,YAAY;IACjB,GAAG,EAAE,oBAAoB;IACzB,GAAG,EAAE,gBAAgB;IACrB,GAAG,EAAE,yBAAyB;CAC/B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * @internal\n */\nexport const packageJsonInfo = {\n name: \"@azure/service-bus\",\n version: \"7.10.0\",\n};\n\n/**\n * @internal\n */\nexport const messageDispositionTimeout = 20000;\n\n/**\n * The amount of time in milliseconds that a receiver\n * will wait while draining credits before returning.\n * @internal\n */\nexport const receiveDrainTimeoutInMs = 200;\n\n/**\n * @internal\n */\nexport const max32BitNumber = Math.pow(2, 31) - 1;\n\n/**\n * Queue name identifier\n * @internal\n */\nexport const QUEUE_NAME = \"QueueName\";\n\n/**\n * Topic name identifier\n * @internal\n */\nexport const TOPIC_NAME = \"TopicName\";\n\n/**\n * Subscription name identifier\n * @internal\n */\nexport const SUBSCRIPTION_NAME = \"SubscriptionName\";\n\n/**\n * Rule name identifier\n * @internal\n */\nexport const RULE_NAME = \"RuleName\";\n\n/**\n * Accessed at field\n * @internal\n */\nexport const ACCESSED_AT = \"AccessedAt\";\n\n/**\n * Updated at field\n * @internal\n */\nexport const UPDATED_AT = \"UpdatedAt\";\n\n/**\n * Created at field\n * @internal\n */\nexport const CREATED_AT = \"CreatedAt\";\n\n/**\n * Authorization rules on the entity\n * @internal\n */\nexport const AUTHORIZATION_RULES = \"AuthorizationRules\";\n\n/**\n * Is Anonymous Accessible field\n * @internal\n */\nexport const IS_ANONYMOUS_ACCESSIBLE = \"IsAnonymousAccessible\";\n\n/**\n * Entity Availability Status field\n * @internal\n */\nexport const ENTITY_AVAILABILITY_STATUS = \"EntityAvailabilityStatus\";\n\n/**\n * Enable express option\n * @internal\n */\nexport const ENABLE_EXPRESS = \"EnableExpress\";\n\n/**\n * Is express option\n * @internal\n */\nexport const IS_EXPRESS = \"IsExpress\";\n\n/**\n * Enable Subscription Partitioning option\n * @internal\n */\nexport const ENABLE_SUBSCRIPTION_PARTITIONING = \"EnableSubscriptionPartitioning\";\n\n/**\n * Filtering Messages Before Publishing option\n * @internal\n */\nexport const FILTER_MESSAGES_BEFORE_PUBLISHING = \"FilteringMessagesBeforePublishing\";\n\n/**\n * The entity's size in bytes.\n *\n * @internal\n */\nexport const SIZE_IN_BYTES = \"SizeInBytes\";\n\n/**\n * The entity's message count.\n *\n * @internal\n */\nexport const MESSAGE_COUNT = \"MessageCount\";\n\n/**\n * The topic's subscription count.\n *\n * @internal\n */\nexport const SUBSCRIPTION_COUNT = \"SubscriptionCount\";\n\n/**\n * The topic / subscription's count details.\n *\n * @internal\n */\nexport const COUNT_DETAILS = \"CountDetails\";\n\n/**\n * The default rule name.\n *\n * @internal\n */\nexport const DEFAULT_RULE_NAME = \"$Default\";\n\n/**\n * Max idle time before entity is deleted.\n * This is specified in ISO-8601 duration format such as \"PT1M\" for 1 minute, \"PT5S\" for 5 seconds.\n * @internal\n */\nexport const AUTO_DELETE_ON_IDLE = \"AutoDeleteOnIdle\";\n\n/**\n * The status information on response\n *\n * @internal\n */\nexport const STATUS = \"Status\";\n\n/**\n * The URL of Service Bus entity to forward messages to.\n *\n * @internal\n */\nexport const FORWARD_TO = \"ForwardTo\";\n\n/**\n * The user meta data information\n *\n * @internal\n */\nexport const USER_METADATA = \"UserMetadata\";\n\n/**\n * The maximum size in megabytes.\n *\n * @internal\n */\nexport const MAX_SIZE_IN_MEGABYTES = \"MaxSizeInMegabytes\";\n/**\n * The maximum size in kilobytes.\n *\n * @internal\n */\nexport const MAX_MESSAGE_SIZE_IN_KILOBYTES = \"MaxMessageSizeInKilobytes\";\n/**\n * The default message time to live.\n * This is specified in ISO-8601 duration format such as \"PT1M\" for 1 minute, \"PT5S\" for 5 seconds.\n * @internal\n */\nexport const DEFAULT_MESSAGE_TIME_TO_LIVE = \"DefaultMessageTimeToLive\";\n\n/**\n * The lock duration.\n * This is specified in ISO-8601 duration format such as \"PT1M\" for 1 minute, \"PT5S\" for 5 seconds.\n * @internal\n */\nexport const LOCK_DURATION = \"LockDuration\";\n\n/**\n * The indication if session is required or not.\n *\n * @internal\n */\nexport const REQUIRES_SESSION = \"RequiresSession\";\n\n/**\n * The indication if duplicate detection is required or not.\n *\n * @internal\n */\nexport const REQUIRES_DUPLICATE_DETECTION = \"RequiresDuplicateDetection\";\n\n/**\n * The indication if dead lettering on message expiration. If it is enabled and a message expires,\n * the Service Bus moves the message from the queue into the entity dead-letter sub-queue.\n * If disabled, message will be permanently deleted from the main entity.\n * Settable only at entity creation time.\n *\n * @internal\n */\nexport const DEAD_LETTERING_ON_MESSAGE_EXPIRATION = \"DeadLetteringOnMessageExpiration\";\n\n/**\n * The indication if dead lettering on filter evaluation exceptions.\n *\n * @internal\n */\nexport const DEAD_LETTERING_ON_FILTER_EVALUATION_EXCEPTIONS =\n \"DeadLetteringOnFilterEvaluationExceptions\";\n\n/**\n * The history time window for duplicate detection.\n * This is specified in ISO-8601 duration format such as \"PT1M\" for 1 minute, \"PT5S\" for 5 seconds.\n * @internal\n */\nexport const DUPLICATE_DETECTION_HISTORY_TIME_WINDOW = \"DuplicateDetectionHistoryTimeWindow\";\n\n/**\n * The maximum delivery count of messages after which if it is still not settled, gets moved to the dead-letter sub-queue.\n *\n * @internal\n */\nexport const MAX_DELIVERY_COUNT = \"MaxDeliveryCount\";\n\n/**\n * Indicates if the queue has enabled batch operations.\n *\n * @internal\n */\nexport const ENABLE_BATCHED_OPERATIONS = \"EnableBatchedOperations\";\n\n/**\n * Indicates whether the topic can be ordered\n *\n * @internal\n */\nexport const SUPPORT_ORDERING = \"SupportOrdering\";\n\n/**\n * Indicates whether the topic/queue should be split across multiple partitions\n *\n * @internal\n */\nexport const ENABLE_PARTITIONING = \"EnablePartitioning\";\n\n/**\n * The URL of Service Bus entity to forward deadlettered messages to.\n *\n * @internal\n */\nexport const FORWARD_DEADLETTERED_MESSAGES_TO = \"ForwardDeadLetteredMessagesTo\";\n\n/**\n * Query string parameter to set Service Bus API version\n *\n * @internal\n */\nexport const API_VERSION_QUERY_KEY = \"api-version\";\n\n/**\n * Current API version being sent to service bus\n *\n * @internal\n */\nexport const CURRENT_API_VERSION = \"2021-05\";\n\n/**\n * Constant representing the Odata Error 'message' property\n *\n * @internal\n */\nexport const ODATA_ERROR_MESSAGE = \"message\";\n/**\n * Constant representing the 'value' property of Odata Error 'message' property\n *\n * @internal\n */\nexport const ODATA_ERROR_MESSAGE_VALUE = \"value\";\n\n/**\n * Marker for atom metadata.\n *\n * @internal\n */\nexport const XML_METADATA_MARKER = \"$\";\n\n/**\n * Marker for atom value.\n *\n * @internal\n */\nexport const XML_VALUE_MARKER = \"_\";\n\n/**\n * Constant representing the property where the atom default elements are stored.\n *\n * @internal\n */\nexport const ATOM_METADATA_MARKER = \"_\";\n\n/**\n * Known HTTP status codes as documented and referenced in ATOM based management API feature\n * https://docs.microsoft.com/dotnet/api/system.net.httpstatuscode?view=netframework-4.8\n * @internal\n */\nexport const HttpResponseCodes = {\n 100: \"Continue\",\n 101: \"SwitchingProtocols\",\n 200: \"Ok\",\n 201: \"Created\",\n 202: \"Accepted\",\n 203: \"NonAuthoritativeInformation\",\n 204: \"NoContent\",\n 205: \"ResetContent\",\n 206: \"PartialContent\",\n 300: \"MultipleChoices\",\n 301: \"Moved\",\n 302: \"Redirect\",\n 303: \"RedirectMethod\",\n 304: \"NotModified\",\n 305: \"UseProxy\",\n 306: \"Unused\",\n 400: \"BadRequest\",\n 401: \"Unauthorized\",\n 402: \"PaymentRequired\",\n 403: \"Forbidden\",\n 404: \"NotFound\",\n 405: \"MethodNotAllowed\",\n 406: \"NotAcceptable\",\n 407: \"ProxyAuthenticationRequired\",\n 409: \"Conflict\",\n 410: \"Gone\",\n 411: \"LengthRequired\",\n 412: \"PreconditionFailed\",\n 413: \"RequestEntityTooLarge\",\n 414: \"RequestUriTooLong\",\n 415: \"UnsupportedMediaType\",\n 416: \"RequestRangeNotSatisfiable\",\n 417: \"ExpectationFailed\",\n 426: \"UpgradeRequired\",\n 500: \"InternalServerError\",\n 501: \"NotImplemented\",\n 502: \"BadGateway\",\n 503: \"ServiceUnavailable\",\n 504: \"GatewayTimeout\",\n 505: \"HttpVersionNotSupported\",\n};\n"]}
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/util/constants.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC;;GAEG;AACU,QAAA,eAAe,GAAG;IAC7B,IAAI,EAAE,oBAAoB;IAC1B,OAAO,EAAE,QAAQ;CAClB,CAAC;AAEF;;GAEG;AACU,QAAA,yBAAyB,GAAG,KAAK,CAAC;AAE/C;;;;GAIG;AACU,QAAA,uBAAuB,GAAG,GAAG,CAAC;AAE3C;;GAEG;AACU,QAAA,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC;AAElD;;;GAGG;AACU,QAAA,UAAU,GAAG,WAAW,CAAC;AAEtC;;;GAGG;AACU,QAAA,UAAU,GAAG,WAAW,CAAC;AAEtC;;;GAGG;AACU,QAAA,iBAAiB,GAAG,kBAAkB,CAAC;AAEpD;;;GAGG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IACrB,GAAG,EAAE,iBAAiB;IACtB,GAAG,EAAE,OAAO;IACZ,GAAG,EAAE,UAAU;IACf,GAAG,EAAE,gBAAgB;IACrB,GAAG,EAAE,aAAa;IAClB,GAAG,EAAE,UAAU;IACf,GAAG,EAAE,QAAQ;IACb,GAAG,EAAE,YAAY;IACjB,GAAG,EAAE,cAAc;IACnB,GAAG,EAAE,iBAAiB;IACtB,GAAG,EAAE,WAAW;IAChB,GAAG,EAAE,UAAU;IACf,GAAG,EAAE,kBAAkB;IACvB,GAAG,EAAE,eAAe;IACpB,GAAG,EAAE,6BAA6B;IAClC,GAAG,EAAE,UAAU;IACf,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,gBAAgB;IACrB,GAAG,EAAE,oBAAoB;IACzB,GAAG,EAAE,uBAAuB;IAC5B,GAAG,EAAE,mBAAmB;IACxB,GAAG,EAAE,sBAAsB;IAC3B,GAAG,EAAE,4BAA4B;IACjC,GAAG,EAAE,mBAAmB;IACxB,GAAG,EAAE,iBAAiB;IACtB,GAAG,EAAE,qBAAqB;IAC1B,GAAG,EAAE,gBAAgB;IACrB,GAAG,EAAE,YAAY;IACjB,GAAG,EAAE,oBAAoB;IACzB,GAAG,EAAE,gBAAgB;IACrB,GAAG,EAAE,yBAAyB;CAC/B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * @internal\n */\nexport const packageJsonInfo = {\n name: \"@azure/service-bus\",\n version: \"7.10.0\",\n};\n\n/**\n * @internal\n */\nexport const messageDispositionTimeout = 20000;\n\n/**\n * The amount of time in milliseconds that a receiver\n * will wait while draining credits before returning.\n * @internal\n */\nexport const receiveDrainTimeoutInMs = 200;\n\n/**\n * @internal\n */\nexport const max32BitNumber = Math.pow(2, 31) - 1;\n\n/**\n * Queue name identifier\n * @internal\n */\nexport const QUEUE_NAME = \"QueueName\";\n\n/**\n * Topic name identifier\n * @internal\n */\nexport const TOPIC_NAME = \"TopicName\";\n\n/**\n * Subscription name identifier\n * @internal\n */\nexport const SUBSCRIPTION_NAME = \"SubscriptionName\";\n\n/**\n * Rule name identifier\n * @internal\n */\nexport const RULE_NAME = \"RuleName\";\n\n/**\n * Accessed at field\n * @internal\n */\nexport const ACCESSED_AT = \"AccessedAt\";\n\n/**\n * Updated at field\n * @internal\n */\nexport const UPDATED_AT = \"UpdatedAt\";\n\n/**\n * Created at field\n * @internal\n */\nexport const CREATED_AT = \"CreatedAt\";\n\n/**\n * Authorization rules on the entity\n * @internal\n */\nexport const AUTHORIZATION_RULES = \"AuthorizationRules\";\n\n/**\n * Is Anonymous Accessible field\n * @internal\n */\nexport const IS_ANONYMOUS_ACCESSIBLE = \"IsAnonymousAccessible\";\n\n/**\n * Entity Availability Status field\n * @internal\n */\nexport const ENTITY_AVAILABILITY_STATUS = \"EntityAvailabilityStatus\";\n\n/**\n * Enable express option\n * @internal\n */\nexport const ENABLE_EXPRESS = \"EnableExpress\";\n\n/**\n * Is express option\n * @internal\n */\nexport const IS_EXPRESS = \"IsExpress\";\n\n/**\n * Enable Subscription Partitioning option\n * @internal\n */\nexport const ENABLE_SUBSCRIPTION_PARTITIONING = \"EnableSubscriptionPartitioning\";\n\n/**\n * Filtering Messages Before Publishing option\n * @internal\n */\nexport const FILTER_MESSAGES_BEFORE_PUBLISHING = \"FilteringMessagesBeforePublishing\";\n\n/**\n * The entity's size in bytes.\n *\n * @internal\n */\nexport const SIZE_IN_BYTES = \"SizeInBytes\";\n\n/**\n * The entity's message count.\n *\n * @internal\n */\nexport const MESSAGE_COUNT = \"MessageCount\";\n\n/**\n * The topic's subscription count.\n *\n * @internal\n */\nexport const SUBSCRIPTION_COUNT = \"SubscriptionCount\";\n\n/**\n * The topic / subscription's count details.\n *\n * @internal\n */\nexport const COUNT_DETAILS = \"CountDetails\";\n\n/**\n * The default rule name.\n *\n * @internal\n */\nexport const DEFAULT_RULE_NAME = \"$Default\";\n\n/**\n * Max idle time before entity is deleted.\n * This is specified in ISO-8601 duration format such as \"PT1M\" for 1 minute, \"PT5S\" for 5 seconds.\n * @internal\n */\nexport const AUTO_DELETE_ON_IDLE = \"AutoDeleteOnIdle\";\n\n/**\n * The status information on response\n *\n * @internal\n */\nexport const STATUS = \"Status\";\n\n/**\n * The URL of Service Bus entity to forward messages to.\n *\n * @internal\n */\nexport const FORWARD_TO = \"ForwardTo\";\n\n/**\n * The user meta data information\n *\n * @internal\n */\nexport const USER_METADATA = \"UserMetadata\";\n\n/**\n * The maximum size in megabytes.\n *\n * @internal\n */\nexport const MAX_SIZE_IN_MEGABYTES = \"MaxSizeInMegabytes\";\n/**\n * The maximum size in kilobytes.\n *\n * @internal\n */\nexport const MAX_MESSAGE_SIZE_IN_KILOBYTES = \"MaxMessageSizeInKilobytes\";\n/**\n * The default message time to live.\n * This is specified in ISO-8601 duration format such as \"PT1M\" for 1 minute, \"PT5S\" for 5 seconds.\n * @internal\n */\nexport const DEFAULT_MESSAGE_TIME_TO_LIVE = \"DefaultMessageTimeToLive\";\n\n/**\n * The lock duration.\n * This is specified in ISO-8601 duration format such as \"PT1M\" for 1 minute, \"PT5S\" for 5 seconds.\n * @internal\n */\nexport const LOCK_DURATION = \"LockDuration\";\n\n/**\n * The indication if session is required or not.\n *\n * @internal\n */\nexport const REQUIRES_SESSION = \"RequiresSession\";\n\n/**\n * The indication if duplicate detection is required or not.\n *\n * @internal\n */\nexport const REQUIRES_DUPLICATE_DETECTION = \"RequiresDuplicateDetection\";\n\n/**\n * The indication if dead lettering on message expiration. If it is enabled and a message expires,\n * the Service Bus moves the message from the queue into the entity dead-letter sub-queue.\n * If disabled, message will be permanently deleted from the main entity.\n * Settable only at entity creation time.\n *\n * @internal\n */\nexport const DEAD_LETTERING_ON_MESSAGE_EXPIRATION = \"DeadLetteringOnMessageExpiration\";\n\n/**\n * The indication if dead lettering on filter evaluation exceptions.\n *\n * @internal\n */\nexport const DEAD_LETTERING_ON_FILTER_EVALUATION_EXCEPTIONS =\n \"DeadLetteringOnFilterEvaluationExceptions\";\n\n/**\n * The history time window for duplicate detection.\n * This is specified in ISO-8601 duration format such as \"PT1M\" for 1 minute, \"PT5S\" for 5 seconds.\n * @internal\n */\nexport const DUPLICATE_DETECTION_HISTORY_TIME_WINDOW = \"DuplicateDetectionHistoryTimeWindow\";\n\n/**\n * The maximum delivery count of messages after which if it is still not settled, gets moved to the dead-letter sub-queue.\n *\n * @internal\n */\nexport const MAX_DELIVERY_COUNT = \"MaxDeliveryCount\";\n\n/**\n * Indicates if the queue has enabled batch operations.\n *\n * @internal\n */\nexport const ENABLE_BATCHED_OPERATIONS = \"EnableBatchedOperations\";\n\n/**\n * Indicates whether the topic can be ordered\n *\n * @internal\n */\nexport const SUPPORT_ORDERING = \"SupportOrdering\";\n\n/**\n * Indicates whether the topic/queue should be split across multiple partitions\n *\n * @internal\n */\nexport const ENABLE_PARTITIONING = \"EnablePartitioning\";\n\n/**\n * The URL of Service Bus entity to forward deadlettered messages to.\n *\n * @internal\n */\nexport const FORWARD_DEADLETTERED_MESSAGES_TO = \"ForwardDeadLetteredMessagesTo\";\n\n/**\n * Query string parameter to set Service Bus API version\n *\n * @internal\n */\nexport const API_VERSION_QUERY_KEY = \"api-version\";\n\n/**\n * Current API version being sent to service bus\n *\n * @internal\n */\nexport const CURRENT_API_VERSION = \"2021-05\";\n\n/**\n * Constant representing the Odata Error 'message' property\n *\n * @internal\n */\nexport const ODATA_ERROR_MESSAGE = \"message\";\n/**\n * Constant representing the 'value' property of Odata Error 'message' property\n *\n * @internal\n */\nexport const ODATA_ERROR_MESSAGE_VALUE = \"value\";\n\n/**\n * Marker for atom metadata.\n *\n * @internal\n */\nexport const XML_METADATA_MARKER = \"$\";\n\n/**\n * Marker for atom value.\n *\n * @internal\n */\nexport const XML_VALUE_MARKER = \"_\";\n\n/**\n * Constant representing the property where the atom default elements are stored.\n *\n * @internal\n */\nexport const ATOM_METADATA_MARKER = \"_\";\n\n/**\n * Known HTTP status codes as documented and referenced in ATOM based management API feature\n * https://learn.microsoft.com/dotnet/api/system.net.httpstatuscode?view=netframework-4.8\n * @internal\n */\nexport const HttpResponseCodes = {\n 100: \"Continue\",\n 101: \"SwitchingProtocols\",\n 200: \"Ok\",\n 201: \"Created\",\n 202: \"Accepted\",\n 203: \"NonAuthoritativeInformation\",\n 204: \"NoContent\",\n 205: \"ResetContent\",\n 206: \"PartialContent\",\n 300: \"MultipleChoices\",\n 301: \"Moved\",\n 302: \"Redirect\",\n 303: \"RedirectMethod\",\n 304: \"NotModified\",\n 305: \"UseProxy\",\n 306: \"Unused\",\n 400: \"BadRequest\",\n 401: \"Unauthorized\",\n 402: \"PaymentRequired\",\n 403: \"Forbidden\",\n 404: \"NotFound\",\n 405: \"MethodNotAllowed\",\n 406: \"NotAcceptable\",\n 407: \"ProxyAuthenticationRequired\",\n 409: \"Conflict\",\n 410: \"Gone\",\n 411: \"LengthRequired\",\n 412: \"PreconditionFailed\",\n 413: \"RequestEntityTooLarge\",\n 414: \"RequestUriTooLong\",\n 415: \"UnsupportedMediaType\",\n 416: \"RequestRangeNotSatisfiable\",\n 417: \"ExpectationFailed\",\n 426: \"UpgradeRequired\",\n 500: \"InternalServerError\",\n 501: \"NotImplemented\",\n 502: \"BadGateway\",\n 503: \"ServiceUnavailable\",\n 504: \"GatewayTimeout\",\n 505: \"HttpVersionNotSupported\",\n};\n"]}
|
|
@@ -872,7 +872,7 @@ export class ManagementClient extends LinkEntity {
|
|
|
872
872
|
!Array.isArray(response.body.rules)) {
|
|
873
873
|
return [];
|
|
874
874
|
}
|
|
875
|
-
// Reference: https://
|
|
875
|
+
// Reference: https://learn.microsoft.com/azure/service-bus-messaging/service-bus-amqp-request-response#response-11
|
|
876
876
|
const result = response.body.rules || [];
|
|
877
877
|
const rules = [];
|
|
878
878
|
result.forEach((x) => {
|