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,21 @@
|
|
|
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 type Id = number | string;
|
|
20
|
+
export declare const serializeIdentifier: (id: Id) => Buffer;
|
|
21
|
+
//# sourceMappingURL=identifier.utils.d.ts.map
|
|
@@ -0,0 +1,49 @@
|
|
|
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
|
+
const NUMERIC = 1;
|
|
20
|
+
const STRING = 2;
|
|
21
|
+
export const serializeIdentifier = (id) => {
|
|
22
|
+
if ('string' === typeof id) {
|
|
23
|
+
return serializeStringId(id);
|
|
24
|
+
}
|
|
25
|
+
if ('number' === typeof id) {
|
|
26
|
+
return serializeNumericId(id);
|
|
27
|
+
}
|
|
28
|
+
throw new Error(`Unsuported id type (${id} - ${typeof id})`);
|
|
29
|
+
};
|
|
30
|
+
const serializeStringId = (id) => {
|
|
31
|
+
const b = Buffer.alloc(1 + 1);
|
|
32
|
+
const bId = Buffer.from(id);
|
|
33
|
+
if (bId.length < 1 || bId.length > 255)
|
|
34
|
+
throw new Error('identifier/name should be between 1 and 255 bytes');
|
|
35
|
+
b.writeUInt8(STRING);
|
|
36
|
+
b.writeUInt8(bId.length, 1);
|
|
37
|
+
return Buffer.concat([
|
|
38
|
+
b,
|
|
39
|
+
bId
|
|
40
|
+
]);
|
|
41
|
+
};
|
|
42
|
+
const serializeNumericId = (id) => {
|
|
43
|
+
const b = Buffer.alloc(1 + 1 + 4);
|
|
44
|
+
b.writeUInt8(NUMERIC);
|
|
45
|
+
b.writeUInt8(4, 1);
|
|
46
|
+
b.writeUInt32LE(id, 2);
|
|
47
|
+
return b;
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=identifier.utils.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=identifier.utils.test.d.ts.map
|
|
@@ -0,0 +1,40 @@
|
|
|
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 { serializeIdentifier } from './identifier.utils.js';
|
|
22
|
+
describe('serializeIdentifier', () => {
|
|
23
|
+
it('serialize numeric id into buffer', () => {
|
|
24
|
+
assert.deepEqual(serializeIdentifier(123).length, 1 + 1 + 4);
|
|
25
|
+
});
|
|
26
|
+
it('serialize numeric string into buffer', () => {
|
|
27
|
+
const strId = 'Groot';
|
|
28
|
+
assert.deepEqual(serializeIdentifier(strId).length, 1 + 1 + strId.length);
|
|
29
|
+
});
|
|
30
|
+
it('throw on empty string id', () => {
|
|
31
|
+
assert.throws(() => serializeIdentifier(''));
|
|
32
|
+
});
|
|
33
|
+
it('throw on string id > 255 bytes', () => {
|
|
34
|
+
assert.throws(() => serializeIdentifier('YoLo'.repeat(65)));
|
|
35
|
+
});
|
|
36
|
+
it('throw on string id > 255 bytes - utf8 version', () => {
|
|
37
|
+
assert.throws(() => serializeIdentifier('¥Ø£Ø'.repeat(33)));
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
//# sourceMappingURL=identifier.utils.test.js.map
|
|
@@ -0,0 +1,32 @@
|
|
|
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 './client/index.js';
|
|
20
|
+
export * from './consumer-group/index.js';
|
|
21
|
+
export * from './message/index.js';
|
|
22
|
+
export * from './offset/index.js';
|
|
23
|
+
export * from './partition/index.js';
|
|
24
|
+
export * from './session/index.js';
|
|
25
|
+
export * from './stream/index.js';
|
|
26
|
+
export * from './system/index.js';
|
|
27
|
+
export * from './token/index.js';
|
|
28
|
+
export * from './topic/index.js';
|
|
29
|
+
export * from './user/index.js';
|
|
30
|
+
export * from './command-set.js';
|
|
31
|
+
export { type Id } from './identifier.utils.js';
|
|
32
|
+
//# sourceMappingURL=index.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
|
+
export * from './client/index.js';
|
|
20
|
+
export * from './consumer-group/index.js';
|
|
21
|
+
export * from './message/index.js';
|
|
22
|
+
export * from './offset/index.js';
|
|
23
|
+
export * from './partition/index.js';
|
|
24
|
+
export * from './session/index.js';
|
|
25
|
+
export * from './stream/index.js';
|
|
26
|
+
export * from './system/index.js';
|
|
27
|
+
export * from './token/index.js';
|
|
28
|
+
export * from './topic/index.js';
|
|
29
|
+
export * from './user/index.js';
|
|
30
|
+
export * from './command-set.js';
|
|
31
|
+
//# 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 FlushUnsavedBuffer = {
|
|
21
|
+
streamId: Id;
|
|
22
|
+
topicId: Id;
|
|
23
|
+
partitionId: number;
|
|
24
|
+
};
|
|
25
|
+
export declare const FLUSH_UNSAVED_BUFFERS: {
|
|
26
|
+
code: number;
|
|
27
|
+
serialize: ({ streamId, topicId, partitionId }: FlushUnsavedBuffer) => Buffer<ArrayBuffer>;
|
|
28
|
+
deserialize: (r: import("../../index.js").CommandResponse) => boolean;
|
|
29
|
+
};
|
|
30
|
+
export declare const flushUnsavedBuffers: (getClient: import("../../index.js").ClientProvider) => (arg: FlushUnsavedBuffer) => Promise<boolean>;
|
|
31
|
+
//# sourceMappingURL=flush-unsaved-buffers.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 { serializeFlushUnsavedBuffers } from './message.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 FLUSH_UNSAVED_BUFFERS = {
|
|
24
|
+
code: COMMAND_CODE.FlushUnsavedBuffers,
|
|
25
|
+
serialize: ({ streamId, topicId, partitionId }) => {
|
|
26
|
+
return serializeFlushUnsavedBuffers(streamId, topicId, partitionId);
|
|
27
|
+
},
|
|
28
|
+
deserialize: deserializeVoidResponse
|
|
29
|
+
};
|
|
30
|
+
export const flushUnsavedBuffers = wrapCommand(FLUSH_UNSAVED_BUFFERS);
|
|
31
|
+
//# sourceMappingURL=flush-unsaved-buffers.command.js.map
|
|
@@ -0,0 +1,101 @@
|
|
|
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 ValueOf } from "../../type.utils.js";
|
|
20
|
+
export declare const HeaderKind: {
|
|
21
|
+
readonly Raw: 1;
|
|
22
|
+
readonly String: 2;
|
|
23
|
+
readonly Bool: 3;
|
|
24
|
+
readonly Int8: 4;
|
|
25
|
+
readonly Int16: 5;
|
|
26
|
+
readonly Int32: 6;
|
|
27
|
+
readonly Int64: 7;
|
|
28
|
+
readonly Int128: 8;
|
|
29
|
+
readonly Uint8: 9;
|
|
30
|
+
readonly Uint16: 10;
|
|
31
|
+
readonly Uint32: 11;
|
|
32
|
+
readonly Uint64: 12;
|
|
33
|
+
readonly Uint128: 13;
|
|
34
|
+
readonly Float: 14;
|
|
35
|
+
readonly Double: 15;
|
|
36
|
+
};
|
|
37
|
+
export type HeaderKind = typeof HeaderKind;
|
|
38
|
+
export type HeaderKindId = keyof HeaderKind;
|
|
39
|
+
export type HeaderKindValue = ValueOf<HeaderKind>;
|
|
40
|
+
export declare const ReverseHeaderKind: Record<1 | 2 | 10 | 11 | 4 | 8 | 3 | 5 | 12 | 9 | 13 | 6 | 7 | 14 | 15, "Raw" | "String" | "Bool" | "Int8" | "Int16" | "Int32" | "Int64" | "Int128" | "Uint8" | "Uint16" | "Uint32" | "Uint64" | "Uint128" | "Float" | "Double">;
|
|
41
|
+
export type HeaderValueRaw = {
|
|
42
|
+
kind: HeaderKind['Raw'];
|
|
43
|
+
value: Buffer;
|
|
44
|
+
};
|
|
45
|
+
export type HeaderValueString = {
|
|
46
|
+
kind: HeaderKind['String'];
|
|
47
|
+
value: string;
|
|
48
|
+
};
|
|
49
|
+
export type HeaderValueBool = {
|
|
50
|
+
kind: HeaderKind['Bool'];
|
|
51
|
+
value: boolean;
|
|
52
|
+
};
|
|
53
|
+
export type HeaderValueInt8 = {
|
|
54
|
+
kind: HeaderKind['Int8'];
|
|
55
|
+
value: number;
|
|
56
|
+
};
|
|
57
|
+
export type HeaderValueInt16 = {
|
|
58
|
+
kind: HeaderKind['Int16'];
|
|
59
|
+
value: number;
|
|
60
|
+
};
|
|
61
|
+
export type HeaderValueInt32 = {
|
|
62
|
+
kind: HeaderKind['Int32'];
|
|
63
|
+
value: number;
|
|
64
|
+
};
|
|
65
|
+
export type HeaderValueInt64 = {
|
|
66
|
+
kind: HeaderKind['Int64'];
|
|
67
|
+
value: bigint;
|
|
68
|
+
};
|
|
69
|
+
export type HeaderValueInt128 = {
|
|
70
|
+
kind: HeaderKind['Int128'];
|
|
71
|
+
value: Buffer;
|
|
72
|
+
};
|
|
73
|
+
export type HeaderValueUint8 = {
|
|
74
|
+
kind: HeaderKind['Uint8'];
|
|
75
|
+
value: number;
|
|
76
|
+
};
|
|
77
|
+
export type HeaderValueUint16 = {
|
|
78
|
+
kind: HeaderKind['Uint16'];
|
|
79
|
+
value: number;
|
|
80
|
+
};
|
|
81
|
+
export type HeaderValueUint32 = {
|
|
82
|
+
kind: HeaderKind['Uint32'];
|
|
83
|
+
value: number;
|
|
84
|
+
};
|
|
85
|
+
export type HeaderValueUint64 = {
|
|
86
|
+
kind: HeaderKind['Uint64'];
|
|
87
|
+
value: bigint;
|
|
88
|
+
};
|
|
89
|
+
export type HeaderValueUint128 = {
|
|
90
|
+
kind: HeaderKind['Uint128'];
|
|
91
|
+
value: Buffer;
|
|
92
|
+
};
|
|
93
|
+
export type HeaderValueFloat = {
|
|
94
|
+
kind: HeaderKind['Float'];
|
|
95
|
+
value: number;
|
|
96
|
+
};
|
|
97
|
+
export type HeaderValueDouble = {
|
|
98
|
+
kind: HeaderKind['Double'];
|
|
99
|
+
value: number;
|
|
100
|
+
};
|
|
101
|
+
//# sourceMappingURL=header.type.d.ts.map
|
|
@@ -0,0 +1,55 @@
|
|
|
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 { reverseRecord } from "../../type.utils.js";
|
|
20
|
+
export const HeaderKind = {
|
|
21
|
+
Raw: 1,
|
|
22
|
+
String: 2,
|
|
23
|
+
Bool: 3,
|
|
24
|
+
Int8: 4,
|
|
25
|
+
Int16: 5,
|
|
26
|
+
Int32: 6,
|
|
27
|
+
Int64: 7,
|
|
28
|
+
Int128: 8,
|
|
29
|
+
Uint8: 9,
|
|
30
|
+
Uint16: 10,
|
|
31
|
+
Uint32: 11,
|
|
32
|
+
Uint64: 12,
|
|
33
|
+
Uint128: 13,
|
|
34
|
+
Float: 14,
|
|
35
|
+
Double: 15
|
|
36
|
+
};
|
|
37
|
+
export const ReverseHeaderKind = reverseRecord(HeaderKind);
|
|
38
|
+
// export type HeaderValue =
|
|
39
|
+
// HeaderValueRaw |
|
|
40
|
+
// HeaderValueString |
|
|
41
|
+
// HeaderValueBool |
|
|
42
|
+
// HeaderValueInt8 |
|
|
43
|
+
// HeaderValueInt16 |
|
|
44
|
+
// HeaderValueInt32 |
|
|
45
|
+
// HeaderValueInt64 |
|
|
46
|
+
// HeaderValueInt128 |
|
|
47
|
+
// HeaderValueUint8 |
|
|
48
|
+
// HeaderValueUint16 |
|
|
49
|
+
// HeaderValueUint32 |
|
|
50
|
+
// HeaderValueUint64 |
|
|
51
|
+
// HeaderValueUint128 |
|
|
52
|
+
// HeaderValueFloat |
|
|
53
|
+
// HeaderValueDouble;
|
|
54
|
+
// export type Headers = Record<string, HeaderValue>;
|
|
55
|
+
//# sourceMappingURL=header.type.js.map
|
|
@@ -0,0 +1,67 @@
|
|
|
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 HeaderValueRaw, type HeaderValueString, type HeaderValueBool, type HeaderValueInt8, type HeaderValueInt16, type HeaderValueInt32, type HeaderValueInt64, type HeaderValueInt128, type HeaderValueUint8, type HeaderValueUint16, type HeaderValueUint32, type HeaderValueUint64, type HeaderValueUint128, type HeaderValueFloat, type HeaderValueDouble, type HeaderKindId } from './header.type.js';
|
|
20
|
+
export type HeaderValue = HeaderValueRaw | HeaderValueString | HeaderValueBool | HeaderValueInt8 | HeaderValueInt16 | HeaderValueInt32 | HeaderValueInt64 | HeaderValueInt128 | HeaderValueUint8 | HeaderValueUint16 | HeaderValueUint32 | HeaderValueUint64 | HeaderValueUint128 | HeaderValueFloat | HeaderValueDouble;
|
|
21
|
+
export type Headers = Record<string, HeaderValue>;
|
|
22
|
+
type BinaryHeaderValue = {
|
|
23
|
+
kind: number;
|
|
24
|
+
value: Buffer;
|
|
25
|
+
};
|
|
26
|
+
export declare const serializeHeaderValue: (header: HeaderValue) => Buffer<ArrayBufferLike>;
|
|
27
|
+
export declare const serializeHeader: (key: string, v: BinaryHeaderValue) => Buffer<ArrayBuffer>;
|
|
28
|
+
export declare const EMPTY_HEADERS: Buffer<ArrayBuffer>;
|
|
29
|
+
export declare const serializeHeaders: (headers?: Headers) => Buffer<ArrayBuffer>;
|
|
30
|
+
export type ParsedHeaderValue = boolean | string | number | bigint | Buffer;
|
|
31
|
+
export type ParsedHeader = {
|
|
32
|
+
kind: ParsedHeaderValue;
|
|
33
|
+
value: ParsedHeaderValue;
|
|
34
|
+
};
|
|
35
|
+
type HeaderWithKey = ParsedHeader & {
|
|
36
|
+
key: string;
|
|
37
|
+
};
|
|
38
|
+
export type HeadersMap = Record<string, ParsedHeader>;
|
|
39
|
+
type ParsedHeaderDeserialized = {
|
|
40
|
+
bytesRead: number;
|
|
41
|
+
data: HeaderWithKey;
|
|
42
|
+
};
|
|
43
|
+
export declare const mapHeaderKind: (k: number) => HeaderKindId;
|
|
44
|
+
export declare const deserializeHeaderValue: (kind: number, value: Buffer) => ParsedHeaderValue;
|
|
45
|
+
export declare const deserializeHeader: (p: Buffer, pos?: number) => ParsedHeaderDeserialized;
|
|
46
|
+
export declare const deserializeHeaders: (p: Buffer, pos?: number) => HeadersMap;
|
|
47
|
+
export declare const HeaderValue: {
|
|
48
|
+
Raw: (value: Buffer) => HeaderValueRaw;
|
|
49
|
+
String: (value: string) => HeaderValueString;
|
|
50
|
+
Bool: (value: boolean) => HeaderValueBool;
|
|
51
|
+
Int8: (value: number) => HeaderValueInt8;
|
|
52
|
+
Int16: (value: number) => HeaderValueInt16;
|
|
53
|
+
Int32: (value: number) => HeaderValueInt32;
|
|
54
|
+
Int64: (value: bigint) => HeaderValueInt64;
|
|
55
|
+
Int128: (value: Buffer) => HeaderValueInt128;
|
|
56
|
+
Uint8: (value: number) => HeaderValueUint8;
|
|
57
|
+
Uint16: (value: number) => HeaderValueUint16;
|
|
58
|
+
Uint32: (value: number) => HeaderValueUint32;
|
|
59
|
+
Uint64: (value: bigint) => HeaderValueUint64;
|
|
60
|
+
Uint128: (value: Buffer) => HeaderValueUint128;
|
|
61
|
+
Float: (value: number) => HeaderValueFloat;
|
|
62
|
+
Double: (value: number) => HeaderValueDouble;
|
|
63
|
+
getKind: (h: HeaderValue) => "Raw" | "String" | "Bool" | "Int8" | "Int16" | "Int32" | "Int64" | "Int128" | "Uint8" | "Uint16" | "Uint32" | "Uint64" | "Uint128" | "Float" | "Double";
|
|
64
|
+
getValue: (h: HeaderValue) => string | number | bigint | boolean | Buffer<ArrayBufferLike>;
|
|
65
|
+
};
|
|
66
|
+
export {};
|
|
67
|
+
//# sourceMappingURL=header.utils.d.ts.map
|