apache-iggy 0.8.0 → 0.8.1-edge.2
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 +1 -1
- package/NOTICE +12 -0
- package/README.md +14 -0
- package/dist/client/client.connection.d.ts +0 -18
- package/dist/client/client.connection.js +17 -18
- package/dist/client/client.d.ts +0 -18
- package/dist/client/client.debug.d.ts +0 -18
- package/dist/client/client.debug.js +17 -18
- package/dist/client/client.js +17 -18
- package/dist/client/client.socket.d.ts +1 -19
- package/dist/client/client.socket.js +17 -18
- package/dist/client/client.type.d.ts +0 -18
- package/dist/client/client.type.js +17 -18
- package/dist/client/client.utils.d.ts +1 -18
- package/dist/client/client.utils.js +19 -19
- package/dist/client/client.utils.test.d.ts +2 -0
- package/dist/client/client.utils.test.js +58 -0
- package/dist/client/index.d.ts +0 -18
- package/dist/client/index.js +17 -18
- package/dist/client.e2e.d.ts +0 -18
- package/dist/client.e2e.js +17 -18
- package/dist/debug-send.d.ts +0 -18
- package/dist/debug-send.js +17 -18
- package/dist/debug.d.ts +0 -18
- package/dist/debug.js +17 -18
- package/dist/e2e/tcp.client.e2e.d.ts +0 -18
- package/dist/e2e/tcp.client.e2e.js +17 -18
- package/dist/e2e/tcp.cluster.e2e.d.ts +0 -18
- package/dist/e2e/tcp.cluster.e2e.js +17 -18
- package/dist/e2e/tcp.consumer-group.e2e.d.ts +0 -18
- package/dist/e2e/tcp.consumer-group.e2e.js +17 -18
- package/dist/e2e/tcp.consumer-stream.e2e.d.ts +0 -18
- package/dist/e2e/tcp.consumer-stream.e2e.js +17 -18
- package/dist/e2e/tcp.parallel.e2e.d.ts +0 -18
- package/dist/e2e/tcp.parallel.e2e.js +17 -18
- package/dist/e2e/tcp.raw.e2e.d.ts +2 -0
- package/dist/e2e/tcp.raw.e2e.js +42 -0
- package/dist/e2e/tcp.send-message.e2e.d.ts +0 -18
- package/dist/e2e/tcp.send-message.e2e.js +17 -18
- package/dist/e2e/tcp.stream.e2e.d.ts +0 -18
- package/dist/e2e/tcp.stream.e2e.js +17 -18
- package/dist/e2e/tcp.system.e2e.d.ts +0 -18
- package/dist/e2e/tcp.system.e2e.js +17 -18
- package/dist/e2e/tcp.token.e2e.d.ts +0 -18
- package/dist/e2e/tcp.token.e2e.js +17 -18
- package/dist/e2e/tcp.topic.e2e.d.ts +0 -18
- package/dist/e2e/tcp.topic.e2e.js +17 -18
- package/dist/e2e/tcp.user.e2e.d.ts +0 -18
- package/dist/e2e/tcp.user.e2e.js +51 -21
- package/dist/e2e/test-client.utils.d.ts +0 -18
- package/dist/e2e/test-client.utils.js +17 -18
- package/dist/e2e/tls.system.e2e.d.ts +0 -18
- package/dist/e2e/tls.system.e2e.js +17 -18
- package/dist/index.d.ts +0 -18
- package/dist/index.js +17 -18
- package/dist/stream/consumer-stream.d.ts +0 -18
- package/dist/stream/consumer-stream.js +17 -18
- package/dist/stream/index.d.ts +0 -18
- package/dist/stream/index.js +17 -18
- package/dist/tcp.e2e.d.ts +0 -18
- package/dist/tcp.e2e.js +17 -18
- package/dist/tcp.sm.utils.d.ts +0 -18
- package/dist/tcp.sm.utils.js +17 -18
- package/dist/tls.system.e2e.d.ts +0 -18
- package/dist/tls.system.e2e.js +17 -18
- package/dist/type.utils.d.ts +0 -18
- package/dist/type.utils.js +17 -18
- package/dist/wire/client/client.utils.d.ts +0 -18
- package/dist/wire/client/client.utils.js +17 -18
- package/dist/wire/client/get-client.command.d.ts +0 -18
- package/dist/wire/client/get-client.command.js +17 -18
- package/dist/wire/client/get-clients.command.d.ts +0 -18
- package/dist/wire/client/get-clients.command.js +17 -18
- package/dist/wire/client/get-me.command.d.ts +0 -18
- package/dist/wire/client/get-me.command.js +17 -18
- package/dist/wire/client/index.d.ts +0 -18
- package/dist/wire/client/index.js +17 -18
- package/dist/wire/cluster/cluster.type.d.ts +2 -20
- package/dist/wire/cluster/cluster.type.js +17 -18
- package/dist/wire/cluster/cluster.utils.d.ts +0 -18
- package/dist/wire/cluster/cluster.utils.js +17 -18
- package/dist/wire/cluster/get-cluster-metadata.command.d.ts +0 -18
- package/dist/wire/cluster/get-cluster-metadata.command.js +17 -18
- package/dist/wire/cluster/index.d.ts +0 -18
- package/dist/wire/cluster/index.js +17 -18
- package/dist/wire/command-set.d.ts +9 -18
- package/dist/wire/command-set.js +42 -19
- package/dist/wire/command-set.test.d.ts +2 -0
- package/dist/wire/command-set.test.js +93 -0
- package/dist/wire/command.code.d.ts +2 -18
- package/dist/wire/command.code.js +19 -18
- package/dist/wire/command.utils.d.ts +0 -18
- package/dist/wire/command.utils.js +17 -18
- package/dist/wire/consumer-group/create-group.command.d.ts +0 -18
- package/dist/wire/consumer-group/create-group.command.js +17 -18
- package/dist/wire/consumer-group/create-group.command.test.d.ts +0 -18
- package/dist/wire/consumer-group/create-group.command.test.js +17 -18
- package/dist/wire/consumer-group/delete-group.command.d.ts +0 -18
- package/dist/wire/consumer-group/delete-group.command.js +17 -18
- package/dist/wire/consumer-group/ensure-group.virtual.command.d.ts +0 -18
- package/dist/wire/consumer-group/ensure-group.virtual.command.js +17 -18
- package/dist/wire/consumer-group/get-group.command.d.ts +0 -18
- package/dist/wire/consumer-group/get-group.command.js +17 -18
- package/dist/wire/consumer-group/get-groups.command.d.ts +0 -18
- package/dist/wire/consumer-group/get-groups.command.js +17 -18
- package/dist/wire/consumer-group/group.command.test.d.ts +0 -18
- package/dist/wire/consumer-group/group.command.test.js +17 -18
- package/dist/wire/consumer-group/group.utils.d.ts +0 -18
- package/dist/wire/consumer-group/group.utils.js +17 -18
- package/dist/wire/consumer-group/index.d.ts +0 -18
- package/dist/wire/consumer-group/index.js +17 -18
- package/dist/wire/consumer-group/join-group.command.d.ts +0 -18
- package/dist/wire/consumer-group/join-group.command.js +17 -18
- package/dist/wire/consumer-group/leave-group.command.d.ts +0 -18
- package/dist/wire/consumer-group/leave-group.command.js +17 -18
- package/dist/wire/error.code.d.ts +0 -18
- package/dist/wire/error.code.js +17 -18
- package/dist/wire/error.utils.d.ts +0 -18
- package/dist/wire/error.utils.js +17 -18
- package/dist/wire/identifier.utils.d.ts +0 -18
- package/dist/wire/identifier.utils.js +17 -18
- package/dist/wire/identifier.utils.test.d.ts +0 -18
- package/dist/wire/identifier.utils.test.js +17 -18
- package/dist/wire/index.d.ts +0 -18
- package/dist/wire/index.js +17 -18
- package/dist/wire/message/flush-unsaved-buffers.command.d.ts +0 -18
- package/dist/wire/message/flush-unsaved-buffers.command.js +17 -18
- package/dist/wire/message/header.type.d.ts +1 -19
- package/dist/wire/message/header.type.js +17 -18
- package/dist/wire/message/header.utils.d.ts +0 -18
- package/dist/wire/message/header.utils.js +17 -18
- package/dist/wire/message/header.utils.test.d.ts +0 -18
- package/dist/wire/message/header.utils.test.js +17 -18
- package/dist/wire/message/iggy-header.utils.d.ts +0 -18
- package/dist/wire/message/iggy-header.utils.js +17 -18
- package/dist/wire/message/index.d.ts +0 -18
- package/dist/wire/message/index.js +17 -18
- package/dist/wire/message/message.utils.d.ts +0 -18
- package/dist/wire/message/message.utils.js +17 -18
- package/dist/wire/message/partitioning.utils.d.ts +0 -18
- package/dist/wire/message/partitioning.utils.js +17 -18
- package/dist/wire/message/poll-messages.command.d.ts +0 -18
- package/dist/wire/message/poll-messages.command.js +17 -18
- package/dist/wire/message/poll.utils.d.ts +0 -18
- package/dist/wire/message/poll.utils.js +17 -18
- package/dist/wire/message/send-messages.command.d.ts +0 -18
- package/dist/wire/message/send-messages.command.js +19 -20
- package/dist/wire/message/send-messages.command.test.d.ts +0 -18
- package/dist/wire/message/send-messages.command.test.js +35 -18
- package/dist/wire/number.utils.d.ts +0 -18
- package/dist/wire/number.utils.js +17 -18
- package/dist/wire/offset/delete-offset.command.d.ts +0 -18
- package/dist/wire/offset/delete-offset.command.js +17 -18
- package/dist/wire/offset/get-offset.command.d.ts +0 -18
- package/dist/wire/offset/get-offset.command.js +17 -18
- package/dist/wire/offset/index.d.ts +0 -18
- package/dist/wire/offset/index.js +17 -18
- package/dist/wire/offset/offset.utils.d.ts +0 -18
- package/dist/wire/offset/offset.utils.js +17 -18
- package/dist/wire/offset/store-offset.command.d.ts +0 -18
- package/dist/wire/offset/store-offset.command.js +17 -18
- package/dist/wire/partition/create-partition.command.d.ts +0 -18
- package/dist/wire/partition/create-partition.command.js +17 -18
- package/dist/wire/partition/delete-partition.command.d.ts +0 -18
- package/dist/wire/partition/delete-partition.command.js +17 -18
- package/dist/wire/partition/index.d.ts +0 -18
- package/dist/wire/partition/index.js +17 -18
- package/dist/wire/partition/partition.utils.d.ts +0 -18
- package/dist/wire/partition/partition.utils.js +17 -18
- package/dist/wire/partition/partition.utils.test.d.ts +0 -18
- package/dist/wire/partition/partition.utils.test.js +17 -18
- package/dist/wire/segment/delete-segments.command.d.ts +0 -18
- package/dist/wire/segment/delete-segments.command.js +17 -18
- package/dist/wire/segment/index.d.ts +0 -18
- package/dist/wire/segment/index.js +17 -18
- package/dist/wire/segment/segment.utils.d.ts +0 -18
- package/dist/wire/segment/segment.utils.js +17 -18
- package/dist/wire/serialize.utils.d.ts +0 -18
- package/dist/wire/serialize.utils.js +17 -18
- package/dist/wire/session/index.d.ts +0 -18
- package/dist/wire/session/index.js +17 -18
- package/dist/wire/session/login-with-token.command.d.ts +0 -18
- package/dist/wire/session/login-with-token.command.js +17 -18
- package/dist/wire/session/login-with-token.command.test.d.ts +0 -18
- package/dist/wire/session/login-with-token.command.test.js +17 -18
- package/dist/wire/session/login.command.d.ts +0 -18
- package/dist/wire/session/login.command.js +17 -18
- package/dist/wire/session/login.command.test.d.ts +0 -18
- package/dist/wire/session/login.command.test.js +17 -18
- package/dist/wire/session/login.utils.d.ts +0 -18
- package/dist/wire/session/login.utils.js +17 -18
- package/dist/wire/session/logout.command.d.ts +0 -18
- package/dist/wire/session/logout.command.js +17 -18
- package/dist/wire/stream/create-stream.command.d.ts +0 -18
- package/dist/wire/stream/create-stream.command.js +17 -18
- package/dist/wire/stream/create-stream.command.test.d.ts +0 -18
- package/dist/wire/stream/create-stream.command.test.js +17 -18
- package/dist/wire/stream/delete-stream.command.d.ts +0 -18
- package/dist/wire/stream/delete-stream.command.js +17 -18
- package/dist/wire/stream/ensure-stream.virtual.command.d.ts +0 -18
- package/dist/wire/stream/ensure-stream.virtual.command.js +17 -18
- package/dist/wire/stream/get-stream.command.d.ts +0 -18
- package/dist/wire/stream/get-stream.command.js +17 -18
- package/dist/wire/stream/get-streams.command.d.ts +0 -18
- package/dist/wire/stream/get-streams.command.js +17 -18
- package/dist/wire/stream/index.d.ts +0 -18
- package/dist/wire/stream/index.js +17 -18
- package/dist/wire/stream/purge-stream.command.d.ts +0 -18
- package/dist/wire/stream/purge-stream.command.js +17 -18
- package/dist/wire/stream/stream.utils.d.ts +0 -18
- package/dist/wire/stream/stream.utils.js +17 -18
- package/dist/wire/stream/update-stream.command.d.ts +0 -18
- package/dist/wire/stream/update-stream.command.js +17 -18
- package/dist/wire/system/get-stats.command.d.ts +0 -18
- package/dist/wire/system/get-stats.command.js +17 -18
- package/dist/wire/system/index.d.ts +0 -18
- package/dist/wire/system/index.js +17 -18
- package/dist/wire/system/ping.command.d.ts +0 -18
- package/dist/wire/system/ping.command.js +17 -18
- package/dist/wire/token/create-token.command.d.ts +0 -18
- package/dist/wire/token/create-token.command.js +17 -18
- package/dist/wire/token/create-token.command.test.d.ts +0 -18
- package/dist/wire/token/create-token.command.test.js +17 -18
- package/dist/wire/token/delete-token.command.d.ts +0 -18
- package/dist/wire/token/delete-token.command.js +17 -18
- package/dist/wire/token/delete-token.command.test.d.ts +0 -18
- package/dist/wire/token/delete-token.command.test.js +17 -18
- package/dist/wire/token/get-tokens.command.d.ts +0 -18
- package/dist/wire/token/get-tokens.command.js +17 -18
- package/dist/wire/token/index.d.ts +0 -18
- package/dist/wire/token/index.js +17 -18
- package/dist/wire/token/token.utils.d.ts +0 -18
- package/dist/wire/token/token.utils.js +17 -18
- package/dist/wire/topic/create-topic.command.d.ts +0 -18
- package/dist/wire/topic/create-topic.command.js +17 -18
- package/dist/wire/topic/create-topic.command.test.d.ts +0 -18
- package/dist/wire/topic/create-topic.command.test.js +17 -18
- package/dist/wire/topic/delete-topic.command.d.ts +0 -18
- package/dist/wire/topic/delete-topic.command.js +17 -18
- package/dist/wire/topic/ensure-topic.virtual.command.d.ts +0 -18
- package/dist/wire/topic/ensure-topic.virtual.command.js +17 -18
- package/dist/wire/topic/get-topic.command.d.ts +0 -18
- package/dist/wire/topic/get-topic.command.js +17 -18
- package/dist/wire/topic/get-topics.command.d.ts +0 -18
- package/dist/wire/topic/get-topics.command.js +17 -18
- package/dist/wire/topic/index.d.ts +0 -18
- package/dist/wire/topic/index.js +17 -18
- package/dist/wire/topic/purge-topic.command.d.ts +0 -18
- package/dist/wire/topic/purge-topic.command.js +17 -18
- package/dist/wire/topic/topic.utils.d.ts +0 -18
- package/dist/wire/topic/topic.utils.js +17 -18
- package/dist/wire/topic/update-topic.command.d.ts +0 -18
- package/dist/wire/topic/update-topic.command.js +17 -18
- package/dist/wire/user/change-password.command.d.ts +0 -18
- package/dist/wire/user/change-password.command.js +17 -18
- package/dist/wire/user/create-user.command.d.ts +0 -18
- package/dist/wire/user/create-user.command.js +25 -21
- package/dist/wire/user/create-user.command.test.d.ts +0 -18
- package/dist/wire/user/create-user.command.test.js +45 -22
- package/dist/wire/user/delete-user.command.d.ts +0 -18
- package/dist/wire/user/delete-user.command.js +17 -18
- package/dist/wire/user/get-user.command.d.ts +0 -18
- package/dist/wire/user/get-user.command.js +17 -18
- package/dist/wire/user/get-users.command.d.ts +0 -18
- package/dist/wire/user/get-users.command.js +17 -18
- package/dist/wire/user/index.d.ts +0 -18
- package/dist/wire/user/index.js +17 -18
- package/dist/wire/user/permissions.utils.d.ts +2 -21
- package/dist/wire/user/permissions.utils.js +48 -48
- package/dist/wire/user/permissions.utils.test.d.ts +0 -18
- package/dist/wire/user/permissions.utils.test.js +106 -36
- package/dist/wire/user/update-permissions.command.d.ts +0 -18
- package/dist/wire/user/update-permissions.command.js +17 -18
- package/dist/wire/user/update-user.command.d.ts +0 -18
- package/dist/wire/user/update-user.command.js +17 -18
- package/dist/wire/user/user.utils.d.ts +0 -18
- package/dist/wire/user/user.utils.js +17 -18
- package/dist/wire/uuid.utils.d.ts +0 -18
- package/dist/wire/uuid.utils.js +17 -18
- package/package.json +12 -10
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*/
|
|
1
|
+
// Licensed to the Apache Software Foundation (ASF) under one
|
|
2
|
+
// or more contributor license agreements. See the NOTICE file
|
|
3
|
+
// distributed with this work for additional information
|
|
4
|
+
// regarding copyright ownership. The ASF licenses this file
|
|
5
|
+
// to you under the Apache License, Version 2.0 (the
|
|
6
|
+
// "License"); you may not use this file except in compliance
|
|
7
|
+
// with 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,
|
|
12
|
+
// software distributed under the License is distributed on an
|
|
13
|
+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
// KIND, either express or implied. See the License for the
|
|
15
|
+
// specific language governing permissions and limitations
|
|
16
|
+
// under the License.
|
|
17
|
+
//
|
|
19
18
|
import { deserializeClient } from './client.utils.js';
|
|
20
19
|
import { wrapCommand } from '../command.utils.js';
|
|
21
20
|
import { COMMAND_CODE } from '../command.code.js';
|
|
@@ -1,21 +1,3 @@
|
|
|
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
1
|
export * from './get-client.command.js';
|
|
20
2
|
export * from './get-clients.command.js';
|
|
21
3
|
export * from './get-me.command.js';
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*/
|
|
1
|
+
// Licensed to the Apache Software Foundation (ASF) under one
|
|
2
|
+
// or more contributor license agreements. See the NOTICE file
|
|
3
|
+
// distributed with this work for additional information
|
|
4
|
+
// regarding copyright ownership. The ASF licenses this file
|
|
5
|
+
// to you under the Apache License, Version 2.0 (the
|
|
6
|
+
// "License"); you may not use this file except in compliance
|
|
7
|
+
// with 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,
|
|
12
|
+
// software distributed under the License is distributed on an
|
|
13
|
+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
// KIND, either express or implied. See the License for the
|
|
15
|
+
// specific language governing permissions and limitations
|
|
16
|
+
// under the License.
|
|
17
|
+
//
|
|
19
18
|
export * from './get-client.command.js';
|
|
20
19
|
export * from './get-clients.command.js';
|
|
21
20
|
export * from './get-me.command.js';
|
|
@@ -1,21 +1,3 @@
|
|
|
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
1
|
import { type ValueOf } from "../../type.utils.js";
|
|
20
2
|
export declare const ClusterNodeRole: {
|
|
21
3
|
readonly Leader: 0;
|
|
@@ -35,7 +17,7 @@ export declare const ClusterNodeStatus: {
|
|
|
35
17
|
export type ClusterNodeStatus = typeof ClusterNodeStatus;
|
|
36
18
|
export type ClusterNodeStatusKey = keyof ClusterNodeStatus;
|
|
37
19
|
export type ClusterNodeStatusValue = ValueOf<ClusterNodeStatus>;
|
|
38
|
-
export declare const ReverseClusterNodeStatus: Record<0 |
|
|
20
|
+
export declare const ReverseClusterNodeStatus: Record<0 | 2 | 1 | 4 | 3, "Healthy" | "Starting" | "Stopping" | "Unreachable" | "Maintenance">;
|
|
39
21
|
export declare const TransportProtocol: {
|
|
40
22
|
readonly TCP: 1;
|
|
41
23
|
readonly QUIC: 2;
|
|
@@ -45,7 +27,7 @@ export declare const TransportProtocol: {
|
|
|
45
27
|
export type TransportProtocol = typeof TransportProtocol;
|
|
46
28
|
export type TransportProtocolKey = keyof TransportProtocol;
|
|
47
29
|
export type TransportProtocolValue = ValueOf<TransportProtocol>;
|
|
48
|
-
export declare const ReverseTransportProtocol: Record<
|
|
30
|
+
export declare const ReverseTransportProtocol: Record<2 | 1 | 4 | 3, "TCP" | "QUIC" | "HTTP" | "WebSocket">;
|
|
49
31
|
export declare const isClusterNodeRole: (n: number) => n is ClusterNodeRoleValue;
|
|
50
32
|
export declare const isClusterNodeStatus: (n: number) => n is ClusterNodeStatusValue;
|
|
51
33
|
export declare const isTransportProtocol: (n: number) => n is TransportProtocolValue;
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*/
|
|
1
|
+
// Licensed to the Apache Software Foundation (ASF) under one
|
|
2
|
+
// or more contributor license agreements. See the NOTICE file
|
|
3
|
+
// distributed with this work for additional information
|
|
4
|
+
// regarding copyright ownership. The ASF licenses this file
|
|
5
|
+
// to you under the Apache License, Version 2.0 (the
|
|
6
|
+
// "License"); you may not use this file except in compliance
|
|
7
|
+
// with 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,
|
|
12
|
+
// software distributed under the License is distributed on an
|
|
13
|
+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
// KIND, either express or implied. See the License for the
|
|
15
|
+
// specific language governing permissions and limitations
|
|
16
|
+
// under the License.
|
|
17
|
+
//
|
|
19
18
|
import { reverseRecord } from "../../type.utils.js";
|
|
20
19
|
export const ClusterNodeRole = {
|
|
21
20
|
Leader: 0,
|
|
@@ -1,21 +1,3 @@
|
|
|
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
1
|
import { type ClusterNodeRoleKey, type ClusterNodeStatusKey } from './cluster.type.js';
|
|
20
2
|
export type TransportEndpoints = {
|
|
21
3
|
tcp: number;
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*/
|
|
1
|
+
// Licensed to the Apache Software Foundation (ASF) under one
|
|
2
|
+
// or more contributor license agreements. See the NOTICE file
|
|
3
|
+
// distributed with this work for additional information
|
|
4
|
+
// regarding copyright ownership. The ASF licenses this file
|
|
5
|
+
// to you under the Apache License, Version 2.0 (the
|
|
6
|
+
// "License"); you may not use this file except in compliance
|
|
7
|
+
// with 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,
|
|
12
|
+
// software distributed under the License is distributed on an
|
|
13
|
+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
// KIND, either express or implied. See the License for the
|
|
15
|
+
// specific language governing permissions and limitations
|
|
16
|
+
// under the License.
|
|
17
|
+
//
|
|
19
18
|
import { deserializeError } from '../error.utils.js';
|
|
20
19
|
import { mapClusterNodeRole, mapClusterNodeStatus, } from './cluster.type.js';
|
|
21
20
|
const CLUSTER_NODE_MIN_BUFFER_SIZE = 18; // 4 + 1 + 4 + 1 + 8 (endpoints) + 1 + 1;
|
|
@@ -1,21 +1,3 @@
|
|
|
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
1
|
import type { CommandResponse } from '../../client/index.js';
|
|
20
2
|
import { type ClusterMetadata } from './cluster.utils.js';
|
|
21
3
|
export declare const GET_CLUSTER_METADATA: {
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*/
|
|
1
|
+
// Licensed to the Apache Software Foundation (ASF) under one
|
|
2
|
+
// or more contributor license agreements. See the NOTICE file
|
|
3
|
+
// distributed with this work for additional information
|
|
4
|
+
// regarding copyright ownership. The ASF licenses this file
|
|
5
|
+
// to you under the Apache License, Version 2.0 (the
|
|
6
|
+
// "License"); you may not use this file except in compliance
|
|
7
|
+
// with 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,
|
|
12
|
+
// software distributed under the License is distributed on an
|
|
13
|
+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
// KIND, either express or implied. See the License for the
|
|
15
|
+
// specific language governing permissions and limitations
|
|
16
|
+
// under the License.
|
|
17
|
+
//
|
|
19
18
|
import { wrapCommand } from '../command.utils.js';
|
|
20
19
|
import { COMMAND_CODE } from '../command.code.js';
|
|
21
20
|
import { deserializeMetadata } from './cluster.utils.js';
|
|
@@ -1,21 +1,3 @@
|
|
|
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
1
|
export * from './get-cluster-metadata.command.js';
|
|
20
2
|
export * from './cluster.type.js';
|
|
21
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*/
|
|
1
|
+
// Licensed to the Apache Software Foundation (ASF) under one
|
|
2
|
+
// or more contributor license agreements. See the NOTICE file
|
|
3
|
+
// distributed with this work for additional information
|
|
4
|
+
// regarding copyright ownership. The ASF licenses this file
|
|
5
|
+
// to you under the Apache License, Version 2.0 (the
|
|
6
|
+
// "License"); you may not use this file except in compliance
|
|
7
|
+
// with 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,
|
|
12
|
+
// software distributed under the License is distributed on an
|
|
13
|
+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
// KIND, either express or implied. See the License for the
|
|
15
|
+
// specific language governing permissions and limitations
|
|
16
|
+
// under the License.
|
|
17
|
+
//
|
|
19
18
|
export * from './get-cluster-metadata.command.js';
|
|
20
19
|
export * from './cluster.type.js';
|
|
21
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,21 +1,3 @@
|
|
|
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
1
|
import type { ClientProvider } from '../client/client.type.js';
|
|
20
2
|
declare const userAPI: (c: ClientProvider) => {
|
|
21
3
|
get: (arg: import("./user/get-user.command.js").GetUser) => Promise<import("./user/user.utils.js").User | null>;
|
|
@@ -125,6 +107,15 @@ export declare abstract class CommandAPI extends AbstractAPI {
|
|
|
125
107
|
system: SystemAPI;
|
|
126
108
|
cluster: ClusterAPI;
|
|
127
109
|
constructor(c: ClientProvider);
|
|
110
|
+
/**
|
|
111
|
+
* Sends a command code with a payload and returns the raw response payload.
|
|
112
|
+
* Session-control codes are rejected with an invalid-command error.
|
|
113
|
+
*
|
|
114
|
+
* @param code - Command code to send
|
|
115
|
+
* @param payload - Raw command payload
|
|
116
|
+
* @returns Raw response payload
|
|
117
|
+
*/
|
|
118
|
+
sendBinaryRequest(code: number, payload: Buffer): Promise<Buffer>;
|
|
128
119
|
}
|
|
129
120
|
export {};
|
|
130
121
|
//# sourceMappingURL=command-set.d.ts.map
|
package/dist/wire/command-set.js
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
// Licensed to the Apache Software Foundation (ASF) under one
|
|
2
|
+
// or more contributor license agreements. See the NOTICE file
|
|
3
|
+
// distributed with this work for additional information
|
|
4
|
+
// regarding copyright ownership. The ASF licenses this file
|
|
5
|
+
// to you under the Apache License, Version 2.0 (the
|
|
6
|
+
// "License"); you may not use this file except in compliance
|
|
7
|
+
// with 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,
|
|
12
|
+
// software distributed under the License is distributed on an
|
|
13
|
+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
// KIND, either express or implied. See the License for the
|
|
15
|
+
// specific language governing permissions and limitations
|
|
16
|
+
// under the License.
|
|
17
|
+
//
|
|
18
|
+
import { COMMAND_CODE } from './command.code.js';
|
|
19
|
+
import { responseError } from './error.utils.js';
|
|
19
20
|
import { login } from './session/login.command.js';
|
|
20
21
|
import { logout } from './session/logout.command.js';
|
|
21
22
|
import { loginWithToken } from './session/login-with-token.command.js';
|
|
@@ -141,6 +142,14 @@ const systemAPI = (c) => ({
|
|
|
141
142
|
const clusterAPI = (c) => ({
|
|
142
143
|
getClusterMetadata: getClusterMetadata(c)
|
|
143
144
|
});
|
|
145
|
+
const SESSION_CONTROL_CODES = new Set([
|
|
146
|
+
COMMAND_CODE.LoginUser,
|
|
147
|
+
COMMAND_CODE.LogoutUser,
|
|
148
|
+
COMMAND_CODE.LoginRegister,
|
|
149
|
+
COMMAND_CODE.LoginWithAccessToken,
|
|
150
|
+
COMMAND_CODE.LoginRegisterWithAccessToken,
|
|
151
|
+
]);
|
|
152
|
+
const INVALID_COMMAND_ERROR_CODE = 3;
|
|
144
153
|
export class AbstractAPI {
|
|
145
154
|
clientProvider;
|
|
146
155
|
constructor(getClient) {
|
|
@@ -164,6 +173,20 @@ export class CommandAPI extends AbstractAPI {
|
|
|
164
173
|
constructor(c) {
|
|
165
174
|
super(c);
|
|
166
175
|
}
|
|
176
|
+
/**
|
|
177
|
+
* Sends a command code with a payload and returns the raw response payload.
|
|
178
|
+
* Session-control codes are rejected with an invalid-command error.
|
|
179
|
+
*
|
|
180
|
+
* @param code - Command code to send
|
|
181
|
+
* @param payload - Raw command payload
|
|
182
|
+
* @returns Raw response payload
|
|
183
|
+
*/
|
|
184
|
+
async sendBinaryRequest(code, payload) {
|
|
185
|
+
if (SESSION_CONTROL_CODES.has(code))
|
|
186
|
+
throw responseError(code, INVALID_COMMAND_ERROR_CODE);
|
|
187
|
+
const requestPayload = Buffer.from(payload);
|
|
188
|
+
const response = await (await this.clientProvider()).sendCommand(code, requestPayload);
|
|
189
|
+
return response.length <= 1 ? Buffer.alloc(0) : response.data;
|
|
190
|
+
}
|
|
167
191
|
}
|
|
168
|
-
;
|
|
169
192
|
//# sourceMappingURL=command-set.js.map
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// Licensed to the Apache Software Foundation (ASF) under one
|
|
2
|
+
// or more contributor license agreements. See the NOTICE file
|
|
3
|
+
// distributed with this work for additional information
|
|
4
|
+
// regarding copyright ownership. The ASF licenses this file
|
|
5
|
+
// to you under the Apache License, Version 2.0 (the
|
|
6
|
+
// "License"); you may not use this file except in compliance
|
|
7
|
+
// with 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,
|
|
12
|
+
// software distributed under the License is distributed on an
|
|
13
|
+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
// KIND, either express or implied. See the License for the
|
|
15
|
+
// specific language governing permissions and limitations
|
|
16
|
+
// under the License.
|
|
17
|
+
//
|
|
18
|
+
import { describe, it } from 'node:test';
|
|
19
|
+
import assert from 'node:assert/strict';
|
|
20
|
+
import { SimpleClient } from '../client/client.js';
|
|
21
|
+
import { COMMAND_CODE } from './command.code.js';
|
|
22
|
+
const mockRawClient = () => ({
|
|
23
|
+
sendCommand: async () => {
|
|
24
|
+
throw new Error('sendCommand should not be called by the session-control guard');
|
|
25
|
+
},
|
|
26
|
+
isAuthenticated: true,
|
|
27
|
+
authenticate: async () => {
|
|
28
|
+
throw new Error('authenticate should not be called by the session-control guard');
|
|
29
|
+
},
|
|
30
|
+
destroy: () => { },
|
|
31
|
+
on: () => { },
|
|
32
|
+
once: () => { },
|
|
33
|
+
getReadStream: () => {
|
|
34
|
+
throw new Error('getReadStream should not be called by the session-control guard');
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
describe('CommandAPI.sendBinaryRequest', () => {
|
|
38
|
+
describe('session-control guard', () => {
|
|
39
|
+
[
|
|
40
|
+
COMMAND_CODE.LoginUser,
|
|
41
|
+
COMMAND_CODE.LogoutUser,
|
|
42
|
+
COMMAND_CODE.LoginRegister,
|
|
43
|
+
COMMAND_CODE.LoginWithAccessToken,
|
|
44
|
+
COMMAND_CODE.LoginRegisterWithAccessToken,
|
|
45
|
+
].forEach((code) => {
|
|
46
|
+
it(`rejects code ${code} before reaching the client provider`, async () => {
|
|
47
|
+
const client = new SimpleClient(mockRawClient());
|
|
48
|
+
await assert.rejects(() => client.sendBinaryRequest(code, Buffer.alloc(0)), /code: 3, message: Invalid command/);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
it('forwards a custom code and opaque payload to sendCommand', async () => {
|
|
53
|
+
const customCode = 60_000;
|
|
54
|
+
const payload = Buffer.from([0xAA, 0xBB, 0xCC]);
|
|
55
|
+
const expectedResponse = Buffer.from('opaque response');
|
|
56
|
+
const raw = mockRawClient();
|
|
57
|
+
raw.sendCommand = async (code, sentPayload) => {
|
|
58
|
+
assert.equal(code, customCode);
|
|
59
|
+
assert.deepEqual(sentPayload, payload);
|
|
60
|
+
return {
|
|
61
|
+
status: 0,
|
|
62
|
+
length: expectedResponse.length,
|
|
63
|
+
data: expectedResponse,
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
const client = new SimpleClient(raw);
|
|
67
|
+
const response = await client.sendBinaryRequest(customCode, payload);
|
|
68
|
+
assert.deepEqual(response, expectedResponse);
|
|
69
|
+
});
|
|
70
|
+
it('copies the payload before awaiting the client provider', async () => {
|
|
71
|
+
const payload = Buffer.from([0xAA, 0xBB, 0xCC]);
|
|
72
|
+
const expectedPayload = Buffer.from(payload);
|
|
73
|
+
const raw = mockRawClient();
|
|
74
|
+
raw.sendCommand = async (_code, sentPayload) => {
|
|
75
|
+
assert.deepEqual(sentPayload, expectedPayload);
|
|
76
|
+
return { status: 0, length: 1, data: Buffer.alloc(0) };
|
|
77
|
+
};
|
|
78
|
+
const request = new SimpleClient(raw).sendBinaryRequest(60_000, payload);
|
|
79
|
+
payload.fill(0);
|
|
80
|
+
await request;
|
|
81
|
+
});
|
|
82
|
+
it('normalizes a one-byte response to an empty buffer', async () => {
|
|
83
|
+
const raw = mockRawClient();
|
|
84
|
+
raw.sendCommand = async () => ({
|
|
85
|
+
status: 0,
|
|
86
|
+
length: 1,
|
|
87
|
+
data: Buffer.from([1]),
|
|
88
|
+
});
|
|
89
|
+
const response = await new SimpleClient(raw).sendBinaryRequest(COMMAND_CODE.Ping, Buffer.alloc(0));
|
|
90
|
+
assert.deepEqual(response, Buffer.alloc(0));
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
//# sourceMappingURL=command-set.test.js.map
|