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,92 @@
|
|
|
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 { after, describe, it } from 'node:test';
|
|
20
|
+
import assert from 'node:assert/strict';
|
|
21
|
+
import { Client } from '../client/client.js';
|
|
22
|
+
import { groupConsumerStream } from '../stream/consumer-stream.js';
|
|
23
|
+
import { PollingStrategy, Partitioning } from '../wire/index.js';
|
|
24
|
+
import { sendSomeMessages, getIggyAddress } from '../tcp.sm.utils.js';
|
|
25
|
+
describe('e2e -> consumer-stream', async () => {
|
|
26
|
+
const [host, port] = getIggyAddress();
|
|
27
|
+
const credentials = { username: 'iggy', password: 'iggy' };
|
|
28
|
+
const opt = {
|
|
29
|
+
transport: 'TCP',
|
|
30
|
+
options: { host, port },
|
|
31
|
+
credentials
|
|
32
|
+
};
|
|
33
|
+
const c = new Client(opt);
|
|
34
|
+
const streamId = 137;
|
|
35
|
+
const topicId = 123;
|
|
36
|
+
const groupId = 12;
|
|
37
|
+
await c.stream.create({ streamId, name: `e2e-stream-${streamId}` });
|
|
38
|
+
await c.topic.create({
|
|
39
|
+
streamId,
|
|
40
|
+
topicId,
|
|
41
|
+
name: 'test-topic-stream-cg',
|
|
42
|
+
partitionCount: 3,
|
|
43
|
+
compressionAlgorithm: 1
|
|
44
|
+
});
|
|
45
|
+
const ct = 1000;
|
|
46
|
+
it('e2e -> consumer-stream::send-messages', async () => {
|
|
47
|
+
for (let i = 0; i < ct; i += 100) {
|
|
48
|
+
await sendSomeMessages(c.clientProvider)(streamId, topicId, Partitioning.MessageKey(`k-${i % 300}`));
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
it('e2e -> consumer-stream::poll-stream', async () => {
|
|
52
|
+
// POLL MESSAGE
|
|
53
|
+
const pollReq = {
|
|
54
|
+
groupId,
|
|
55
|
+
streamId,
|
|
56
|
+
topicId,
|
|
57
|
+
pollingStrategy: PollingStrategy.Next,
|
|
58
|
+
count: 100,
|
|
59
|
+
interval: 500
|
|
60
|
+
};
|
|
61
|
+
const pollStream = groupConsumerStream(opt);
|
|
62
|
+
const s = await pollStream(pollReq);
|
|
63
|
+
const s2 = await pollStream(pollReq);
|
|
64
|
+
let recv = 0;
|
|
65
|
+
const dataCb = (str) => (d) => {
|
|
66
|
+
recv += d.messages.length;
|
|
67
|
+
assert.equal(d.messages.length, d.count);
|
|
68
|
+
if (recv === ct) {
|
|
69
|
+
str.destroy();
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
s.on('data', dataCb(s));
|
|
73
|
+
s2.on('data', dataCb(s2));
|
|
74
|
+
// promise prevent test from finishing before end is handled
|
|
75
|
+
await new Promise((resolve, reject) => {
|
|
76
|
+
s.on('error', (err) => {
|
|
77
|
+
console.error('=>>Stream ERROR::', err);
|
|
78
|
+
s.destroy(err);
|
|
79
|
+
reject(err);
|
|
80
|
+
});
|
|
81
|
+
s.on('end', async () => {
|
|
82
|
+
resolve(assert.equal(ct, recv));
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
after(async () => {
|
|
86
|
+
assert.ok(await c.stream.delete({ streamId }));
|
|
87
|
+
assert.ok(await c.session.logout());
|
|
88
|
+
await c.destroy();
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
//# sourceMappingURL=tcp.consumer-stream.e2e.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=tcp.parallel.e2e.d.ts.map
|
|
@@ -0,0 +1,59 @@
|
|
|
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 { after, describe, it } from 'node:test';
|
|
20
|
+
import assert from 'node:assert/strict';
|
|
21
|
+
import { getTestClient } from './test-client.utils.js';
|
|
22
|
+
describe('e2e -> parallel', async () => {
|
|
23
|
+
const c = getTestClient();
|
|
24
|
+
const baseGetMe = await c.client.getMe();
|
|
25
|
+
const credentials = { username: 'iggy', password: 'iggy' };
|
|
26
|
+
it('e2e -> parallel::mix calls', async () => {
|
|
27
|
+
const resp = await Promise.all([
|
|
28
|
+
c.client.getMe(),
|
|
29
|
+
c.system.getStats(),
|
|
30
|
+
c.system.ping(),
|
|
31
|
+
c.session.login(credentials),
|
|
32
|
+
c.client.getMe(),
|
|
33
|
+
c.system.getStats(),
|
|
34
|
+
c.system.ping(),
|
|
35
|
+
c.session.login(credentials),
|
|
36
|
+
c.client.getMe(),
|
|
37
|
+
c.system.getStats(),
|
|
38
|
+
c.system.ping(),
|
|
39
|
+
c.session.login(credentials),
|
|
40
|
+
]);
|
|
41
|
+
assert.ok(resp.length === 12);
|
|
42
|
+
assert.deepEqual(resp[0], baseGetMe);
|
|
43
|
+
assert.deepEqual(Object.keys(resp[1]), [
|
|
44
|
+
'processId', 'cpuUsage', 'totalCpuUsage', 'memoryUsage', 'totalMemory',
|
|
45
|
+
'availableMemory', 'runTime', 'startTime', 'readBytes', 'writtenBytes',
|
|
46
|
+
'messagesSizeBytes', 'streamsCount', 'topicsCount', 'partitionsCount',
|
|
47
|
+
'segmentsCount', 'messagesCount', 'clientsCount', 'consumersGroupsCount',
|
|
48
|
+
'hostname', 'osName', 'osVersion', 'kernelVersion'
|
|
49
|
+
]);
|
|
50
|
+
resp.forEach(r => assert.ok(r));
|
|
51
|
+
});
|
|
52
|
+
it('e2e -> parallel::logout', async () => {
|
|
53
|
+
assert.ok(await c.session.logout());
|
|
54
|
+
});
|
|
55
|
+
after(() => {
|
|
56
|
+
c.destroy();
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
//# sourceMappingURL=tcp.parallel.e2e.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=tcp.send-message.e2e.d.ts.map
|
|
@@ -0,0 +1,118 @@
|
|
|
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 { after, describe, it } from 'node:test';
|
|
20
|
+
import assert from 'node:assert/strict';
|
|
21
|
+
import { Consumer, PollingStrategy, Partitioning } from '../wire/index.js';
|
|
22
|
+
import { generateMessages } from '../tcp.sm.utils.js';
|
|
23
|
+
import { getTestClient } from './test-client.utils.js';
|
|
24
|
+
describe('e2e -> message', async () => {
|
|
25
|
+
const c = getTestClient();
|
|
26
|
+
const streamId = 934;
|
|
27
|
+
const topicId = 832;
|
|
28
|
+
const partitionId = 1;
|
|
29
|
+
const stream = {
|
|
30
|
+
streamId,
|
|
31
|
+
name: 'e2e-send-message-stream'
|
|
32
|
+
};
|
|
33
|
+
const topic = {
|
|
34
|
+
streamId,
|
|
35
|
+
topicId,
|
|
36
|
+
name: 'e2e-send-message-topic',
|
|
37
|
+
partitionCount: 1,
|
|
38
|
+
compressionAlgorithm: 1
|
|
39
|
+
};
|
|
40
|
+
const msg = {
|
|
41
|
+
streamId,
|
|
42
|
+
topicId,
|
|
43
|
+
messages: generateMessages(6),
|
|
44
|
+
partition: Partitioning.PartitionId(partitionId)
|
|
45
|
+
};
|
|
46
|
+
await c.stream.create(stream);
|
|
47
|
+
await c.topic.create(topic);
|
|
48
|
+
it('e2e -> message::send', async () => {
|
|
49
|
+
assert.ok(await c.message.send(msg));
|
|
50
|
+
});
|
|
51
|
+
it('e2e -> message::poll/last', async () => {
|
|
52
|
+
const pollReq = {
|
|
53
|
+
streamId,
|
|
54
|
+
topicId,
|
|
55
|
+
consumer: Consumer.Single,
|
|
56
|
+
partitionId,
|
|
57
|
+
pollingStrategy: PollingStrategy.Last,
|
|
58
|
+
count: 10,
|
|
59
|
+
autocommit: false
|
|
60
|
+
};
|
|
61
|
+
const { messages, ...resp } = await c.message.poll(pollReq);
|
|
62
|
+
assert.equal(messages.length, resp.count);
|
|
63
|
+
assert.equal(messages.length, msg.messages.length);
|
|
64
|
+
});
|
|
65
|
+
it('e2e -> message::poll/first', async () => {
|
|
66
|
+
const pollReq = {
|
|
67
|
+
streamId,
|
|
68
|
+
topicId,
|
|
69
|
+
consumer: Consumer.Single,
|
|
70
|
+
partitionId,
|
|
71
|
+
pollingStrategy: PollingStrategy.First,
|
|
72
|
+
count: 10,
|
|
73
|
+
autocommit: false
|
|
74
|
+
};
|
|
75
|
+
const { messages, ...resp } = await c.message.poll(pollReq);
|
|
76
|
+
assert.equal(messages.length, resp.count);
|
|
77
|
+
assert.equal(messages.length, msg.messages.length);
|
|
78
|
+
});
|
|
79
|
+
it('e2e -> message::poll/next', async () => {
|
|
80
|
+
const pollReq = {
|
|
81
|
+
streamId,
|
|
82
|
+
topicId,
|
|
83
|
+
consumer: Consumer.Single,
|
|
84
|
+
partitionId,
|
|
85
|
+
pollingStrategy: PollingStrategy.Next,
|
|
86
|
+
count: 10,
|
|
87
|
+
autocommit: false
|
|
88
|
+
};
|
|
89
|
+
const { messages, ...resp } = await c.message.poll(pollReq);
|
|
90
|
+
assert.equal(messages.length, resp.count);
|
|
91
|
+
assert.equal(messages.length, msg.messages.length);
|
|
92
|
+
});
|
|
93
|
+
it('e2e -> message::poll/next+commit', async () => {
|
|
94
|
+
const pollReq = {
|
|
95
|
+
streamId,
|
|
96
|
+
topicId,
|
|
97
|
+
consumer: Consumer.Single,
|
|
98
|
+
partitionId,
|
|
99
|
+
pollingStrategy: PollingStrategy.Next,
|
|
100
|
+
count: 10,
|
|
101
|
+
autocommit: true
|
|
102
|
+
};
|
|
103
|
+
const { messages, ...resp } = await c.message.poll(pollReq);
|
|
104
|
+
assert.equal(messages.length, resp.count);
|
|
105
|
+
assert.equal(messages.length, msg.messages.length);
|
|
106
|
+
const r2 = await c.message.poll(pollReq);
|
|
107
|
+
assert.equal(r2.count, 0);
|
|
108
|
+
assert.equal(r2.messages.length, 0);
|
|
109
|
+
});
|
|
110
|
+
it('e2e -> message::cleanup', async () => {
|
|
111
|
+
assert.ok(await c.stream.delete(stream));
|
|
112
|
+
assert.ok(await c.session.logout());
|
|
113
|
+
});
|
|
114
|
+
after(() => {
|
|
115
|
+
c.destroy();
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
//# sourceMappingURL=tcp.send-message.e2e.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=tcp.stream.e2e.d.ts.map
|
|
@@ -0,0 +1,59 @@
|
|
|
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 { after, describe, it } from 'node:test';
|
|
20
|
+
import assert from 'node:assert/strict';
|
|
21
|
+
import { getTestClient } from './test-client.utils.js';
|
|
22
|
+
describe('e2e -> stream', async () => {
|
|
23
|
+
const c = getTestClient();
|
|
24
|
+
const streamId = 164;
|
|
25
|
+
const name = 'e2e-tcp-stream';
|
|
26
|
+
const name2 = `${name}-updated`;
|
|
27
|
+
it('e2e -> stream::create', async () => {
|
|
28
|
+
const stream = await c.stream.create({ streamId, name });
|
|
29
|
+
assert.ok(stream);
|
|
30
|
+
});
|
|
31
|
+
it('e2e -> stream::list', async () => {
|
|
32
|
+
const streams = await c.stream.list();
|
|
33
|
+
assert.ok(streams.length > 0);
|
|
34
|
+
});
|
|
35
|
+
it('e2e -> stream::get', async () => {
|
|
36
|
+
const stream = await c.stream.get({ streamId });
|
|
37
|
+
assert.ok(stream);
|
|
38
|
+
});
|
|
39
|
+
it('e2e -> stream::update', async () => {
|
|
40
|
+
const stream = await c.stream.update({
|
|
41
|
+
streamId,
|
|
42
|
+
name: name2
|
|
43
|
+
});
|
|
44
|
+
assert.ok(stream);
|
|
45
|
+
});
|
|
46
|
+
it('e2e -> stream::purge', async () => {
|
|
47
|
+
assert.ok(await c.stream.purge({ streamId }));
|
|
48
|
+
});
|
|
49
|
+
it('e2e -> stream::delete', async () => {
|
|
50
|
+
assert.ok(await c.stream.delete({ streamId }));
|
|
51
|
+
});
|
|
52
|
+
it('e2e -> stream::cleanup', async () => {
|
|
53
|
+
assert.ok(await c.session.logout());
|
|
54
|
+
});
|
|
55
|
+
after(() => {
|
|
56
|
+
c.destroy();
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
//# sourceMappingURL=tcp.stream.e2e.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=tcp.system.e2e.d.ts.map
|
|
@@ -0,0 +1,46 @@
|
|
|
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 { after, describe, it } from 'node:test';
|
|
20
|
+
import assert from 'node:assert/strict';
|
|
21
|
+
import { getTestClient } from './test-client.utils.js';
|
|
22
|
+
describe('e2e -> system', async () => {
|
|
23
|
+
const c = getTestClient();
|
|
24
|
+
it('e2e -> system::ping', async () => {
|
|
25
|
+
assert.ok(await c.system.ping());
|
|
26
|
+
});
|
|
27
|
+
it('e2e -> system::login', async () => {
|
|
28
|
+
assert.deepEqual(await c.session.login({ username: 'iggy', password: 'iggy' }), { userId: 1 });
|
|
29
|
+
});
|
|
30
|
+
it('e2e -> system::getStat', async () => {
|
|
31
|
+
assert.deepEqual(Object.keys(await c.system.getStats()), [
|
|
32
|
+
'processId', 'cpuUsage', 'totalCpuUsage', 'memoryUsage', 'totalMemory',
|
|
33
|
+
'availableMemory', 'runTime', 'startTime', 'readBytes', 'writtenBytes',
|
|
34
|
+
'messagesSizeBytes', 'streamsCount', 'topicsCount', 'partitionsCount',
|
|
35
|
+
'segmentsCount', 'messagesCount', 'clientsCount', 'consumersGroupsCount',
|
|
36
|
+
'hostname', 'osName', 'osVersion', 'kernelVersion'
|
|
37
|
+
]);
|
|
38
|
+
});
|
|
39
|
+
it('e2e -> system::logout', async () => {
|
|
40
|
+
assert.ok(await c.session.logout());
|
|
41
|
+
});
|
|
42
|
+
after(() => {
|
|
43
|
+
c.destroy();
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
//# sourceMappingURL=tcp.system.e2e.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=tcp.token.e2e.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
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 { after, describe, it } from 'node:test';
|
|
20
|
+
import assert from 'node:assert/strict';
|
|
21
|
+
import { getTestClient } from './test-client.utils.js';
|
|
22
|
+
describe('e2e -> token', async () => {
|
|
23
|
+
const c = getTestClient();
|
|
24
|
+
const tokenName = 'yolo-token-test';
|
|
25
|
+
it('e2e -> token::create', async () => {
|
|
26
|
+
const tk = await c.token.create({ name: tokenName, expiry: 1800n });
|
|
27
|
+
assert.ok(tk.token.length > 1);
|
|
28
|
+
});
|
|
29
|
+
it('e2e -> token::list', async () => {
|
|
30
|
+
const tks = await c.token.list();
|
|
31
|
+
assert.ok(tks.length > 0);
|
|
32
|
+
});
|
|
33
|
+
it('e2e -> token::delete', async () => {
|
|
34
|
+
assert.ok(await c.token.delete({ name: tokenName }));
|
|
35
|
+
});
|
|
36
|
+
it('e2e -> token::logout', async () => {
|
|
37
|
+
assert.ok(await c.session.logout());
|
|
38
|
+
});
|
|
39
|
+
after(() => {
|
|
40
|
+
c.destroy();
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=tcp.token.e2e.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=tcp.topic.e2e.d.ts.map
|
|
@@ -0,0 +1,83 @@
|
|
|
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 { after, describe, it } from 'node:test';
|
|
20
|
+
import assert from 'node:assert/strict';
|
|
21
|
+
import { getTestClient } from './test-client.utils.js';
|
|
22
|
+
describe('e2e -> topic', async () => {
|
|
23
|
+
const c = getTestClient();
|
|
24
|
+
const streamId = 111;
|
|
25
|
+
const topicId = 123;
|
|
26
|
+
await c.stream.create({ streamId, name: 'e2e-tcp-topic-stream' });
|
|
27
|
+
it('e2e -> topic::create', async () => {
|
|
28
|
+
const topic = await c.topic.create({
|
|
29
|
+
streamId, topicId,
|
|
30
|
+
name: 'e2e-tcp-topic',
|
|
31
|
+
partitionCount: 0,
|
|
32
|
+
compressionAlgorithm: 1,
|
|
33
|
+
messageExpiry: 0n,
|
|
34
|
+
replicationFactor: 1
|
|
35
|
+
});
|
|
36
|
+
assert.ok(topic);
|
|
37
|
+
});
|
|
38
|
+
it('e2e -> topic::list', async () => {
|
|
39
|
+
const topics = await c.topic.list({ streamId });
|
|
40
|
+
assert.ok(topics.length > 0);
|
|
41
|
+
});
|
|
42
|
+
it('e2e -> topic::get', async () => {
|
|
43
|
+
const topic = await c.topic.get({ streamId, topicId });
|
|
44
|
+
assert.ok(topic);
|
|
45
|
+
});
|
|
46
|
+
it('e2e -> topic::createPartition', async () => {
|
|
47
|
+
const cp = await c.partition.create({
|
|
48
|
+
streamId, topicId,
|
|
49
|
+
partitionCount: 22
|
|
50
|
+
});
|
|
51
|
+
assert.ok(cp);
|
|
52
|
+
});
|
|
53
|
+
it('e2e -> topic::deletePartition', async () => {
|
|
54
|
+
const dp = await c.partition.delete({
|
|
55
|
+
streamId, topicId,
|
|
56
|
+
partitionCount: 19
|
|
57
|
+
});
|
|
58
|
+
assert.ok(dp);
|
|
59
|
+
});
|
|
60
|
+
it('e2e -> topic::update', async () => {
|
|
61
|
+
const topic = await c.topic.get({ streamId, topicId });
|
|
62
|
+
const u2 = await c.topic.update({
|
|
63
|
+
streamId, topicId,
|
|
64
|
+
name: topic.name,
|
|
65
|
+
messageExpiry: 42n
|
|
66
|
+
});
|
|
67
|
+
assert.ok(u2);
|
|
68
|
+
});
|
|
69
|
+
it('e2e -> topic::purge', async () => {
|
|
70
|
+
assert.ok(await c.topic.purge({ streamId, topicId }));
|
|
71
|
+
});
|
|
72
|
+
it('e2e -> topic::delete', async () => {
|
|
73
|
+
assert.ok(await c.topic.delete({ streamId, topicId, partitionsCount: 0 }));
|
|
74
|
+
});
|
|
75
|
+
it('e2e -> topic::cleanup', async () => {
|
|
76
|
+
assert.ok(await c.stream.delete({ streamId }));
|
|
77
|
+
assert.ok(await c.session.logout());
|
|
78
|
+
});
|
|
79
|
+
after(() => {
|
|
80
|
+
c.destroy();
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
//# sourceMappingURL=tcp.topic.e2e.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=tcp.user.e2e.d.ts.map
|