rocketmq-client-nodejs-bate 1.0.12

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.
Files changed (209) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +186 -0
  3. package/dist/client/BaseClient.d.ts +95 -0
  4. package/dist/client/BaseClient.js +324 -0
  5. package/dist/client/ClientId.d.ts +24 -0
  6. package/dist/client/ClientId.js +33 -0
  7. package/dist/client/Logger.d.ts +25 -0
  8. package/dist/client/Logger.js +33 -0
  9. package/dist/client/RpcClient.d.ts +48 -0
  10. package/dist/client/RpcClient.js +219 -0
  11. package/dist/client/RpcClientManager.d.ts +42 -0
  12. package/dist/client/RpcClientManager.js +144 -0
  13. package/dist/client/SessionCredentials.d.ts +21 -0
  14. package/dist/client/SessionCredentials.js +19 -0
  15. package/dist/client/Settings.d.ts +31 -0
  16. package/dist/client/Settings.js +40 -0
  17. package/dist/client/TelemetrySession.d.ts +27 -0
  18. package/dist/client/TelemetrySession.js +110 -0
  19. package/dist/client/UserAgent.d.ts +25 -0
  20. package/dist/client/UserAgent.js +47 -0
  21. package/dist/client/index.d.ts +26 -0
  22. package/dist/client/index.js +43 -0
  23. package/dist/consumer/Assignment.d.ts +23 -0
  24. package/dist/consumer/Assignment.js +40 -0
  25. package/dist/consumer/Assignments.d.ts +24 -0
  26. package/dist/consumer/Assignments.js +47 -0
  27. package/dist/consumer/ConsumeResult.d.ts +20 -0
  28. package/dist/consumer/ConsumeResult.js +25 -0
  29. package/dist/consumer/ConsumeService.d.ts +28 -0
  30. package/dist/consumer/ConsumeService.js +49 -0
  31. package/dist/consumer/ConsumeTask.d.ts +24 -0
  32. package/dist/consumer/ConsumeTask.js +40 -0
  33. package/dist/consumer/Consumer.d.ts +38 -0
  34. package/dist/consumer/Consumer.js +111 -0
  35. package/dist/consumer/FifoConsumeService.d.ts +25 -0
  36. package/dist/consumer/FifoConsumeService.js +123 -0
  37. package/dist/consumer/FilterExpression.d.ts +25 -0
  38. package/dist/consumer/FilterExpression.js +40 -0
  39. package/dist/consumer/MessageListener.d.ts +21 -0
  40. package/dist/consumer/MessageListener.js +19 -0
  41. package/dist/consumer/ProcessQueue.d.ts +39 -0
  42. package/dist/consumer/ProcessQueue.js +286 -0
  43. package/dist/consumer/PushConsumer.d.ts +68 -0
  44. package/dist/consumer/PushConsumer.js +377 -0
  45. package/dist/consumer/PushSubscriptionSettings.d.ts +31 -0
  46. package/dist/consumer/PushSubscriptionSettings.js +97 -0
  47. package/dist/consumer/SimpleConsumer.d.ts +50 -0
  48. package/dist/consumer/SimpleConsumer.js +122 -0
  49. package/dist/consumer/SimpleSubscriptionSettings.d.ts +28 -0
  50. package/dist/consumer/SimpleSubscriptionSettings.js +57 -0
  51. package/dist/consumer/StandardConsumeService.d.ts +24 -0
  52. package/dist/consumer/StandardConsumeService.js +42 -0
  53. package/dist/consumer/SubscriptionLoadBalancer.d.ts +23 -0
  54. package/dist/consumer/SubscriptionLoadBalancer.js +46 -0
  55. package/dist/consumer/index.d.ts +32 -0
  56. package/dist/consumer/index.js +49 -0
  57. package/dist/exception/BadRequestException.d.ts +20 -0
  58. package/dist/exception/BadRequestException.js +28 -0
  59. package/dist/exception/ClientException.d.ts +20 -0
  60. package/dist/exception/ClientException.js +31 -0
  61. package/dist/exception/ForbiddenException.d.ts +20 -0
  62. package/dist/exception/ForbiddenException.js +28 -0
  63. package/dist/exception/InternalErrorException.d.ts +20 -0
  64. package/dist/exception/InternalErrorException.js +28 -0
  65. package/dist/exception/NotFoundException.d.ts +20 -0
  66. package/dist/exception/NotFoundException.js +28 -0
  67. package/dist/exception/PayloadTooLargeException.d.ts +20 -0
  68. package/dist/exception/PayloadTooLargeException.js +28 -0
  69. package/dist/exception/PaymentRequiredException.d.ts +20 -0
  70. package/dist/exception/PaymentRequiredException.js +28 -0
  71. package/dist/exception/ProxyTimeoutException.d.ts +20 -0
  72. package/dist/exception/ProxyTimeoutException.js +28 -0
  73. package/dist/exception/RequestHeaderFieldsTooLargeException.d.ts +20 -0
  74. package/dist/exception/RequestHeaderFieldsTooLargeException.js +28 -0
  75. package/dist/exception/StatusChecker.d.ts +20 -0
  76. package/dist/exception/StatusChecker.js +98 -0
  77. package/dist/exception/TooManyRequestsException.d.ts +20 -0
  78. package/dist/exception/TooManyRequestsException.js +28 -0
  79. package/dist/exception/UnauthorizedException.d.ts +20 -0
  80. package/dist/exception/UnauthorizedException.js +28 -0
  81. package/dist/exception/UnsupportedException.d.ts +20 -0
  82. package/dist/exception/UnsupportedException.js +28 -0
  83. package/dist/exception/index.d.ts +29 -0
  84. package/dist/exception/index.js +46 -0
  85. package/dist/index.d.ts +22 -0
  86. package/dist/index.js +39 -0
  87. package/dist/message/Message.d.ts +38 -0
  88. package/dist/message/Message.js +57 -0
  89. package/dist/message/MessageId.d.ts +59 -0
  90. package/dist/message/MessageId.js +123 -0
  91. package/dist/message/MessageView.d.ts +38 -0
  92. package/dist/message/MessageView.js +90 -0
  93. package/dist/message/PublishingMessage.d.ts +30 -0
  94. package/dist/message/PublishingMessage.js +100 -0
  95. package/dist/message/index.d.ts +20 -0
  96. package/dist/message/index.js +37 -0
  97. package/dist/producer/Producer.d.ts +55 -0
  98. package/dist/producer/Producer.js +318 -0
  99. package/dist/producer/PublishingLoadBalancer.d.ts +24 -0
  100. package/dist/producer/PublishingLoadBalancer.js +82 -0
  101. package/dist/producer/PublishingSettings.d.ts +28 -0
  102. package/dist/producer/PublishingSettings.js +70 -0
  103. package/dist/producer/RecallReceipt.d.ts +25 -0
  104. package/dist/producer/RecallReceipt.js +34 -0
  105. package/dist/producer/SendReceipt.d.ts +29 -0
  106. package/dist/producer/SendReceipt.js +60 -0
  107. package/dist/producer/Transaction.d.ts +28 -0
  108. package/dist/producer/Transaction.js +70 -0
  109. package/dist/producer/TransactionChecker.d.ts +21 -0
  110. package/dist/producer/TransactionChecker.js +19 -0
  111. package/dist/producer/index.d.ts +22 -0
  112. package/dist/producer/index.js +40 -0
  113. package/dist/retry/ExponentialBackoffRetryPolicy.d.ts +27 -0
  114. package/dist/retry/ExponentialBackoffRetryPolicy.js +64 -0
  115. package/dist/retry/RetryPolicy.d.ts +46 -0
  116. package/dist/retry/RetryPolicy.js +19 -0
  117. package/dist/retry/index.d.ts +18 -0
  118. package/dist/retry/index.js +35 -0
  119. package/dist/route/Broker.d.ts +25 -0
  120. package/dist/route/Broker.js +40 -0
  121. package/dist/route/Endpoints.d.ts +30 -0
  122. package/dist/route/Endpoints.js +71 -0
  123. package/dist/route/MessageQueue.d.ts +27 -0
  124. package/dist/route/MessageQueue.js +47 -0
  125. package/dist/route/TopicRouteData.d.ts +24 -0
  126. package/dist/route/TopicRouteData.js +37 -0
  127. package/dist/route/index.d.ts +20 -0
  128. package/dist/route/index.js +37 -0
  129. package/dist/util/index.d.ts +35 -0
  130. package/dist/util/index.js +88 -0
  131. package/package.json +62 -0
  132. package/proto/apache/rocketmq/v2/admin.proto +43 -0
  133. package/proto/apache/rocketmq/v2/admin_grpc_pb.d.ts +41 -0
  134. package/proto/apache/rocketmq/v2/admin_grpc_pb.js +60 -0
  135. package/proto/apache/rocketmq/v2/admin_pb.d.ts +56 -0
  136. package/proto/apache/rocketmq/v2/admin_pb.js +340 -0
  137. package/proto/apache/rocketmq/v2/definition.proto +570 -0
  138. package/proto/apache/rocketmq/v2/definition_grpc_pb.js +1 -0
  139. package/proto/apache/rocketmq/v2/definition_pb.d.ts +885 -0
  140. package/proto/apache/rocketmq/v2/definition_pb.js +6141 -0
  141. package/proto/apache/rocketmq/v2/service.proto +443 -0
  142. package/proto/apache/rocketmq/v2/service_grpc_pb.d.ts +294 -0
  143. package/proto/apache/rocketmq/v2/service_grpc_pb.js +637 -0
  144. package/proto/apache/rocketmq/v2/service_pb.d.ts +1249 -0
  145. package/proto/apache/rocketmq/v2/service_pb.js +9723 -0
  146. package/src/client/BaseClient.ts +404 -0
  147. package/src/client/ClientId.ts +31 -0
  148. package/src/client/Logger.ts +36 -0
  149. package/src/client/RpcClient.ts +258 -0
  150. package/src/client/RpcClientManager.ts +180 -0
  151. package/src/client/SessionCredentials.ts +22 -0
  152. package/src/client/Settings.ts +46 -0
  153. package/src/client/TelemetrySession.ts +130 -0
  154. package/src/client/UserAgent.ts +45 -0
  155. package/src/client/index.ts +27 -0
  156. package/src/consumer/Assignment.ts +39 -0
  157. package/src/consumer/Assignments.ts +46 -0
  158. package/src/consumer/ConsumeResult.ts +21 -0
  159. package/src/consumer/ConsumeService.ts +54 -0
  160. package/src/consumer/ConsumeTask.ts +40 -0
  161. package/src/consumer/Consumer.ts +129 -0
  162. package/src/consumer/FifoConsumeService.ts +136 -0
  163. package/src/consumer/FilterExpression.ts +42 -0
  164. package/src/consumer/MessageListener.ts +23 -0
  165. package/src/consumer/ProcessQueue.ts +326 -0
  166. package/src/consumer/PushConsumer.ts +473 -0
  167. package/src/consumer/PushSubscriptionSettings.ts +123 -0
  168. package/src/consumer/SimpleConsumer.ts +153 -0
  169. package/src/consumer/SimpleSubscriptionSettings.ts +64 -0
  170. package/src/consumer/StandardConsumeService.ts +44 -0
  171. package/src/consumer/SubscriptionLoadBalancer.ts +47 -0
  172. package/src/consumer/index.ts +33 -0
  173. package/src/exception/BadRequestException.ts +25 -0
  174. package/src/exception/ClientException.ts +29 -0
  175. package/src/exception/ForbiddenException.ts +25 -0
  176. package/src/exception/InternalErrorException.ts +25 -0
  177. package/src/exception/NotFoundException.ts +25 -0
  178. package/src/exception/PayloadTooLargeException.ts +25 -0
  179. package/src/exception/PaymentRequiredException.ts +25 -0
  180. package/src/exception/ProxyTimeoutException.ts +25 -0
  181. package/src/exception/RequestHeaderFieldsTooLargeException.ts +25 -0
  182. package/src/exception/StatusChecker.ts +94 -0
  183. package/src/exception/TooManyRequestsException.ts +25 -0
  184. package/src/exception/UnauthorizedException.ts +25 -0
  185. package/src/exception/UnsupportedException.ts +25 -0
  186. package/src/exception/index.ts +30 -0
  187. package/src/index.ts +23 -0
  188. package/src/message/Message.ts +67 -0
  189. package/src/message/MessageId.ts +123 -0
  190. package/src/message/MessageView.ts +94 -0
  191. package/src/message/PublishingMessage.ts +104 -0
  192. package/src/message/index.ts +21 -0
  193. package/src/producer/Producer.ts +388 -0
  194. package/src/producer/PublishingLoadBalancer.ts +85 -0
  195. package/src/producer/PublishingSettings.ts +78 -0
  196. package/src/producer/RecallReceipt.ts +32 -0
  197. package/src/producer/SendReceipt.ts +63 -0
  198. package/src/producer/Transaction.ts +86 -0
  199. package/src/producer/TransactionChecker.ts +23 -0
  200. package/src/producer/index.ts +24 -0
  201. package/src/retry/ExponentialBackoffRetryPolicy.ts +76 -0
  202. package/src/retry/RetryPolicy.ts +51 -0
  203. package/src/retry/index.ts +19 -0
  204. package/src/route/Broker.ts +39 -0
  205. package/src/route/Endpoints.ts +70 -0
  206. package/src/route/MessageQueue.ts +49 -0
  207. package/src/route/TopicRouteData.ts +38 -0
  208. package/src/route/index.ts +21 -0
  209. package/src/util/index.ts +83 -0
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ /**
3
+ * Licensed to the Apache Software Foundation (ASF) under one or more
4
+ * contributor license agreements. See the NOTICE file distributed with
5
+ * this work for additional information regarding copyright ownership.
6
+ * The ASF licenses this file to You under the Apache License, Version 2.0
7
+ * (the "License"); you may not use this file except in compliance with
8
+ * the License. You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.ExponentialBackoffRetryPolicy = void 0;
20
+ const assert = require("node:assert");
21
+ const duration_pb_1 = require("google-protobuf/google/protobuf/duration_pb");
22
+ const definition_pb_1 = require("../../proto/apache/rocketmq/v2/definition_pb");
23
+ class ExponentialBackoffRetryPolicy {
24
+ #maxAttempts;
25
+ // seconds
26
+ #initialBackoff;
27
+ #maxBackoff;
28
+ #backoffMultiplier;
29
+ constructor(maxAttempts, initialBackoff = 0, maxBackoff = 0, backoffMultiplier = 1) {
30
+ this.#maxAttempts = maxAttempts;
31
+ this.#initialBackoff = initialBackoff;
32
+ this.#maxBackoff = maxBackoff;
33
+ this.#backoffMultiplier = backoffMultiplier;
34
+ }
35
+ static immediatelyRetryPolicy(maxAttempts) {
36
+ return new ExponentialBackoffRetryPolicy(maxAttempts, 0, 0, 1);
37
+ }
38
+ getMaxAttempts() {
39
+ return this.#maxAttempts;
40
+ }
41
+ getNextAttemptDelay(attempt) {
42
+ assert(attempt > 0, 'attempt must be positive');
43
+ const delay = Math.min(this.#initialBackoff * Math.pow(this.#backoffMultiplier, 1.0 * (attempt - 1)), this.#maxBackoff);
44
+ if (delay <= 0) {
45
+ return 0;
46
+ }
47
+ return delay;
48
+ }
49
+ inheritBackoff(retryPolicy) {
50
+ assert(retryPolicy.getStrategyCase() === definition_pb_1.RetryPolicy.StrategyCase.EXPONENTIAL_BACKOFF, 'strategy must be exponential backoff');
51
+ const backoff = retryPolicy.getExponentialBackoff().toObject();
52
+ return new ExponentialBackoffRetryPolicy(this.#maxAttempts, backoff.initial?.seconds, backoff.max?.seconds, backoff.multiplier);
53
+ }
54
+ toProtobuf() {
55
+ return new definition_pb_1.RetryPolicy()
56
+ .setMaxAttempts(this.#maxAttempts)
57
+ .setExponentialBackoff(new definition_pb_1.ExponentialBackoff()
58
+ .setInitial(new duration_pb_1.Duration().setSeconds(this.#initialBackoff))
59
+ .setMax(new duration_pb_1.Duration().setSeconds(this.#maxBackoff))
60
+ .setMultiplier(this.#backoffMultiplier));
61
+ }
62
+ }
63
+ exports.ExponentialBackoffRetryPolicy = ExponentialBackoffRetryPolicy;
64
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRXhwb25lbnRpYWxCYWNrb2ZmUmV0cnlQb2xpY3ku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JLENBQUMsV0FBVyxDQUFDLENBQUM7YUFDbkQsYUFBYSxDQUFDLElBQUksQ0FBQyxrQkFBa0IsQ0FBQyxDQUFDLENBQUM7SUFDakQsQ0FBQztDQUNGO0FBbERELHNFQWtEQyJ9
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements. See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License"); you may not use this file except in compliance with
7
+ * the License. You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { RetryPolicy as RetryPolicyPB } from '../../proto/apache/rocketmq/v2/definition_pb';
18
+ /**
19
+ * Internal interface for retry policy.
20
+ */
21
+ export interface RetryPolicy {
22
+ /**
23
+ * Get the max attempt times for retry.
24
+ *
25
+ * @return max attempt times.
26
+ */
27
+ getMaxAttempts(): number;
28
+ /**
29
+ * Get await time after current attempts, the attempt index starts at 1.
30
+ *
31
+ * @param attempt current attempt.
32
+ * @return await time in seconds.
33
+ */
34
+ getNextAttemptDelay(attempt: number): number;
35
+ /**
36
+ * Update the retry backoff strategy and generate a new one.
37
+ *
38
+ * @param retryPolicy retry policy which contains the backoff strategy.
39
+ * @return the new retry policy.
40
+ */
41
+ inheritBackoff(retryPolicy: RetryPolicyPB): RetryPolicy;
42
+ /**
43
+ * Convert to RetryPolicyPB
44
+ */
45
+ toProtobuf(): RetryPolicyPB;
46
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ /**
3
+ * Licensed to the Apache Software Foundation (ASF) under one or more
4
+ * contributor license agreements. See the NOTICE file distributed with
5
+ * this work for additional information regarding copyright ownership.
6
+ * The ASF licenses this file to You under the Apache License, Version 2.0
7
+ * (the "License"); you may not use this file except in compliance with
8
+ * the License. You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmV0cnlQb2xpY3kuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvcmV0cnkvUmV0cnlQb2xpY3kudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOzs7Ozs7Ozs7Ozs7Ozs7R0FlRyJ9
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements. See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License"); you may not use this file except in compliance with
7
+ * the License. You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export * from './ExponentialBackoffRetryPolicy';
18
+ export * from './RetryPolicy';
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ /**
3
+ * Licensed to the Apache Software Foundation (ASF) under one or more
4
+ * contributor license agreements. See the NOTICE file distributed with
5
+ * this work for additional information regarding copyright ownership.
6
+ * The ASF licenses this file to You under the Apache License, Version 2.0
7
+ * (the "License"); you may not use this file except in compliance with
8
+ * the License. You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
19
+ if (k2 === undefined) k2 = k;
20
+ var desc = Object.getOwnPropertyDescriptor(m, k);
21
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
22
+ desc = { enumerable: true, get: function() { return m[k]; } };
23
+ }
24
+ Object.defineProperty(o, k2, desc);
25
+ }) : (function(o, m, k, k2) {
26
+ if (k2 === undefined) k2 = k;
27
+ o[k2] = m[k];
28
+ }));
29
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
30
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
31
+ };
32
+ Object.defineProperty(exports, "__esModule", { value: true });
33
+ __exportStar(require("./ExponentialBackoffRetryPolicy"), exports);
34
+ __exportStar(require("./RetryPolicy"), exports);
35
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvcmV0cnkvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOzs7Ozs7Ozs7Ozs7Ozs7R0FlRzs7Ozs7Ozs7Ozs7Ozs7OztBQUVILGtFQUFnRDtBQUNoRCxnREFBOEIifQ==
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements. See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License"); you may not use this file except in compliance with
7
+ * the License. You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { Broker as BrokerPB } from '../../proto/apache/rocketmq/v2/definition_pb';
18
+ import { Endpoints } from './Endpoints';
19
+ export declare class Broker implements BrokerPB.AsObject {
20
+ name: string;
21
+ id: number;
22
+ endpoints: Endpoints;
23
+ constructor(broker: BrokerPB.AsObject);
24
+ toProtobuf(): BrokerPB;
25
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ /**
3
+ * Licensed to the Apache Software Foundation (ASF) under one or more
4
+ * contributor license agreements. See the NOTICE file distributed with
5
+ * this work for additional information regarding copyright ownership.
6
+ * The ASF licenses this file to You under the Apache License, Version 2.0
7
+ * (the "License"); you may not use this file except in compliance with
8
+ * the License. You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.Broker = void 0;
20
+ const definition_pb_1 = require("../../proto/apache/rocketmq/v2/definition_pb");
21
+ const Endpoints_1 = require("./Endpoints");
22
+ class Broker {
23
+ name;
24
+ id;
25
+ endpoints;
26
+ constructor(broker) {
27
+ this.name = broker.name;
28
+ this.id = broker.id;
29
+ this.endpoints = new Endpoints_1.Endpoints(broker.endpoints);
30
+ }
31
+ toProtobuf() {
32
+ const broker = new definition_pb_1.Broker();
33
+ broker.setName(this.name);
34
+ broker.setId(this.id);
35
+ broker.setEndpoints(this.endpoints.toProtobuf());
36
+ return broker;
37
+ }
38
+ }
39
+ exports.Broker = Broker;
40
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQnJva2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3JvdXRlL0Jyb2tlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7Ozs7Ozs7Ozs7Ozs7OztHQWVHOzs7QUFFSCxnRkFBa0Y7QUFDbEYsMkNBQXdDO0FBRXhDLE1BQWEsTUFBTTtJQUNqQixJQUFJLENBQVM7SUFDYixFQUFFLENBQVM7SUFDWCxTQUFTLENBQVk7SUFFckIsWUFBWSxNQUF5QjtRQUNuQyxJQUFJLENBQUMsSUFBSSxHQUFHLE1BQU0sQ0FBQyxJQUFJLENBQUM7UUFDeEIsSUFBSSxDQUFDLEVBQUUsR0FBRyxNQUFNLENBQUMsRUFBRSxDQUFDO1FBQ3BCLElBQUksQ0FBQyxTQUFTLEdBQUcsSUFBSSxxQkFBUyxDQUFDLE1BQU0sQ0FBQyxTQUFVLENBQUMsQ0FBQztJQUNwRCxDQUFDO0lBRUQsVUFBVTtRQUNSLE1BQU0sTUFBTSxHQUFHLElBQUksc0JBQVEsRUFBRSxDQUFDO1FBQzlCLE1BQU0sQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFDO1FBQzFCLE1BQU0sQ0FBQyxLQUFLLENBQUMsSUFBSSxDQUFDLEVBQUUsQ0FBQyxDQUFDO1FBQ3RCLE1BQU0sQ0FBQyxZQUFZLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxVQUFVLEVBQUUsQ0FBQyxDQUFDO1FBQ2pELE9BQU8sTUFBTSxDQUFDO0lBQ2hCLENBQUM7Q0FDRjtBQWxCRCx3QkFrQkMifQ==
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements. See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License"); you may not use this file except in compliance with
7
+ * the License. You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { Address, AddressScheme, Endpoints as EndpointsPB } from '../../proto/apache/rocketmq/v2/definition_pb';
18
+ export declare class Endpoints {
19
+ readonly addressesList: Address.AsObject[];
20
+ readonly scheme: AddressScheme;
21
+ /**
22
+ * URI path for grpc target, e.g:
23
+ * 127.0.0.1:10911[,127.0.0.2:10912]
24
+ */
25
+ readonly facade: string;
26
+ constructor(endpoints: string | EndpointsPB.AsObject);
27
+ getGrpcTarget(): string;
28
+ toString(): string;
29
+ toProtobuf(): EndpointsPB;
30
+ }
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ /**
3
+ * Licensed to the Apache Software Foundation (ASF) under one or more
4
+ * contributor license agreements. See the NOTICE file distributed with
5
+ * this work for additional information regarding copyright ownership.
6
+ * The ASF licenses this file to You under the Apache License, Version 2.0
7
+ * (the "License"); you may not use this file except in compliance with
8
+ * the License. You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.Endpoints = void 0;
20
+ const node_net_1 = require("node:net");
21
+ const definition_pb_1 = require("../../proto/apache/rocketmq/v2/definition_pb");
22
+ const DEFAULT_PORT = 80;
23
+ class Endpoints {
24
+ addressesList;
25
+ scheme;
26
+ /**
27
+ * URI path for grpc target, e.g:
28
+ * 127.0.0.1:10911[,127.0.0.2:10912]
29
+ */
30
+ facade;
31
+ constructor(endpoints) {
32
+ if (typeof endpoints === 'string') {
33
+ const splits = endpoints.split(';');
34
+ this.addressesList = [];
35
+ for (const endpoint of splits) {
36
+ const [host, port] = endpoint.split(':');
37
+ if ((0, node_net_1.isIPv4)(host)) {
38
+ this.scheme = definition_pb_1.AddressScheme.IPV4;
39
+ }
40
+ else if ((0, node_net_1.isIPv6)(host)) {
41
+ this.scheme = definition_pb_1.AddressScheme.IPV6;
42
+ }
43
+ else {
44
+ this.scheme = definition_pb_1.AddressScheme.DOMAIN_NAME;
45
+ }
46
+ this.addressesList.push({ host, port: parseInt(port) || DEFAULT_PORT });
47
+ }
48
+ }
49
+ else {
50
+ this.scheme = endpoints.scheme;
51
+ this.addressesList = endpoints.addressesList;
52
+ }
53
+ this.facade = this.addressesList.map(addr => `${addr.host}:${addr.port}`).join(',');
54
+ }
55
+ getGrpcTarget() {
56
+ return this.facade;
57
+ }
58
+ toString() {
59
+ return this.facade;
60
+ }
61
+ toProtobuf() {
62
+ const endpoints = new definition_pb_1.Endpoints();
63
+ endpoints.setScheme(this.scheme);
64
+ for (const address of this.addressesList) {
65
+ endpoints.addAddresses().setHost(address.host).setPort(address.port);
66
+ }
67
+ return endpoints;
68
+ }
69
+ }
70
+ exports.Endpoints = Endpoints;
71
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRW5kcG9pbnRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3JvdXRlL0VuZHBva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=
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements. See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License"); you may not use this file except in compliance with
7
+ * the License. You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { MessageQueue as MessageQueuePB, MessageType, Permission, Resource } from '../../proto/apache/rocketmq/v2/definition_pb';
18
+ import { Broker } from './Broker';
19
+ export declare class MessageQueue {
20
+ topic: Resource.AsObject;
21
+ queueId: number;
22
+ broker: Broker;
23
+ permission: Permission;
24
+ acceptMessageTypesList: MessageType[];
25
+ constructor(messageQueue: MessageQueuePB);
26
+ toProtobuf(): MessageQueuePB;
27
+ }
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ /**
3
+ * Licensed to the Apache Software Foundation (ASF) under one or more
4
+ * contributor license agreements. See the NOTICE file distributed with
5
+ * this work for additional information regarding copyright ownership.
6
+ * The ASF licenses this file to You under the Apache License, Version 2.0
7
+ * (the "License"); you may not use this file except in compliance with
8
+ * the License. You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.MessageQueue = void 0;
20
+ const definition_pb_1 = require("../../proto/apache/rocketmq/v2/definition_pb");
21
+ const util_1 = require("../util");
22
+ const Broker_1 = require("./Broker");
23
+ class MessageQueue {
24
+ topic;
25
+ queueId;
26
+ broker;
27
+ permission;
28
+ acceptMessageTypesList;
29
+ constructor(messageQueue) {
30
+ this.topic = messageQueue.getTopic().toObject();
31
+ this.queueId = messageQueue.getId();
32
+ this.permission = messageQueue.getPermission();
33
+ this.acceptMessageTypesList = messageQueue.getAcceptMessageTypesList();
34
+ this.broker = new Broker_1.Broker(messageQueue.getBroker().toObject());
35
+ }
36
+ toProtobuf() {
37
+ const messageQueue = new definition_pb_1.MessageQueue();
38
+ messageQueue.setId(this.queueId);
39
+ messageQueue.setTopic((0, util_1.createResource)(this.topic.name));
40
+ messageQueue.setBroker(this.broker.toProtobuf());
41
+ messageQueue.setPermission(this.permission);
42
+ messageQueue.setAcceptMessageTypesList(this.acceptMessageTypesList);
43
+ return messageQueue;
44
+ }
45
+ }
46
+ exports.MessageQueue = MessageQueue;
47
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWVzc2FnZVF1ZXVlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3JvdXRlL01lc3NhZ2VRdWV1ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7Ozs7Ozs7Ozs7Ozs7OztHQWVHOzs7QUFFSCxnRkFHc0Q7QUFDdEQsa0NBQXlDO0FBQ3pDLHFDQUFrQztBQUVsQyxNQUFhLFlBQVk7SUFDdkIsS0FBSyxDQUFvQjtJQUN6QixPQUFPLENBQVM7SUFDaEIsTUFBTSxDQUFTO0lBQ2YsVUFBVSxDQUFhO0lBQ3ZCLHNCQUFzQixDQUFnQjtJQUV0QyxZQUFZLFlBQTRCO1FBQ3RDLElBQUksQ0FBQyxLQUFLLEdBQUcsWUFBWSxDQUFDLFFBQVEsRUFBRyxDQUFDLFFBQVEsRUFBRSxDQUFDO1FBQ2pELElBQUksQ0FBQyxPQUFPLEdBQUcsWUFBWSxDQUFDLEtBQUssRUFBRSxDQUFDO1FBQ3BDLElBQUksQ0FBQyxVQUFVLEdBQUcsWUFBWSxDQUFDLGFBQWEsRUFBRSxDQUFDO1FBQy9DLElBQUksQ0FBQyxzQkFBc0IsR0FBRyxZQUFZLENBQUMseUJBQXlCLEVBQUUsQ0FBQztRQUN2RSxJQUFJLENBQUMsTUFBTSxHQUFHLElBQUksZUFBTSxDQUFDLFlBQVksQ0FBQyxTQUFTLEVBQUcsQ0FBQyxRQUFRLEVBQUUsQ0FBQyxDQUFDO0lBQ2pFLENBQUM7SUFFRCxVQUFVO1FBQ1IsTUFBTSxZQUFZLEdBQUcsSUFBSSw0QkFBYyxFQUFFLENBQUM7UUFDMUMsWUFBWSxDQUFDLEtBQUssQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLENBQUM7UUFDakMsWUFBWSxDQUFDLFFBQVEsQ0FBQyxJQUFBLHFCQUFjLEVBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDO1FBQ3ZELFlBQVksQ0FBQyxTQUFTLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxVQUFVLEVBQUUsQ0FBQyxDQUFDO1FBQ2pELFlBQVksQ0FBQyxhQUFhLENBQUMsSUFBSSxDQUFDLFVBQVUsQ0FBQyxDQUFDO1FBQzVDLFlBQVksQ0FBQyx5QkFBeUIsQ0FBQyxJQUFJLENBQUMsc0JBQXNCLENBQUMsQ0FBQztRQUNwRSxPQUFPLFlBQVksQ0FBQztJQUN0QixDQUFDO0NBQ0Y7QUF4QkQsb0NBd0JDIn0=
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements. See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License"); you may not use this file except in compliance with
7
+ * the License. You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { MessageQueue as MessageQueuePB } from '../../proto/apache/rocketmq/v2/definition_pb';
18
+ import { Endpoints } from './Endpoints';
19
+ import { MessageQueue } from './MessageQueue';
20
+ export declare class TopicRouteData {
21
+ readonly messageQueues: MessageQueue[];
22
+ constructor(messageQueues: MessageQueuePB[]);
23
+ getTotalEndpoints(): Endpoints[];
24
+ }
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ /**
3
+ * Licensed to the Apache Software Foundation (ASF) under one or more
4
+ * contributor license agreements. See the NOTICE file distributed with
5
+ * this work for additional information regarding copyright ownership.
6
+ * The ASF licenses this file to You under the Apache License, Version 2.0
7
+ * (the "License"); you may not use this file except in compliance with
8
+ * the License. You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.TopicRouteData = void 0;
20
+ const MessageQueue_1 = require("./MessageQueue");
21
+ class TopicRouteData {
22
+ messageQueues = [];
23
+ constructor(messageQueues) {
24
+ for (const mq of messageQueues) {
25
+ this.messageQueues.push(new MessageQueue_1.MessageQueue(mq));
26
+ }
27
+ }
28
+ getTotalEndpoints() {
29
+ const endpointsMap = new Map();
30
+ for (const mq of this.messageQueues) {
31
+ endpointsMap.set(mq.broker.endpoints.facade, mq.broker.endpoints);
32
+ }
33
+ return Array.from(endpointsMap.values());
34
+ }
35
+ }
36
+ exports.TopicRouteData = TopicRouteData;
37
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiVG9waWNSb3V0ZURhdGEuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvcm91dGUvVG9waWNSb3V0ZURhdGEudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOzs7Ozs7Ozs7Ozs7Ozs7R0FlRzs7O0FBSUgsaURBQThDO0FBRTlDLE1BQWEsY0FBYztJQUNoQixhQUFhLEdBQW1CLEVBQUUsQ0FBQztJQUU1QyxZQUFZLGFBQStCO1FBQ3pDLEtBQUssTUFBTSxFQUFFLElBQUksYUFBYSxFQUFFLENBQUM7WUFDL0IsSUFBSSxDQUFDLGFBQWEsQ0FBQyxJQUFJLENBQUMsSUFBSSwyQkFBWSxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUM7UUFDaEQsQ0FBQztJQUNILENBQUM7SUFFRCxpQkFBaUI7UUFDZixNQUFNLFlBQVksR0FBRyxJQUFJLEdBQUcsRUFBcUIsQ0FBQztRQUNsRCxLQUFLLE1BQU0sRUFBRSxJQUFJLElBQUksQ0FBQyxhQUFhLEVBQUUsQ0FBQztZQUNwQyxZQUFZLENBQUMsR0FBRyxDQUFDLEVBQUUsQ0FBQyxNQUFNLENBQUMsU0FBUyxDQUFDLE1BQU0sRUFBRSxFQUFFLENBQUMsTUFBTSxDQUFDLFNBQVMsQ0FBQyxDQUFDO1FBQ3BFLENBQUM7UUFDRCxPQUFPLEtBQUssQ0FBQyxJQUFJLENBQUMsWUFBWSxDQUFDLE1BQU0sRUFBRSxDQUFDLENBQUM7SUFDM0MsQ0FBQztDQUNGO0FBaEJELHdDQWdCQyJ9
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements. See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License"); you may not use this file except in compliance with
7
+ * the License. You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export * from './Broker';
18
+ export * from './Endpoints';
19
+ export * from './MessageQueue';
20
+ export * from './TopicRouteData';
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ /**
3
+ * Licensed to the Apache Software Foundation (ASF) under one or more
4
+ * contributor license agreements. See the NOTICE file distributed with
5
+ * this work for additional information regarding copyright ownership.
6
+ * The ASF licenses this file to You under the Apache License, Version 2.0
7
+ * (the "License"); you may not use this file except in compliance with
8
+ * the License. You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
19
+ if (k2 === undefined) k2 = k;
20
+ var desc = Object.getOwnPropertyDescriptor(m, k);
21
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
22
+ desc = { enumerable: true, get: function() { return m[k]; } };
23
+ }
24
+ Object.defineProperty(o, k2, desc);
25
+ }) : (function(o, m, k, k2) {
26
+ if (k2 === undefined) k2 = k;
27
+ o[k2] = m[k];
28
+ }));
29
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
30
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
31
+ };
32
+ Object.defineProperty(exports, "__esModule", { value: true });
33
+ __exportStar(require("./Broker"), exports);
34
+ __exportStar(require("./Endpoints"), exports);
35
+ __exportStar(require("./MessageQueue"), exports);
36
+ __exportStar(require("./TopicRouteData"), exports);
37
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvcm91dGUvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOzs7Ozs7Ozs7Ozs7Ozs7R0FlRzs7Ozs7Ozs7Ozs7Ozs7OztBQUVILDJDQUF5QjtBQUN6Qiw4Q0FBNEI7QUFDNUIsaURBQStCO0FBQy9CLG1EQUFpQyJ9
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3
+ * contributor license agreements. See the NOTICE file distributed with
4
+ * this work for additional information regarding copyright ownership.
5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
6
+ * (the "License"); you may not use this file except in compliance with
7
+ * the License. You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { Duration } from 'google-protobuf/google/protobuf/duration_pb';
18
+ import { Resource } from '../../proto/apache/rocketmq/v2/definition_pb';
19
+ export declare const MASTER_BROKER_ID = 0;
20
+ export declare function getTimestamp(): {
21
+ seconds: number;
22
+ nanos: number;
23
+ timestamp: number;
24
+ };
25
+ export declare function getRequestDateTime(): string;
26
+ export declare function sign(accessSecret: string, dateTime: string): string;
27
+ export declare function createDuration(ms: number): Duration;
28
+ export declare function createResource(name: string): Resource;
29
+ export declare function crc32CheckSum(bytes: Buffer): string;
30
+ export declare function md5CheckSum(bytes: Uint8Array): string;
31
+ export declare function sha1CheckSum(bytes: Uint8Array): string;
32
+ /**
33
+ * Java: Hashing.sipHash24().hashBytes(messageGroup.getBytes(StandardCharsets.UTF_8)).asLong()
34
+ */
35
+ export declare function calculateStringSipHash24(value: string): bigint;