apache-iggy 0.5.2 → 0.6.0-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/dist/client/client.connection.js +30 -34
- package/dist/client/client.socket.js +1 -1
- package/dist/debug-send.js +14 -16
- package/dist/debug.js +13 -15
- package/dist/e2e/tcp.cluster.e2e.d.ts +20 -0
- package/dist/e2e/tcp.cluster.e2e.js +55 -0
- package/dist/e2e/tcp.consumer-group.e2e.js +41 -29
- package/dist/e2e/tcp.consumer-stream.e2e.js +11 -12
- package/dist/e2e/tcp.send-message.e2e.js +60 -23
- package/dist/e2e/tcp.stream.e2e.js +5 -6
- package/dist/e2e/tcp.system.e2e.js +1 -1
- package/dist/e2e/tcp.topic.e2e.js +18 -23
- package/dist/e2e/tcp.user.e2e.js +5 -0
- package/dist/stream/consumer-stream.d.ts +2 -2
- package/dist/stream/consumer-stream.js +4 -14
- package/dist/tcp.e2e.js +2 -0
- package/dist/wire/client/get-client.command.d.ts +2 -2
- package/dist/wire/client/get-client.command.js +5 -1
- package/dist/wire/cluster/cluster.type.d.ts +54 -0
- package/dist/wire/cluster/cluster.type.js +62 -0
- package/dist/wire/cluster/cluster.utils.d.ts +40 -0
- package/dist/wire/cluster/cluster.utils.js +85 -0
- package/dist/wire/cluster/get-cluster-metadata.command.d.ts +27 -0
- package/dist/wire/cluster/get-cluster-metadata.command.js +30 -0
- package/dist/wire/cluster/index.d.ts +21 -0
- package/dist/wire/cluster/index.js +21 -0
- package/dist/wire/command-set.d.ts +15 -6
- package/dist/wire/command-set.js +14 -2
- package/dist/wire/command.code.d.ts +1 -0
- package/dist/wire/command.code.js +1 -0
- package/dist/wire/command.utils.js +0 -6
- package/dist/wire/consumer-group/create-group.command.d.ts +1 -2
- package/dist/wire/consumer-group/create-group.command.js +4 -4
- package/dist/wire/consumer-group/create-group.command.test.js +1 -2
- package/dist/wire/consumer-group/ensure-group.virtual.command.d.ts +23 -0
- package/dist/wire/consumer-group/ensure-group.virtual.command.js +33 -0
- package/dist/wire/consumer-group/get-group.command.d.ts +2 -2
- package/dist/wire/consumer-group/get-group.command.js +2 -0
- package/dist/wire/consumer-group/index.d.ts +1 -0
- package/dist/wire/consumer-group/index.js +1 -0
- package/dist/wire/error.utils.d.ts +4 -0
- package/dist/wire/error.utils.js +10 -0
- package/dist/wire/message/header.type.d.ts +1 -1
- package/dist/wire/message/poll-messages.command.d.ts +1 -1
- package/dist/wire/message/poll.utils.d.ts +1 -1
- package/dist/wire/message/poll.utils.js +1 -2
- package/dist/wire/offset/delete-offset.command.js +1 -1
- package/dist/wire/offset/get-offset.command.d.ts +7 -3
- package/dist/wire/offset/get-offset.command.js +3 -3
- package/dist/wire/offset/offset.utils.d.ts +2 -2
- package/dist/wire/offset/offset.utils.js +13 -4
- package/dist/wire/offset/store-offset.command.d.ts +1 -1
- package/dist/wire/stream/create-stream.command.d.ts +2 -2
- package/dist/wire/stream/create-stream.command.js +4 -4
- package/dist/wire/stream/create-stream.command.test.js +2 -3
- package/dist/wire/stream/ensure-stream.virtual.command.d.ts +21 -0
- package/dist/wire/stream/ensure-stream.virtual.command.js +26 -0
- package/dist/wire/stream/get-stream.command.d.ts +2 -2
- package/dist/wire/stream/get-stream.command.js +2 -0
- package/dist/wire/stream/index.d.ts +1 -0
- package/dist/wire/stream/index.js +1 -0
- package/dist/wire/system/get-stats.command.d.ts +1 -1
- package/dist/wire/topic/create-topic.command.d.ts +1 -2
- package/dist/wire/topic/create-topic.command.js +9 -9
- package/dist/wire/topic/create-topic.command.test.js +2 -3
- package/dist/wire/topic/ensure-topic.virtual.command.d.ts +22 -0
- package/dist/wire/topic/ensure-topic.virtual.command.js +28 -0
- package/dist/wire/topic/get-topic.command.d.ts +2 -2
- package/dist/wire/topic/get-topic.command.js +2 -0
- package/dist/wire/topic/index.d.ts +1 -0
- package/dist/wire/topic/index.js +1 -0
- package/dist/wire/topic/topic.utils.js +1 -1
- package/dist/wire/user/get-user.command.d.ts +2 -2
- package/dist/wire/user/get-user.command.js +5 -1
- package/package.json +1 -1
|
@@ -23,7 +23,6 @@ describe('CreateTopic', () => {
|
|
|
23
23
|
describe('serialize', () => {
|
|
24
24
|
const t1 = {
|
|
25
25
|
streamId: 1,
|
|
26
|
-
topicId: 2,
|
|
27
26
|
name: 'test-topic',
|
|
28
27
|
partitionCount: 1,
|
|
29
28
|
compressionAlgorithm: 1, // 1 = None, 2 = Gzip
|
|
@@ -31,8 +30,8 @@ describe('CreateTopic', () => {
|
|
|
31
30
|
maxTopicSize: 0n,
|
|
32
31
|
replicationFactor: 1
|
|
33
32
|
};
|
|
34
|
-
it('serialize 1
|
|
35
|
-
assert.deepEqual(CREATE_TOPIC.serialize(t1).length, 6 + 4 +
|
|
33
|
+
it('serialize 1 name into buffer', () => {
|
|
34
|
+
assert.deepEqual(CREATE_TOPIC.serialize(t1).length, 6 + 4 + 1 + 8 + 8 + 1 + 1 + t1.name.length);
|
|
36
35
|
});
|
|
37
36
|
it('throw on name < 1', () => {
|
|
38
37
|
const t = { ...t1, name: '' };
|
|
@@ -0,0 +1,22 @@
|
|
|
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 { Id } from '../identifier.utils.js';
|
|
20
|
+
import { ClientProvider } from '../../client/index.js';
|
|
21
|
+
export declare const ensureTopic: (c: ClientProvider) => (streamId: Id, topicName: string, partitionCount?: number, compressionAlgorithm?: number) => Promise<import("./topic.utils.js").Topic>;
|
|
22
|
+
//# sourceMappingURL=ensure-topic.virtual.command.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
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 { createTopic } from './create-topic.command.js';
|
|
20
|
+
import { getTopic } from './get-topic.command.js';
|
|
21
|
+
export const ensureTopic = (c) => async function ensureTopic(streamId, topicName, partitionCount = 1, compressionAlgorithm = 1) {
|
|
22
|
+
const topic = await getTopic(c)({ streamId, topicId: topicName });
|
|
23
|
+
return topic === null ?
|
|
24
|
+
createTopic(c)({
|
|
25
|
+
streamId, name: topicName, partitionCount, compressionAlgorithm
|
|
26
|
+
}) : topic;
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=ensure-topic.virtual.command.js.map
|
|
@@ -26,8 +26,8 @@ type GetTopic = {
|
|
|
26
26
|
export declare const GET_TOPIC: {
|
|
27
27
|
code: number;
|
|
28
28
|
serialize: ({ streamId, topicId }: GetTopic) => Buffer<ArrayBuffer>;
|
|
29
|
-
deserialize: (r: CommandResponse) => Topic;
|
|
29
|
+
deserialize: (r: CommandResponse) => Topic | null;
|
|
30
30
|
};
|
|
31
|
-
export declare const getTopic: (getClient: import("../../client/client.type.js").ClientProvider) => (arg: GetTopic) => Promise<Topic>;
|
|
31
|
+
export declare const getTopic: (getClient: import("../../client/client.type.js").ClientProvider) => (arg: GetTopic) => Promise<Topic | null>;
|
|
32
32
|
export {};
|
|
33
33
|
//# sourceMappingURL=get-topic.command.d.ts.map
|
|
@@ -22,5 +22,6 @@ export * from './get-topic.command.js';
|
|
|
22
22
|
export * from './get-topics.command.js';
|
|
23
23
|
export * from './purge-topic.command.js';
|
|
24
24
|
export * from './update-topic.command.js';
|
|
25
|
+
export * from './ensure-topic.virtual.command.js';
|
|
25
26
|
export { CompressionAlgorithm } from './topic.utils.js';
|
|
26
27
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/wire/topic/index.js
CHANGED
|
@@ -22,5 +22,6 @@ export * from './get-topic.command.js';
|
|
|
22
22
|
export * from './get-topics.command.js';
|
|
23
23
|
export * from './purge-topic.command.js';
|
|
24
24
|
export * from './update-topic.command.js';
|
|
25
|
+
export * from './ensure-topic.virtual.command.js';
|
|
25
26
|
export { CompressionAlgorithm } from './topic.utils.js';
|
|
26
27
|
//# sourceMappingURL=index.js.map
|
|
@@ -59,7 +59,7 @@ export const deserializePartition = (p, pos = 0) => {
|
|
|
59
59
|
segmentsCount: p.readUInt32LE(pos + 12),
|
|
60
60
|
currentOffset: p.readBigUint64LE(pos + 16),
|
|
61
61
|
sizeBytes: p.readBigUint64LE(pos + 24),
|
|
62
|
-
messagesCount: p.readBigUint64LE(pos +
|
|
62
|
+
messagesCount: p.readBigUint64LE(pos + 32),
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
65
|
};
|
|
@@ -25,7 +25,7 @@ export type GetUser = {
|
|
|
25
25
|
export declare const GET_USER: {
|
|
26
26
|
code: number;
|
|
27
27
|
serialize: ({ userId }: GetUser) => Buffer<ArrayBufferLike>;
|
|
28
|
-
deserialize: (r: CommandResponse) => User;
|
|
28
|
+
deserialize: (r: CommandResponse) => User | null;
|
|
29
29
|
};
|
|
30
|
-
export declare const getUser: (getClient: import("../../client/client.type.js").ClientProvider) => (arg: GetUser) => Promise<User>;
|
|
30
|
+
export declare const getUser: (getClient: import("../../client/client.type.js").ClientProvider) => (arg: GetUser) => Promise<User | null>;
|
|
31
31
|
//# sourceMappingURL=get-user.command.d.ts.map
|
|
@@ -25,7 +25,11 @@ export const GET_USER = {
|
|
|
25
25
|
serialize: ({ userId }) => {
|
|
26
26
|
return serializeIdentifier(userId);
|
|
27
27
|
},
|
|
28
|
-
deserialize: (r) =>
|
|
28
|
+
deserialize: (r) => {
|
|
29
|
+
if (r.status === 0 && r.length === 0)
|
|
30
|
+
return null;
|
|
31
|
+
return deserializeUser(r.data);
|
|
32
|
+
}
|
|
29
33
|
};
|
|
30
34
|
export const getUser = wrapCommand(GET_USER);
|
|
31
35
|
//# sourceMappingURL=get-user.command.js.map
|