apache-iggy 0.5.0-edge.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +81 -0
- package/dist/src/bdd/auth.d.ts +20 -0
- package/dist/src/bdd/auth.js +38 -0
- package/dist/src/bdd/message.d.ts +20 -0
- package/dist/src/bdd/message.js +70 -0
- package/dist/src/bdd/stream.d.ts +20 -0
- package/dist/src/bdd/stream.js +39 -0
- package/dist/src/bdd/topic.d.ts +20 -0
- package/dist/src/bdd/topic.js +36 -0
- package/dist/src/bdd/world.d.ts +30 -0
- package/dist/src/bdd/world.js +21 -0
- package/dist/src/client/client.connection.d.ts +40 -0
- package/dist/src/client/client.connection.js +171 -0
- package/dist/src/client/client.d.ts +38 -0
- package/dist/src/client/client.debug.d.ts +21 -0
- package/dist/src/client/client.debug.js +21 -0
- package/dist/src/client/client.js +97 -0
- package/dist/src/client/client.socket.d.ts +48 -0
- package/dist/src/client/client.socket.js +156 -0
- package/dist/src/client/client.type.d.ts +69 -0
- package/dist/src/client/client.type.js +20 -0
- package/dist/src/client/client.utils.d.ts +29 -0
- package/dist/src/client/client.utils.js +54 -0
- package/dist/src/client/index.d.ts +23 -0
- package/dist/src/client/index.js +23 -0
- package/dist/src/client.e2e.d.ts +20 -0
- package/dist/src/client.e2e.js +54 -0
- package/dist/src/debug-send.d.ts +20 -0
- package/dist/src/debug-send.js +117 -0
- package/dist/src/debug.d.ts +20 -0
- package/dist/src/debug.js +107 -0
- package/dist/src/e2e/tcp.client.e2e.d.ts +20 -0
- package/dist/src/e2e/tcp.client.e2e.js +45 -0
- package/dist/src/e2e/tcp.consumer-group.e2e.d.ts +20 -0
- package/dist/src/e2e/tcp.consumer-group.e2e.js +111 -0
- package/dist/src/e2e/tcp.consumer-stream.e2e.d.ts +20 -0
- package/dist/src/e2e/tcp.consumer-stream.e2e.js +92 -0
- package/dist/src/e2e/tcp.parallel.e2e.d.ts +20 -0
- package/dist/src/e2e/tcp.parallel.e2e.js +59 -0
- package/dist/src/e2e/tcp.send-message.e2e.d.ts +20 -0
- package/dist/src/e2e/tcp.send-message.e2e.js +118 -0
- package/dist/src/e2e/tcp.stream.e2e.d.ts +20 -0
- package/dist/src/e2e/tcp.stream.e2e.js +59 -0
- package/dist/src/e2e/tcp.system.e2e.d.ts +20 -0
- package/dist/src/e2e/tcp.system.e2e.js +46 -0
- package/dist/src/e2e/tcp.token.e2e.d.ts +20 -0
- package/dist/src/e2e/tcp.token.e2e.js +43 -0
- package/dist/src/e2e/tcp.topic.e2e.d.ts +20 -0
- package/dist/src/e2e/tcp.topic.e2e.js +83 -0
- package/dist/src/e2e/tcp.user.e2e.d.ts +20 -0
- package/dist/src/e2e/tcp.user.e2e.js +95 -0
- package/dist/src/e2e/test-client.utils.d.ts +21 -0
- package/dist/src/e2e/test-client.utils.js +28 -0
- package/dist/src/index.d.ts +22 -0
- package/dist/src/index.js +22 -0
- package/dist/src/stream/consumer-stream.d.ts +40 -0
- package/dist/src/stream/consumer-stream.js +79 -0
- package/dist/src/stream/index.d.ts +20 -0
- package/dist/src/stream/index.js +20 -0
- package/dist/src/tcp.e2e.d.ts +20 -0
- package/dist/src/tcp.e2e.js +106 -0
- package/dist/src/tcp.sm.utils.d.ts +97 -0
- package/dist/src/tcp.sm.utils.js +66 -0
- package/dist/src/tls.system.e2e.d.ts +20 -0
- package/dist/src/tls.system.e2e.js +49 -0
- package/dist/src/type.utils.d.ts +21 -0
- package/dist/src/type.utils.js +25 -0
- package/dist/src/wire/client/client.utils.d.ts +32 -0
- package/dist/src/wire/client/client.utils.js +48 -0
- package/dist/src/wire/client/get-client.command.d.ts +30 -0
- package/dist/src/wire/client/get-client.command.js +33 -0
- package/dist/src/wire/client/get-clients.command.d.ts +27 -0
- package/dist/src/wire/client/get-clients.command.js +38 -0
- package/dist/src/wire/client/get-me.command.d.ts +27 -0
- package/dist/src/wire/client/get-me.command.js +28 -0
- package/dist/src/wire/client/index.d.ts +22 -0
- package/dist/src/wire/client/index.js +22 -0
- package/dist/src/wire/command-set.d.ts +128 -0
- package/dist/src/wire/command-set.js +157 -0
- package/dist/src/wire/command.code.d.ts +68 -0
- package/dist/src/wire/command.code.js +72 -0
- package/dist/src/wire/command.utils.d.ts +26 -0
- package/dist/src/wire/command.utils.js +29 -0
- package/dist/src/wire/consumer-group/create-group.command.d.ts +34 -0
- package/dist/src/wire/consumer-group/create-group.command.js +44 -0
- package/dist/src/wire/consumer-group/create-group.command.test.d.ts +20 -0
- package/dist/src/wire/consumer-group/create-group.command.test.js +47 -0
- package/dist/src/wire/consumer-group/delete-group.command.d.ts +31 -0
- package/dist/src/wire/consumer-group/delete-group.command.js +31 -0
- package/dist/src/wire/consumer-group/get-group.command.d.ts +33 -0
- package/dist/src/wire/consumer-group/get-group.command.js +32 -0
- package/dist/src/wire/consumer-group/get-groups.command.d.ts +32 -0
- package/dist/src/wire/consumer-group/get-groups.command.js +36 -0
- package/dist/src/wire/consumer-group/group.command.test.d.ts +20 -0
- package/dist/src/wire/consumer-group/group.command.test.js +50 -0
- package/dist/src/wire/consumer-group/group.utils.d.ts +34 -0
- package/dist/src/wire/consumer-group/group.utils.js +53 -0
- package/dist/src/wire/consumer-group/index.d.ts +25 -0
- package/dist/src/wire/consumer-group/index.js +25 -0
- package/dist/src/wire/consumer-group/join-group.command.d.ts +31 -0
- package/dist/src/wire/consumer-group/join-group.command.js +31 -0
- package/dist/src/wire/consumer-group/leave-group.command.d.ts +31 -0
- package/dist/src/wire/consumer-group/leave-group.command.js +31 -0
- package/dist/src/wire/error.code.d.ts +20 -0
- package/dist/src/wire/error.code.js +202 -0
- package/dist/src/wire/error.utils.d.ts +20 -0
- package/dist/src/wire/error.utils.js +23 -0
- package/dist/src/wire/identifier.utils.d.ts +21 -0
- package/dist/src/wire/identifier.utils.js +49 -0
- package/dist/src/wire/identifier.utils.test.d.ts +20 -0
- package/dist/src/wire/identifier.utils.test.js +40 -0
- package/dist/src/wire/index.d.ts +32 -0
- package/dist/src/wire/index.js +31 -0
- package/dist/src/wire/message/flush-unsaved-buffers.command.d.ts +31 -0
- package/dist/src/wire/message/flush-unsaved-buffers.command.js +31 -0
- package/dist/src/wire/message/header.type.d.ts +101 -0
- package/dist/src/wire/message/header.type.js +55 -0
- package/dist/src/wire/message/header.utils.d.ts +67 -0
- package/dist/src/wire/message/header.utils.js +248 -0
- package/dist/src/wire/message/header.utils.test.d.ts +20 -0
- package/dist/src/wire/message/header.utils.test.js +39 -0
- package/dist/src/wire/message/iggy-header.utils.d.ts +32 -0
- package/dist/src/wire/message/iggy-header.utils.js +50 -0
- package/dist/src/wire/message/index.d.ts +25 -0
- package/dist/src/wire/message/index.js +25 -0
- package/dist/src/wire/message/message.utils.d.ts +35 -0
- package/dist/src/wire/message/message.utils.js +112 -0
- package/dist/src/wire/message/partitioning.utils.d.ts +51 -0
- package/dist/src/wire/message/partitioning.utils.js +77 -0
- package/dist/src/wire/message/poll-messages.command.d.ts +43 -0
- package/dist/src/wire/message/poll-messages.command.js +32 -0
- package/dist/src/wire/message/poll.utils.d.ts +93 -0
- package/dist/src/wire/message/poll.utils.js +135 -0
- package/dist/src/wire/message/send-messages.command.d.ts +34 -0
- package/dist/src/wire/message/send-messages.command.js +31 -0
- package/dist/src/wire/message/send-messages.command.test.d.ts +20 -0
- package/dist/src/wire/message/send-messages.command.test.js +88 -0
- package/dist/src/wire/number.utils.d.ts +32 -0
- package/dist/src/wire/number.utils.js +85 -0
- package/dist/src/wire/offset/delete-offset.command.d.ts +28 -0
- package/dist/src/wire/offset/delete-offset.command.js +31 -0
- package/dist/src/wire/offset/get-offset.command.d.ts +34 -0
- package/dist/src/wire/offset/get-offset.command.js +41 -0
- package/dist/src/wire/offset/index.d.ts +22 -0
- package/dist/src/wire/offset/index.js +22 -0
- package/dist/src/wire/offset/offset.utils.d.ts +54 -0
- package/dist/src/wire/offset/offset.utils.js +60 -0
- package/dist/src/wire/offset/store-offset.command.d.ts +34 -0
- package/dist/src/wire/offset/store-offset.command.js +29 -0
- package/dist/src/wire/partition/create-partition.command.d.ts +31 -0
- package/dist/src/wire/partition/create-partition.command.js +31 -0
- package/dist/src/wire/partition/delete-partition.command.d.ts +31 -0
- package/dist/src/wire/partition/delete-partition.command.js +31 -0
- package/dist/src/wire/partition/index.d.ts +21 -0
- package/dist/src/wire/partition/index.js +21 -0
- package/dist/src/wire/partition/partition.utils.d.ts +21 -0
- package/dist/src/wire/partition/partition.utils.js +33 -0
- package/dist/src/wire/partition/partition.utils.test.d.ts +20 -0
- package/dist/src/wire/partition/partition.utils.test.js +33 -0
- package/dist/src/wire/segment/delete-segments.command.d.ts +32 -0
- package/dist/src/wire/segment/delete-segments.command.js +31 -0
- package/dist/src/wire/segment/index.d.ts +20 -0
- package/dist/src/wire/segment/index.js +20 -0
- package/dist/src/wire/segment/segment.utils.d.ts +21 -0
- package/dist/src/wire/segment/segment.utils.js +35 -0
- package/dist/src/wire/serialize.utils.d.ts +22 -0
- package/dist/src/wire/serialize.utils.js +27 -0
- package/dist/src/wire/session/index.d.ts +23 -0
- package/dist/src/wire/session/index.js +22 -0
- package/dist/src/wire/session/login-with-token.command.d.ts +32 -0
- package/dist/src/wire/session/login-with-token.command.js +30 -0
- package/dist/src/wire/session/login-with-token.command.test.d.ts +20 -0
- package/dist/src/wire/session/login-with-token.command.test.js +38 -0
- package/dist/src/wire/session/login.command.d.ts +29 -0
- package/dist/src/wire/session/login.command.js +30 -0
- package/dist/src/wire/session/login.command.test.d.ts +20 -0
- package/dist/src/wire/session/login.command.test.js +52 -0
- package/dist/src/wire/session/login.utils.d.ts +30 -0
- package/dist/src/wire/session/login.utils.js +54 -0
- package/dist/src/wire/session/logout.command.d.ts +25 -0
- package/dist/src/wire/session/logout.command.js +30 -0
- package/dist/src/wire/stream/create-stream.command.d.ts +31 -0
- package/dist/src/wire/stream/create-stream.command.js +41 -0
- package/dist/src/wire/stream/create-stream.command.test.d.ts +20 -0
- package/dist/src/wire/stream/create-stream.command.test.js +45 -0
- package/dist/src/wire/stream/delete-stream.command.d.ts +29 -0
- package/dist/src/wire/stream/delete-stream.command.js +31 -0
- package/dist/src/wire/stream/get-stream.command.d.ts +31 -0
- package/dist/src/wire/stream/get-stream.command.js +33 -0
- package/dist/src/wire/stream/get-streams.command.d.ts +27 -0
- package/dist/src/wire/stream/get-streams.command.js +38 -0
- package/dist/src/wire/stream/index.d.ts +25 -0
- package/dist/src/wire/stream/index.js +25 -0
- package/dist/src/wire/stream/purge-stream.command.d.ts +29 -0
- package/dist/src/wire/stream/purge-stream.command.js +31 -0
- package/dist/src/wire/stream/stream.utils.d.ts +33 -0
- package/dist/src/wire/stream/stream.utils.js +35 -0
- package/dist/src/wire/stream/update-stream.command.d.ts +30 -0
- package/dist/src/wire/stream/update-stream.command.js +40 -0
- package/dist/src/wire/system/get-stats.command.d.ts +50 -0
- package/dist/src/wire/system/get-stats.command.js +83 -0
- package/dist/src/wire/system/index.d.ts +21 -0
- package/dist/src/wire/system/index.js +21 -0
- package/dist/src/wire/system/ping.command.d.ts +25 -0
- package/dist/src/wire/system/ping.command.js +30 -0
- package/dist/src/wire/token/create-token.command.d.ts +31 -0
- package/dist/src/wire/token/create-token.command.js +37 -0
- package/dist/src/wire/token/create-token.command.test.d.ts +20 -0
- package/dist/src/wire/token/create-token.command.test.js +45 -0
- package/dist/src/wire/token/delete-token.command.d.ts +28 -0
- package/dist/src/wire/token/delete-token.command.js +38 -0
- package/dist/src/wire/token/delete-token.command.test.d.ts +20 -0
- package/dist/src/wire/token/delete-token.command.test.js +42 -0
- package/dist/src/wire/token/get-tokens.command.d.ts +27 -0
- package/dist/src/wire/token/get-tokens.command.js +28 -0
- package/dist/src/wire/token/index.d.ts +22 -0
- package/dist/src/wire/token/index.js +22 -0
- package/dist/src/wire/token/token.utils.d.ts +38 -0
- package/dist/src/wire/token/token.utils.js +53 -0
- package/dist/src/wire/topic/create-topic.command.d.ts +38 -0
- package/dist/src/wire/topic/create-topic.command.js +53 -0
- package/dist/src/wire/topic/create-topic.command.test.d.ts +20 -0
- package/dist/src/wire/topic/create-topic.command.test.js +67 -0
- package/dist/src/wire/topic/delete-topic.command.d.ts +32 -0
- package/dist/src/wire/topic/delete-topic.command.js +36 -0
- package/dist/src/wire/topic/get-topic.command.d.ts +33 -0
- package/dist/src/wire/topic/get-topic.command.js +36 -0
- package/dist/src/wire/topic/get-topics.command.d.ts +31 -0
- package/dist/src/wire/topic/get-topics.command.js +33 -0
- package/dist/src/wire/topic/index.d.ts +25 -0
- package/dist/src/wire/topic/index.js +25 -0
- package/dist/src/wire/topic/purge-topic.command.d.ts +30 -0
- package/dist/src/wire/topic/purge-topic.command.js +34 -0
- package/dist/src/wire/topic/topic.utils.d.ts +71 -0
- package/dist/src/wire/topic/topic.utils.js +91 -0
- package/dist/src/wire/topic/update-topic.command.d.ts +36 -0
- package/dist/src/wire/topic/update-topic.command.js +50 -0
- package/dist/src/wire/user/change-password.command.d.ts +30 -0
- package/dist/src/wire/user/change-password.command.js +45 -0
- package/dist/src/wire/user/create-user.command.d.ts +34 -0
- package/dist/src/wire/user/create-user.command.js +48 -0
- package/dist/src/wire/user/create-user.command.test.d.ts +20 -0
- package/dist/src/wire/user/create-user.command.test.js +60 -0
- package/dist/src/wire/user/delete-user.command.d.ts +29 -0
- package/dist/src/wire/user/delete-user.command.js +31 -0
- package/dist/src/wire/user/get-user.command.d.ts +31 -0
- package/dist/src/wire/user/get-user.command.js +31 -0
- package/dist/src/wire/user/get-users.command.d.ts +27 -0
- package/dist/src/wire/user/get-users.command.js +28 -0
- package/dist/src/wire/user/index.d.ts +26 -0
- package/dist/src/wire/user/index.js +26 -0
- package/dist/src/wire/user/permissions.utils.d.ts +77 -0
- package/dist/src/wire/user/permissions.utils.js +161 -0
- package/dist/src/wire/user/permissions.utils.test.d.ts +20 -0
- package/dist/src/wire/user/permissions.utils.test.js +44 -0
- package/dist/src/wire/user/update-permissions.command.d.ts +31 -0
- package/dist/src/wire/user/update-permissions.command.js +39 -0
- package/dist/src/wire/user/update-user.command.d.ts +32 -0
- package/dist/src/wire/user/update-user.command.js +54 -0
- package/dist/src/wire/user/user.utils.d.ts +41 -0
- package/dist/src/wire/user/user.utils.js +74 -0
- package/dist/src/wire/uuid.utils.d.ts +22 -0
- package/dist/src/wire/uuid.utils.js +23 -0
- package/package.json +70 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
* or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information
|
|
5
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
* to you under the Apache License, Version 2.0 (the
|
|
7
|
+
* "License"); you may not use this file except in compliance
|
|
8
|
+
* with 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,
|
|
13
|
+
* software distributed under the License is distributed on an
|
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
* KIND, either express or implied. See the License for the
|
|
16
|
+
* specific language governing permissions and limitations
|
|
17
|
+
* under the License.
|
|
18
|
+
*/
|
|
19
|
+
import { serializeIdentifier } from '../identifier.utils.js';
|
|
20
|
+
import { deserializeConsumerGroups } from './group.utils.js';
|
|
21
|
+
import { wrapCommand } from '../command.utils.js';
|
|
22
|
+
import { COMMAND_CODE } from '../command.code.js';
|
|
23
|
+
export const GET_GROUPS = {
|
|
24
|
+
code: COMMAND_CODE.GetGroups,
|
|
25
|
+
serialize: ({ streamId, topicId }) => {
|
|
26
|
+
return Buffer.concat([
|
|
27
|
+
serializeIdentifier(streamId),
|
|
28
|
+
serializeIdentifier(topicId),
|
|
29
|
+
]);
|
|
30
|
+
},
|
|
31
|
+
deserialize: (r) => {
|
|
32
|
+
return deserializeConsumerGroups(r.data);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
export const getGroups = wrapCommand(GET_GROUPS);
|
|
36
|
+
//# sourceMappingURL=get-groups.command.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
* or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information
|
|
5
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
* to you under the Apache License, Version 2.0 (the
|
|
7
|
+
* "License"); you may not use this file except in compliance
|
|
8
|
+
* with 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,
|
|
13
|
+
* software distributed under the License is distributed on an
|
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
* KIND, either express or implied. See the License for the
|
|
16
|
+
* specific language governing permissions and limitations
|
|
17
|
+
* under the License.
|
|
18
|
+
*/
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=group.command.test.d.ts.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
* or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information
|
|
5
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
* to you under the Apache License, Version 2.0 (the
|
|
7
|
+
* "License"); you may not use this file except in compliance
|
|
8
|
+
* with 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,
|
|
13
|
+
* software distributed under the License is distributed on an
|
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
* KIND, either express or implied. See the License for the
|
|
16
|
+
* specific language governing permissions and limitations
|
|
17
|
+
* under the License.
|
|
18
|
+
*/
|
|
19
|
+
import { describe, it } from 'node:test';
|
|
20
|
+
import assert from 'node:assert/strict';
|
|
21
|
+
import { DELETE_GROUP } from './delete-group.command.js';
|
|
22
|
+
import { JOIN_GROUP } from './join-group.command.js';
|
|
23
|
+
import { LEAVE_GROUP } from './leave-group.command.js';
|
|
24
|
+
const s1 = {
|
|
25
|
+
streamId: 5,
|
|
26
|
+
topicId: 2,
|
|
27
|
+
groupId: 1,
|
|
28
|
+
};
|
|
29
|
+
describe('DeleteGroup', () => {
|
|
30
|
+
describe('serialize', () => {
|
|
31
|
+
it('serialize target group id into buffer', () => {
|
|
32
|
+
assert.deepEqual(DELETE_GROUP.serialize(s1).length, 6 + 6 + 6);
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
describe('JoinGroup', () => {
|
|
37
|
+
describe('serialize', () => {
|
|
38
|
+
it('serialize target group id into buffer', () => {
|
|
39
|
+
assert.deepEqual(JOIN_GROUP.serialize(s1).length, 6 + 6 + 6);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
describe('LeaveGroup', () => {
|
|
44
|
+
describe('serialize', () => {
|
|
45
|
+
it('serialize target group id into buffer', () => {
|
|
46
|
+
assert.deepEqual(LEAVE_GROUP.serialize(s1).length, 6 + 6 + 6);
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
//# sourceMappingURL=group.command.test.js.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
* or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information
|
|
5
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
* to you under the Apache License, Version 2.0 (the
|
|
7
|
+
* "License"); you may not use this file except in compliance
|
|
8
|
+
* with 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,
|
|
13
|
+
* software distributed under the License is distributed on an
|
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
* KIND, either express or implied. See the License for the
|
|
16
|
+
* specific language governing permissions and limitations
|
|
17
|
+
* under the License.
|
|
18
|
+
*/
|
|
19
|
+
import { type Id } from '../identifier.utils.js';
|
|
20
|
+
export type ConsumerGroup = {
|
|
21
|
+
id: number;
|
|
22
|
+
name: string;
|
|
23
|
+
membersCount: number;
|
|
24
|
+
partitionsCount: number;
|
|
25
|
+
};
|
|
26
|
+
type ConsumerGroupDeserialized = {
|
|
27
|
+
bytesRead: number;
|
|
28
|
+
data: ConsumerGroup;
|
|
29
|
+
};
|
|
30
|
+
export declare const serializeTargetGroup: (streamId: Id, topicId: Id, groupId: Id) => Buffer<ArrayBuffer>;
|
|
31
|
+
export declare const deserializeConsumerGroup: (r: Buffer, pos?: number) => ConsumerGroupDeserialized;
|
|
32
|
+
export declare const deserializeConsumerGroups: (r: Buffer, pos?: number) => ConsumerGroup[];
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=group.utils.d.ts.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
* or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information
|
|
5
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
* to you under the Apache License, Version 2.0 (the
|
|
7
|
+
* "License"); you may not use this file except in compliance
|
|
8
|
+
* with 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,
|
|
13
|
+
* software distributed under the License is distributed on an
|
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
* KIND, either express or implied. See the License for the
|
|
16
|
+
* specific language governing permissions and limitations
|
|
17
|
+
* under the License.
|
|
18
|
+
*/
|
|
19
|
+
import { serializeIdentifier } from '../identifier.utils.js';
|
|
20
|
+
export const serializeTargetGroup = (streamId, topicId, groupId) => {
|
|
21
|
+
return Buffer.concat([
|
|
22
|
+
serializeIdentifier(streamId),
|
|
23
|
+
serializeIdentifier(topicId),
|
|
24
|
+
serializeIdentifier(groupId)
|
|
25
|
+
]);
|
|
26
|
+
};
|
|
27
|
+
export const deserializeConsumerGroup = (r, pos = 0) => {
|
|
28
|
+
const id = r.readUInt32LE(pos);
|
|
29
|
+
const partitionsCount = r.readUInt32LE(pos + 4);
|
|
30
|
+
const membersCount = r.readUInt32LE(pos + 8);
|
|
31
|
+
const nameLength = r.readUInt8(pos + 12);
|
|
32
|
+
const name = r.subarray(pos + 13, pos + 13 + nameLength).toString();
|
|
33
|
+
return {
|
|
34
|
+
bytesRead: 4 + 4 + 4 + 1 + nameLength,
|
|
35
|
+
data: {
|
|
36
|
+
id,
|
|
37
|
+
name,
|
|
38
|
+
partitionsCount,
|
|
39
|
+
membersCount,
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
export const deserializeConsumerGroups = (r, pos = 0) => {
|
|
44
|
+
const end = r.length;
|
|
45
|
+
const cgroups = [];
|
|
46
|
+
while (pos < end) {
|
|
47
|
+
const { bytesRead, data } = deserializeConsumerGroup(r, pos);
|
|
48
|
+
cgroups.push(data);
|
|
49
|
+
pos += bytesRead;
|
|
50
|
+
}
|
|
51
|
+
return cgroups;
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=group.utils.js.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
* or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information
|
|
5
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
* to you under the Apache License, Version 2.0 (the
|
|
7
|
+
* "License"); you may not use this file except in compliance
|
|
8
|
+
* with 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,
|
|
13
|
+
* software distributed under the License is distributed on an
|
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
* KIND, either express or implied. See the License for the
|
|
16
|
+
* specific language governing permissions and limitations
|
|
17
|
+
* under the License.
|
|
18
|
+
*/
|
|
19
|
+
export * from './create-group.command.js';
|
|
20
|
+
export * from './delete-group.command.js';
|
|
21
|
+
export * from './get-group.command.js';
|
|
22
|
+
export * from './get-groups.command.js';
|
|
23
|
+
export * from './join-group.command.js';
|
|
24
|
+
export * from './leave-group.command.js';
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
* or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information
|
|
5
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
* to you under the Apache License, Version 2.0 (the
|
|
7
|
+
* "License"); you may not use this file except in compliance
|
|
8
|
+
* with 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,
|
|
13
|
+
* software distributed under the License is distributed on an
|
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
* KIND, either express or implied. See the License for the
|
|
16
|
+
* specific language governing permissions and limitations
|
|
17
|
+
* under the License.
|
|
18
|
+
*/
|
|
19
|
+
export * from './create-group.command.js';
|
|
20
|
+
export * from './delete-group.command.js';
|
|
21
|
+
export * from './get-group.command.js';
|
|
22
|
+
export * from './get-groups.command.js';
|
|
23
|
+
export * from './join-group.command.js';
|
|
24
|
+
export * from './leave-group.command.js';
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
* or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information
|
|
5
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
* to you under the Apache License, Version 2.0 (the
|
|
7
|
+
* "License"); you may not use this file except in compliance
|
|
8
|
+
* with 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,
|
|
13
|
+
* software distributed under the License is distributed on an
|
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
* KIND, either express or implied. See the License for the
|
|
16
|
+
* specific language governing permissions and limitations
|
|
17
|
+
* under the License.
|
|
18
|
+
*/
|
|
19
|
+
import { type Id } from '../identifier.utils.js';
|
|
20
|
+
export type JoinGroup = {
|
|
21
|
+
streamId: Id;
|
|
22
|
+
topicId: Id;
|
|
23
|
+
groupId: Id;
|
|
24
|
+
};
|
|
25
|
+
export declare const JOIN_GROUP: {
|
|
26
|
+
code: number;
|
|
27
|
+
serialize: ({ streamId, topicId, groupId }: JoinGroup) => Buffer<ArrayBuffer>;
|
|
28
|
+
deserialize: (r: import("../../index.js").CommandResponse) => boolean;
|
|
29
|
+
};
|
|
30
|
+
export declare const joinGroup: (getClient: import("../../index.js").ClientProvider) => (arg: JoinGroup) => Promise<boolean>;
|
|
31
|
+
//# sourceMappingURL=join-group.command.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
* or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information
|
|
5
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
* to you under the Apache License, Version 2.0 (the
|
|
7
|
+
* "License"); you may not use this file except in compliance
|
|
8
|
+
* with 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,
|
|
13
|
+
* software distributed under the License is distributed on an
|
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
* KIND, either express or implied. See the License for the
|
|
16
|
+
* specific language governing permissions and limitations
|
|
17
|
+
* under the License.
|
|
18
|
+
*/
|
|
19
|
+
import { serializeTargetGroup } from './group.utils.js';
|
|
20
|
+
import { deserializeVoidResponse } from '../../client/client.utils.js';
|
|
21
|
+
import { wrapCommand } from '../command.utils.js';
|
|
22
|
+
import { COMMAND_CODE } from '../command.code.js';
|
|
23
|
+
export const JOIN_GROUP = {
|
|
24
|
+
code: COMMAND_CODE.JoinGroup,
|
|
25
|
+
serialize: ({ streamId, topicId, groupId }) => {
|
|
26
|
+
return serializeTargetGroup(streamId, topicId, groupId);
|
|
27
|
+
},
|
|
28
|
+
deserialize: deserializeVoidResponse
|
|
29
|
+
};
|
|
30
|
+
export const joinGroup = wrapCommand(JOIN_GROUP);
|
|
31
|
+
//# sourceMappingURL=join-group.command.js.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
* or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information
|
|
5
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
* to you under the Apache License, Version 2.0 (the
|
|
7
|
+
* "License"); you may not use this file except in compliance
|
|
8
|
+
* with 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,
|
|
13
|
+
* software distributed under the License is distributed on an
|
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
* KIND, either express or implied. See the License for the
|
|
16
|
+
* specific language governing permissions and limitations
|
|
17
|
+
* under the License.
|
|
18
|
+
*/
|
|
19
|
+
import { type Id } from '../identifier.utils.js';
|
|
20
|
+
export type LeaveGroup = {
|
|
21
|
+
streamId: Id;
|
|
22
|
+
topicId: Id;
|
|
23
|
+
groupId: Id;
|
|
24
|
+
};
|
|
25
|
+
export declare const LEAVE_GROUP: {
|
|
26
|
+
code: number;
|
|
27
|
+
serialize: ({ streamId, topicId, groupId }: LeaveGroup) => Buffer<ArrayBuffer>;
|
|
28
|
+
deserialize: (r: import("../../index.js").CommandResponse) => boolean;
|
|
29
|
+
};
|
|
30
|
+
export declare const leaveGroup: (getClient: import("../../index.js").ClientProvider) => (arg: LeaveGroup) => Promise<boolean>;
|
|
31
|
+
//# sourceMappingURL=leave-group.command.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
* or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information
|
|
5
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
* to you under the Apache License, Version 2.0 (the
|
|
7
|
+
* "License"); you may not use this file except in compliance
|
|
8
|
+
* with 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,
|
|
13
|
+
* software distributed under the License is distributed on an
|
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
* KIND, either express or implied. See the License for the
|
|
16
|
+
* specific language governing permissions and limitations
|
|
17
|
+
* under the License.
|
|
18
|
+
*/
|
|
19
|
+
import { serializeTargetGroup } from './group.utils.js';
|
|
20
|
+
import { deserializeVoidResponse } from '../../client/client.utils.js';
|
|
21
|
+
import { wrapCommand } from '../command.utils.js';
|
|
22
|
+
import { COMMAND_CODE } from '../command.code.js';
|
|
23
|
+
export const LEAVE_GROUP = {
|
|
24
|
+
code: COMMAND_CODE.LeaveGroup,
|
|
25
|
+
serialize: ({ streamId, topicId, groupId }) => {
|
|
26
|
+
return serializeTargetGroup(streamId, topicId, groupId);
|
|
27
|
+
},
|
|
28
|
+
deserialize: deserializeVoidResponse
|
|
29
|
+
};
|
|
30
|
+
export const leaveGroup = wrapCommand(LEAVE_GROUP);
|
|
31
|
+
//# sourceMappingURL=leave-group.command.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
* or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information
|
|
5
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
* to you under the Apache License, Version 2.0 (the
|
|
7
|
+
* "License"); you may not use this file except in compliance
|
|
8
|
+
* with 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,
|
|
13
|
+
* software distributed under the License is distributed on an
|
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
* KIND, either express or implied. See the License for the
|
|
16
|
+
* specific language governing permissions and limitations
|
|
17
|
+
* under the License.
|
|
18
|
+
*/
|
|
19
|
+
export declare const translateErrorCode: (code: number) => string;
|
|
20
|
+
//# sourceMappingURL=error.code.d.ts.map
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
* or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information
|
|
5
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
* to you under the Apache License, Version 2.0 (the
|
|
7
|
+
* "License"); you may not use this file except in compliance
|
|
8
|
+
* with 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,
|
|
13
|
+
* software distributed under the License is distributed on an
|
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
* KIND, either express or implied. See the License for the
|
|
16
|
+
* specific language governing permissions and limitations
|
|
17
|
+
* under the License.
|
|
18
|
+
*/
|
|
19
|
+
export const translateErrorCode = (code) => {
|
|
20
|
+
switch (code.toString()) {
|
|
21
|
+
case '1': return "Error";
|
|
22
|
+
case '2': return "Invalid configuration";
|
|
23
|
+
case '3': return "Invalid command";
|
|
24
|
+
case '4': return "Invalid format";
|
|
25
|
+
case '5': return "Feature is unavailable";
|
|
26
|
+
case '6': return "Invalid identifier";
|
|
27
|
+
case '7': return "Invalid version: {0}";
|
|
28
|
+
case '8': return "Disconnected";
|
|
29
|
+
case '9': return "Cannot establish connection";
|
|
30
|
+
case '10': return "Cannot create base directory, Path: {0}";
|
|
31
|
+
case '11': return "Cannot create runtime directory, Path: {0}";
|
|
32
|
+
case '12': return "Cannot remove runtime directory, Path: {0}";
|
|
33
|
+
case '13': return "Cannot create state directory, Path: {0}";
|
|
34
|
+
case '14': return "State file not found";
|
|
35
|
+
case '15': return "State file corrupted";
|
|
36
|
+
case '16': return "Invalid state entry checksum: {0}, expected: {1}, for index: {2}";
|
|
37
|
+
case '19': return "Cannot open database, Path: {0}";
|
|
38
|
+
case '20': return "Resource with key: {0} was not found.";
|
|
39
|
+
case '30': return "Stale client";
|
|
40
|
+
case '31': return "TCP error";
|
|
41
|
+
case '32': return "QUIC error";
|
|
42
|
+
case '33': return "Invalid server address";
|
|
43
|
+
case '34': return "Invalid client address";
|
|
44
|
+
case '40': return "Unauthenticated";
|
|
45
|
+
case '41': return "Unauthorized";
|
|
46
|
+
case '42': return "Invalid credentials";
|
|
47
|
+
case '43': return "Invalid username";
|
|
48
|
+
case '44': return "Invalid password";
|
|
49
|
+
case '45': return "Invalid user status";
|
|
50
|
+
case '46': return "User already exists";
|
|
51
|
+
case '47': return "User inactive";
|
|
52
|
+
case '48': return "Cannot delete user with ID: {0}";
|
|
53
|
+
case '49': return "Cannot change permissions for user with ID: {0}";
|
|
54
|
+
case '50': return "Invalid personal access token name";
|
|
55
|
+
case '51': return "Personal access token: {0} for user with ID: {1} already exists";
|
|
56
|
+
case '52': return "User with ID: {0} has reached the maximum number of personal access tokens: {1}";
|
|
57
|
+
case '53': return "Invalid personal access token";
|
|
58
|
+
case '54': return "Personal access token: {0} for user with ID: {1} has expired.";
|
|
59
|
+
case '55': return "Users limit reached.";
|
|
60
|
+
case '61': return "Not connected";
|
|
61
|
+
case '63': return "Client shutdown";
|
|
62
|
+
case '64': return "Invalid TLS domain";
|
|
63
|
+
case '65': return "Invalid TLS certificate path";
|
|
64
|
+
case '66': return "Invalid TLS certificate";
|
|
65
|
+
case '67': return "Failed to add certificate";
|
|
66
|
+
case '70': return "Invalid encryption key";
|
|
67
|
+
case '71': return "Cannot encrypt data";
|
|
68
|
+
case '72': return "Cannot decrypt data";
|
|
69
|
+
case '73': return "Invalid JWT algorithm: {0}";
|
|
70
|
+
case '74': return "Invalid JWT secret";
|
|
71
|
+
case '75': return "JWT is missing";
|
|
72
|
+
case '76': return "Cannot generate JWT";
|
|
73
|
+
case '77': return "Access token is missing";
|
|
74
|
+
case '78': return "Invalid access token";
|
|
75
|
+
case '80': return "Invalid size bytes";
|
|
76
|
+
case '81': return "Invalid UTF-8";
|
|
77
|
+
case '82': return "Invalid number encoding";
|
|
78
|
+
case '83': return "Invalid boolean value";
|
|
79
|
+
case '84': return "Invalid number value";
|
|
80
|
+
case '100': return "Client with ID: {0} was not found.";
|
|
81
|
+
case '101': return "Invalid client ID";
|
|
82
|
+
case '206': return "Connection closed";
|
|
83
|
+
case '209': return "Cannot parse header kind from {0}";
|
|
84
|
+
case '300': return "HTTP response error, status: {0}, body: {1}";
|
|
85
|
+
case '301': return "Invalid HTTP request";
|
|
86
|
+
case '302': return "Invalid JSON response";
|
|
87
|
+
case '303': return "Invalid bytes response";
|
|
88
|
+
case '304': return "Empty response";
|
|
89
|
+
case '305': return "Cannot create endpoint";
|
|
90
|
+
case '306': return "Cannot parse URL";
|
|
91
|
+
// STREAM
|
|
92
|
+
case '1000': return "Cannot create streams directory, Path: {0}";
|
|
93
|
+
case '1001': return "Cannot create stream with ID: {0} directory, Path: {1}";
|
|
94
|
+
case '1002': return "Failed to create stream info file for stream with ID: {0}";
|
|
95
|
+
case '1003': return "Failed to update stream info for stream with ID: {0}";
|
|
96
|
+
case '1004': return "Failed to open stream info file for stream with ID: {0}";
|
|
97
|
+
case '1005': return "Failed to read stream info file for stream with ID: {0}";
|
|
98
|
+
case '1006': return "Failed to create stream with ID: {0}";
|
|
99
|
+
case '1007': return "Failed to delete stream with ID: {0}";
|
|
100
|
+
case '1008': return "Failed to delete stream directory with ID: {0}";
|
|
101
|
+
case '1009': return "Stream with ID: {0} was not found.";
|
|
102
|
+
case '1010': return "Stream with name: {0} was not found.";
|
|
103
|
+
case '1011': return "Stream with ID: {0} already exists.";
|
|
104
|
+
case '1012': return "Stream with name: {0} already exists.";
|
|
105
|
+
case '1013': return "Invalid stream name";
|
|
106
|
+
case '1014': return "Invalid stream ID";
|
|
107
|
+
case '1015': return "Cannot read streams";
|
|
108
|
+
case '1016': return "Missing streams";
|
|
109
|
+
case '1017': return "Missing topics for stream with ID: {0}";
|
|
110
|
+
case '1018': return "Missing partitions for topic with ID: {0} for stream with ID: {1}.";
|
|
111
|
+
case '1019': return "Max topic size cannot be lower than segment size. Max topic size: {0} < segment size: {1}.";
|
|
112
|
+
case '2000': return "Cannot create topics directory for stream with ID: {0}, Path: {1}";
|
|
113
|
+
case '2001': return "Failed to create directory for topic with ID: {0} for stream with ID: {1}, Path: {2}";
|
|
114
|
+
case '2002': return "Failed to create topic info file for topic with ID: {0} for stream with ID: {1}.";
|
|
115
|
+
case '2003': return "Failed to update topic info for topic with ID: {0} for stream with ID: {1}.";
|
|
116
|
+
case '2004': return "Failed to open topic info file for topic with ID: {0} for stream with ID: {1}.";
|
|
117
|
+
case '2005': return "Failed to read topic info file for topic with ID: {0} for stream with ID: {1}.";
|
|
118
|
+
case '2006': return "Failed to create topic with ID: {0} for stream with ID: {1}.";
|
|
119
|
+
case '2007': return "Failed to delete topic with ID: {0} for stream with ID: {1}.";
|
|
120
|
+
case '2008': return "Failed to delete topic directory with ID: {0} for stream with ID: {1}, Path: {2}";
|
|
121
|
+
case '2009': return "Cannot poll topic";
|
|
122
|
+
case '2010': return "Topic with ID: {0} for stream with ID: {1} was not found.";
|
|
123
|
+
case '2011': return "Topic with name: {0} for stream with ID: {1} was not found.";
|
|
124
|
+
case '2012': return "Topic with ID: {0} for stream with ID: {1} already exists.";
|
|
125
|
+
case '2013': return "Topic with name: {0} for stream with ID: {1} already exists.";
|
|
126
|
+
case '2014': return "Invalid topic name";
|
|
127
|
+
case '2015': return "Too many partitions";
|
|
128
|
+
case '2016': return "Invalid topic ID";
|
|
129
|
+
case '2017': return "Cannot read topics for stream with ID: {0}";
|
|
130
|
+
case '2018': return "Invalid replication factor";
|
|
131
|
+
// TOPIC
|
|
132
|
+
case '3000': return "Cannot create partition with ID: {0} for stream with ID: {1} and topic with ID: {2}";
|
|
133
|
+
case '3001': return "Failed to create directory for partitions for stream with ID: {0} and topic with ID: {1}";
|
|
134
|
+
case '3002': return "Failed to create directory for partition with ID: {0} for stream with ID: {1} and topic with ID: {2}";
|
|
135
|
+
case '3003': return "Cannot open partition log file";
|
|
136
|
+
case '3004': return "Cannot read partitions directories.";
|
|
137
|
+
case '3005': return "Failed to delete partition with ID: {0} for stream with ID: {1} and topic with ID: {2}";
|
|
138
|
+
case '3006': return "Failed to delete partition directory with ID: {0} for stream with ID: {1} and topic with ID: {2}";
|
|
139
|
+
case '3007': return "Partition with ID: {0} for topic with ID: {1} for stream with ID: {2} was not found.";
|
|
140
|
+
case '3008': return "Topic with ID: {0} for stream with ID: {1} has no partitions.";
|
|
141
|
+
case '3009': return "Cannot read partitions for topic with ID: {0} for stream with ID: {1}";
|
|
142
|
+
case '3010': return "Failed to delete consumer offsets directory for path: {0}";
|
|
143
|
+
case '3011': return "Failed to delete consumer offset file for path: {0}";
|
|
144
|
+
case '3012': return "Failed to create consumer offsets directory for path: {0}";
|
|
145
|
+
case '3020': return "Failed to read consumers offsets from path: {0}";
|
|
146
|
+
case '3021': return "Consumer offset for consumer with ID: {0} was not found.";
|
|
147
|
+
// MESSAGE
|
|
148
|
+
case '4000': return "Segment not found";
|
|
149
|
+
case '4001': return "Segment with start offset: {0} and partition with ID: {1} is closed";
|
|
150
|
+
case '4002': return "Segment size is invalid";
|
|
151
|
+
case '4003': return "Failed to create segment log file for Path: {0}.";
|
|
152
|
+
case '4004': return "Failed to create segment index file for Path: {0}.";
|
|
153
|
+
case '4005': return "Failed to create segment time index file for Path: {0}.";
|
|
154
|
+
case '4006': return "Cannot save messages to segment.";
|
|
155
|
+
case '4007': return "Cannot save index to segment.";
|
|
156
|
+
case '4008': return "Cannot save time index to segment.";
|
|
157
|
+
case '4009': return "Invalid messages count";
|
|
158
|
+
case '4010': return "Cannot append message";
|
|
159
|
+
case '4011': return "Cannot read message";
|
|
160
|
+
case '4012': return "Cannot read message ID";
|
|
161
|
+
case '4013': return "Cannot read message state";
|
|
162
|
+
case '4014': return "Cannot read message timestamp";
|
|
163
|
+
case '4015': return "Cannot read headers length";
|
|
164
|
+
case '4016': return "Cannot read headers payload";
|
|
165
|
+
case '4017': return "Too big headers payload";
|
|
166
|
+
case '4018': return "Invalid header key";
|
|
167
|
+
case '4019': return "Invalid header value";
|
|
168
|
+
case '4020': return "Cannot read message length";
|
|
169
|
+
case '4021': return "Cannot save messages to segment";
|
|
170
|
+
case '4022': return "Too big message payload";
|
|
171
|
+
case '4023': return "Too many messages";
|
|
172
|
+
case '4024': return "Empty message payload";
|
|
173
|
+
case '4025': return "Invalid message payload length";
|
|
174
|
+
case '4026': return "Cannot read message checksum";
|
|
175
|
+
case '4027': return "Invalid message checksum: {0}, expected: {1}, for offset: {2}";
|
|
176
|
+
case '4028': return "Cannot append message to segment at offset: {0}";
|
|
177
|
+
// STORAGE
|
|
178
|
+
case '5000': return "File not found";
|
|
179
|
+
case '5001': return "Failed to open file";
|
|
180
|
+
case '5002': return "Failed to write file";
|
|
181
|
+
case '5003': return "Failed to close file";
|
|
182
|
+
case '5004': return "Failed to delete file";
|
|
183
|
+
case '5005': return "Cannot read file";
|
|
184
|
+
case '5006': return "Invalid file size";
|
|
185
|
+
case '5007': return "Cannot create file";
|
|
186
|
+
case '5008': return "Cannot rename file";
|
|
187
|
+
case '5009': return "Cannot get file info";
|
|
188
|
+
case '5010': return "Failed to create directory for file";
|
|
189
|
+
case '5011': return "Failed to create file for {0}";
|
|
190
|
+
case '5012': return "Failed to create backup for {0}";
|
|
191
|
+
case '5013': return "Failed to create file path for backup file: {0}";
|
|
192
|
+
case '5014': return "Failed to backup file: {0}";
|
|
193
|
+
case '5015': return "Failed to restore file: {0}";
|
|
194
|
+
case '5016': return "Failed to restore file path for backup file: {0}";
|
|
195
|
+
case '5017': return "Failed to delete backup file: {0}";
|
|
196
|
+
case '5018': return "Failed to delete directory for file: {0}";
|
|
197
|
+
case '5019': return "Failed to delete file: {0}";
|
|
198
|
+
case '5020': return "Failed to copy file: {0}";
|
|
199
|
+
default: return 'error';
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
//# sourceMappingURL=error.code.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
* or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information
|
|
5
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
* to you under the Apache License, Version 2.0 (the
|
|
7
|
+
* "License"); you may not use this file except in compliance
|
|
8
|
+
* with 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,
|
|
13
|
+
* software distributed under the License is distributed on an
|
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
* KIND, either express or implied. See the License for the
|
|
16
|
+
* specific language governing permissions and limitations
|
|
17
|
+
* under the License.
|
|
18
|
+
*/
|
|
19
|
+
export declare const responseError: (cmdCode: number, errCode: number) => Error;
|
|
20
|
+
//# sourceMappingURL=error.utils.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
* or more contributor license agreements. See the NOTICE file
|
|
4
|
+
* distributed with this work for additional information
|
|
5
|
+
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
* to you under the Apache License, Version 2.0 (the
|
|
7
|
+
* "License"); you may not use this file except in compliance
|
|
8
|
+
* with 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,
|
|
13
|
+
* software distributed under the License is distributed on an
|
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
* KIND, either express or implied. See the License for the
|
|
16
|
+
* specific language governing permissions and limitations
|
|
17
|
+
* under the License.
|
|
18
|
+
*/
|
|
19
|
+
import { translateCommandCode } from './command.code.js';
|
|
20
|
+
import { translateErrorCode } from './error.code.js';
|
|
21
|
+
export const responseError = (cmdCode, errCode) => new Error(`command: { code: ${cmdCode}, name: ${translateCommandCode(cmdCode)} } ` +
|
|
22
|
+
`error: {code: ${errCode}, message: ${translateErrorCode(errCode)} }`);
|
|
23
|
+
//# sourceMappingURL=error.utils.js.map
|