apache-iggy 0.6.0 → 0.7.0

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.
Files changed (149) hide show
  1. package/dist/client/client.connection.d.ts +49 -0
  2. package/dist/client/client.connection.js +79 -0
  3. package/dist/client/client.d.ts +46 -0
  4. package/dist/client/client.debug.d.ts +4 -0
  5. package/dist/client/client.debug.js +4 -0
  6. package/dist/client/client.js +65 -1
  7. package/dist/client/client.socket.d.ts +91 -0
  8. package/dist/client/client.socket.js +94 -0
  9. package/dist/client/client.type.d.ts +72 -0
  10. package/dist/client/client.type.js +3 -0
  11. package/dist/client/client.utils.d.ts +28 -0
  12. package/dist/client/client.utils.js +29 -0
  13. package/dist/e2e/tcp.cluster.e2e.js +1 -1
  14. package/dist/index.d.ts +3 -3
  15. package/dist/index.js +3 -3
  16. package/dist/tcp.sm.utils.d.ts +31 -42
  17. package/dist/tcp.sm.utils.js +38 -22
  18. package/dist/type.utils.d.ts +14 -0
  19. package/dist/type.utils.js +9 -0
  20. package/dist/wire/command-set.d.ts +2 -9
  21. package/dist/wire/command.utils.d.ts +18 -0
  22. package/dist/wire/command.utils.js +9 -0
  23. package/dist/wire/consumer-group/create-group.command.d.ts +13 -0
  24. package/dist/wire/consumer-group/create-group.command.js +7 -0
  25. package/dist/wire/consumer-group/delete-group.command.d.ts +13 -0
  26. package/dist/wire/consumer-group/delete-group.command.js +7 -0
  27. package/dist/wire/consumer-group/ensure-group.virtual.command.d.ts +15 -1
  28. package/dist/wire/consumer-group/ensure-group.virtual.command.js +14 -0
  29. package/dist/wire/consumer-group/get-group.command.d.ts +13 -0
  30. package/dist/wire/consumer-group/get-group.command.js +7 -0
  31. package/dist/wire/consumer-group/get-groups.command.d.ts +12 -0
  32. package/dist/wire/consumer-group/get-groups.command.js +7 -0
  33. package/dist/wire/consumer-group/group.utils.d.ts +34 -0
  34. package/dist/wire/consumer-group/group.utils.js +22 -0
  35. package/dist/wire/consumer-group/join-group.command.d.ts +13 -0
  36. package/dist/wire/consumer-group/join-group.command.js +7 -0
  37. package/dist/wire/consumer-group/leave-group.command.d.ts +13 -0
  38. package/dist/wire/consumer-group/leave-group.command.js +7 -0
  39. package/dist/wire/identifier.utils.d.ts +11 -0
  40. package/dist/wire/identifier.utils.js +23 -1
  41. package/dist/wire/message/flush-unsaved-buffers.command.d.ts +13 -0
  42. package/dist/wire/message/flush-unsaved-buffers.command.js +7 -0
  43. package/dist/wire/message/header.type.d.ts +57 -15
  44. package/dist/wire/message/header.type.js +31 -18
  45. package/dist/wire/message/header.utils.d.ts +104 -10
  46. package/dist/wire/message/header.utils.js +233 -86
  47. package/dist/wire/message/header.utils.test.js +39 -16
  48. package/dist/wire/message/iggy-header.utils.d.ts +39 -1
  49. package/dist/wire/message/iggy-header.utils.js +30 -3
  50. package/dist/wire/message/index.d.ts +5 -5
  51. package/dist/wire/message/index.js +5 -5
  52. package/dist/wire/message/message.utils.d.ts +60 -0
  53. package/dist/wire/message/message.utils.js +54 -1
  54. package/dist/wire/message/partitioning.utils.d.ts +39 -0
  55. package/dist/wire/message/partitioning.utils.js +43 -1
  56. package/dist/wire/message/poll-messages.command.d.ts +17 -0
  57. package/dist/wire/message/poll-messages.command.js +7 -0
  58. package/dist/wire/message/poll.utils.d.ts +93 -12
  59. package/dist/wire/message/poll.utils.js +92 -21
  60. package/dist/wire/message/send-messages.command.d.ts +14 -0
  61. package/dist/wire/message/send-messages.command.js +7 -0
  62. package/dist/wire/message/send-messages.command.test.js +103 -39
  63. package/dist/wire/number.utils.d.ts +79 -0
  64. package/dist/wire/number.utils.js +79 -2
  65. package/dist/wire/offset/delete-offset.command.d.ts +13 -3
  66. package/dist/wire/offset/delete-offset.command.js +7 -0
  67. package/dist/wire/offset/get-offset.command.d.ts +14 -0
  68. package/dist/wire/offset/get-offset.command.js +7 -0
  69. package/dist/wire/offset/offset.utils.d.ts +48 -0
  70. package/dist/wire/offset/offset.utils.js +33 -0
  71. package/dist/wire/offset/store-offset.command.d.ts +15 -0
  72. package/dist/wire/offset/store-offset.command.js +7 -0
  73. package/dist/wire/partition/create-partition.command.d.ts +13 -0
  74. package/dist/wire/partition/create-partition.command.js +7 -0
  75. package/dist/wire/partition/delete-partition.command.d.ts +13 -0
  76. package/dist/wire/partition/delete-partition.command.js +7 -0
  77. package/dist/wire/partition/partition.utils.d.ts +9 -0
  78. package/dist/wire/partition/partition.utils.js +9 -0
  79. package/dist/wire/serialize.utils.d.ts +20 -0
  80. package/dist/wire/serialize.utils.js +20 -0
  81. package/dist/wire/session/login-with-token.command.d.ts +11 -0
  82. package/dist/wire/session/login-with-token.command.js +7 -0
  83. package/dist/wire/session/login.command.d.ts +7 -0
  84. package/dist/wire/session/login.command.js +7 -0
  85. package/dist/wire/session/login.utils.d.ts +25 -0
  86. package/dist/wire/session/login.utils.js +14 -0
  87. package/dist/wire/session/logout.command.d.ts +7 -0
  88. package/dist/wire/session/logout.command.js +7 -0
  89. package/dist/wire/stream/create-stream.command.d.ts +12 -0
  90. package/dist/wire/stream/create-stream.command.js +7 -0
  91. package/dist/wire/stream/delete-stream.command.d.ts +11 -0
  92. package/dist/wire/stream/delete-stream.command.js +7 -0
  93. package/dist/wire/stream/ensure-stream.virtual.command.d.ts +8 -1
  94. package/dist/wire/stream/ensure-stream.virtual.command.js +7 -0
  95. package/dist/wire/stream/get-stream.command.d.ts +11 -0
  96. package/dist/wire/stream/get-stream.command.js +7 -0
  97. package/dist/wire/stream/get-streams.command.d.ts +7 -0
  98. package/dist/wire/stream/get-streams.command.js +7 -0
  99. package/dist/wire/stream/purge-stream.command.d.ts +11 -0
  100. package/dist/wire/stream/purge-stream.command.js +7 -0
  101. package/dist/wire/stream/stream.utils.d.ts +22 -0
  102. package/dist/wire/stream/stream.utils.js +8 -0
  103. package/dist/wire/stream/update-stream.command.d.ts +12 -0
  104. package/dist/wire/stream/update-stream.command.js +7 -0
  105. package/dist/wire/token/create-token.command.d.ts +12 -0
  106. package/dist/wire/token/create-token.command.js +7 -0
  107. package/dist/wire/token/delete-token.command.d.ts +11 -0
  108. package/dist/wire/token/delete-token.command.js +7 -0
  109. package/dist/wire/token/get-tokens.command.d.ts +7 -0
  110. package/dist/wire/token/get-tokens.command.js +7 -0
  111. package/dist/wire/token/token.utils.d.ts +40 -0
  112. package/dist/wire/token/token.utils.js +21 -0
  113. package/dist/wire/topic/create-topic.command.d.ts +17 -0
  114. package/dist/wire/topic/create-topic.command.js +7 -0
  115. package/dist/wire/topic/delete-topic.command.d.ts +14 -2
  116. package/dist/wire/topic/delete-topic.command.js +7 -0
  117. package/dist/wire/topic/ensure-topic.virtual.command.d.ts +9 -2
  118. package/dist/wire/topic/ensure-topic.virtual.command.js +7 -0
  119. package/dist/wire/topic/get-topic.command.d.ts +13 -2
  120. package/dist/wire/topic/get-topic.command.js +7 -0
  121. package/dist/wire/topic/get-topics.command.d.ts +11 -0
  122. package/dist/wire/topic/get-topics.command.js +7 -0
  123. package/dist/wire/topic/purge-topic.command.d.ts +12 -0
  124. package/dist/wire/topic/purge-topic.command.js +7 -0
  125. package/dist/wire/topic/topic.utils.d.ts +73 -0
  126. package/dist/wire/topic/topic.utils.js +40 -0
  127. package/dist/wire/topic/update-topic.command.d.ts +17 -0
  128. package/dist/wire/topic/update-topic.command.js +7 -0
  129. package/dist/wire/user/change-password.command.d.ts +13 -0
  130. package/dist/wire/user/change-password.command.js +7 -0
  131. package/dist/wire/user/create-user.command.d.ts +14 -0
  132. package/dist/wire/user/create-user.command.js +7 -0
  133. package/dist/wire/user/delete-user.command.d.ts +11 -0
  134. package/dist/wire/user/delete-user.command.js +7 -0
  135. package/dist/wire/user/get-user.command.d.ts +11 -0
  136. package/dist/wire/user/get-user.command.js +7 -0
  137. package/dist/wire/user/get-users.command.d.ts +7 -0
  138. package/dist/wire/user/get-users.command.js +7 -0
  139. package/dist/wire/user/permissions.utils.d.ts +108 -0
  140. package/dist/wire/user/permissions.utils.js +68 -0
  141. package/dist/wire/user/update-permissions.command.d.ts +12 -0
  142. package/dist/wire/user/update-permissions.command.js +7 -0
  143. package/dist/wire/user/update-user.command.d.ts +13 -0
  144. package/dist/wire/user/update-user.command.js +7 -0
  145. package/dist/wire/user/user.utils.d.ts +40 -0
  146. package/dist/wire/user/user.utils.js +33 -0
  147. package/dist/wire/uuid.utils.d.ts +13 -0
  148. package/dist/wire/uuid.utils.js +13 -1
  149. package/package.json +2 -2
@@ -19,6 +19,10 @@
19
19
  import { deserializeVoidResponse } from '../../client/client.utils.js';
20
20
  import { wrapCommand } from '../command.utils.js';
21
21
  import { COMMAND_CODE } from '../command.code.js';
22
+ /**
23
+ * Logout command definition.
24
+ * Ends the current user session.
25
+ */
22
26
  export const LOGOUT = {
23
27
  code: COMMAND_CODE.LogoutUser,
24
28
  serialize: () => {
@@ -26,5 +30,8 @@ export const LOGOUT = {
26
30
  },
27
31
  deserialize: deserializeVoidResponse
28
32
  };
33
+ /**
34
+ * Executable logout command function.
35
+ */
29
36
  export const logout = wrapCommand(LOGOUT);
30
37
  //# sourceMappingURL=logout.command.js.map
@@ -18,14 +18,26 @@
18
18
  */
19
19
  import type { CommandResponse } from '../../client/client.type.js';
20
20
  import { type Stream } from './stream.utils.js';
21
+ /**
22
+ * Parameters for the create stream command.
23
+ */
21
24
  export type CreateStream = {
25
+ /** Optional stream ID (auto-assigned by server if not provided) */
22
26
  streamId?: number;
27
+ /** Stream name (1-255 bytes) */
23
28
  name: string;
24
29
  };
30
+ /**
31
+ * Create stream command definition.
32
+ * Creates a new stream with the specified name.
33
+ */
25
34
  export declare const CREATE_STREAM: {
26
35
  code: number;
27
36
  serialize: ({ name }: CreateStream) => Buffer<ArrayBuffer>;
28
37
  deserialize: (r: CommandResponse) => Stream;
29
38
  };
39
+ /**
40
+ * Executable create stream command function.
41
+ */
30
42
  export declare const createStream: (getClient: import("../../client/client.type.js").ClientProvider) => (arg: CreateStream) => Promise<Stream>;
31
43
  //# sourceMappingURL=create-stream.command.d.ts.map
@@ -19,6 +19,10 @@
19
19
  import { wrapCommand } from '../command.utils.js';
20
20
  import { COMMAND_CODE } from '../command.code.js';
21
21
  import { deserializeToStream } from './stream.utils.js';
22
+ /**
23
+ * Create stream command definition.
24
+ * Creates a new stream with the specified name.
25
+ */
22
26
  export const CREATE_STREAM = {
23
27
  code: COMMAND_CODE.CreateStream,
24
28
  serialize: ({ name }) => {
@@ -37,5 +41,8 @@ export const CREATE_STREAM = {
37
41
  return deserializeToStream(r.data, 0).data;
38
42
  }
39
43
  };
44
+ /**
45
+ * Executable create stream command function.
46
+ */
40
47
  export const createStream = wrapCommand(CREATE_STREAM);
41
48
  //# sourceMappingURL=create-stream.command.js.map
@@ -17,13 +17,24 @@
17
17
  * under the License.
18
18
  */
19
19
  import { type Id } from '../identifier.utils.js';
20
+ /**
21
+ * Parameters for the delete stream command.
22
+ */
20
23
  export type DeleteStream = {
24
+ /** Stream identifier (ID or name) */
21
25
  streamId: Id;
22
26
  };
27
+ /**
28
+ * Delete stream command definition.
29
+ * Removes a stream and all its topics from the system.
30
+ */
23
31
  export declare const DELETE_STREAM: {
24
32
  code: number;
25
33
  serialize: ({ streamId }: DeleteStream) => Buffer<ArrayBufferLike>;
26
34
  deserialize: (r: import("../../index.js").CommandResponse) => boolean;
27
35
  };
36
+ /**
37
+ * Executable delete stream command function.
38
+ */
28
39
  export declare const deleteStream: (getClient: import("../../index.js").ClientProvider) => (arg: DeleteStream) => Promise<boolean>;
29
40
  //# sourceMappingURL=delete-stream.command.d.ts.map
@@ -20,6 +20,10 @@ import { deserializeVoidResponse } from '../../client/client.utils.js';
20
20
  import { wrapCommand } from '../command.utils.js';
21
21
  import { COMMAND_CODE } from '../command.code.js';
22
22
  import { serializeIdentifier } from '../identifier.utils.js';
23
+ /**
24
+ * Delete stream command definition.
25
+ * Removes a stream and all its topics from the system.
26
+ */
23
27
  export const DELETE_STREAM = {
24
28
  code: COMMAND_CODE.DeleteStream,
25
29
  serialize: ({ streamId }) => {
@@ -27,5 +31,8 @@ export const DELETE_STREAM = {
27
31
  },
28
32
  deserialize: deserializeVoidResponse
29
33
  };
34
+ /**
35
+ * Executable delete stream command function.
36
+ */
30
37
  export const deleteStream = wrapCommand(DELETE_STREAM);
31
38
  //# sourceMappingURL=delete-stream.command.js.map
@@ -16,6 +16,13 @@
16
16
  * specific language governing permissions and limitations
17
17
  * under the License.
18
18
  */
19
- import { ClientProvider } from '../../client/index.js';
19
+ import type { ClientProvider } from '../../client/index.js';
20
+ /**
21
+ * Creates a virtual command that ensures a stream exists.
22
+ * If the stream does not exist, it will be created.
23
+ *
24
+ * @param c - Client provider function
25
+ * @returns Function that ensures a stream exists by name
26
+ */
20
27
  export declare const ensureStream: (c: ClientProvider) => (streamName: string) => Promise<import("./stream.utils.js").Stream>;
21
28
  //# sourceMappingURL=ensure-stream.virtual.command.d.ts.map
@@ -18,6 +18,13 @@
18
18
  */
19
19
  import { createStream } from './create-stream.command.js';
20
20
  import { getStream } from './get-stream.command.js';
21
+ /**
22
+ * Creates a virtual command that ensures a stream exists.
23
+ * If the stream does not exist, it will be created.
24
+ *
25
+ * @param c - Client provider function
26
+ * @returns Function that ensures a stream exists by name
27
+ */
21
28
  export const ensureStream = (c) => async function ensureStream(streamName) {
22
29
  const stream = await getStream(c)({ streamId: streamName });
23
30
  return stream === null ?
@@ -19,13 +19,24 @@
19
19
  import type { CommandResponse } from '../../client/client.type.js';
20
20
  import { type Id } from '../identifier.utils.js';
21
21
  import { type Stream } from './stream.utils.js';
22
+ /**
23
+ * Parameters for the get stream command.
24
+ */
22
25
  export type GetStream = {
26
+ /** Stream identifier (ID or name) */
23
27
  streamId: Id;
24
28
  };
29
+ /**
30
+ * Get stream command definition.
31
+ * Retrieves a single stream by ID or name.
32
+ */
25
33
  export declare const GET_STREAM: {
26
34
  code: number;
27
35
  serialize: ({ streamId }: GetStream) => Buffer<ArrayBufferLike>;
28
36
  deserialize: (r: CommandResponse) => Stream | null;
29
37
  };
38
+ /**
39
+ * Executable get stream command function.
40
+ */
30
41
  export declare const getStream: (getClient: import("../../client/client.type.js").ClientProvider) => (arg: GetStream) => Promise<Stream | null>;
31
42
  //# sourceMappingURL=get-stream.command.d.ts.map
@@ -20,6 +20,10 @@ import { wrapCommand } from '../command.utils.js';
20
20
  import { COMMAND_CODE } from '../command.code.js';
21
21
  import { serializeIdentifier } from '../identifier.utils.js';
22
22
  import { deserializeToStream } from './stream.utils.js';
23
+ /**
24
+ * Get stream command definition.
25
+ * Retrieves a single stream by ID or name.
26
+ */
23
27
  export const GET_STREAM = {
24
28
  code: COMMAND_CODE.GetStream,
25
29
  serialize: ({ streamId }) => {
@@ -31,5 +35,8 @@ export const GET_STREAM = {
31
35
  return deserializeToStream(r.data, 0).data;
32
36
  }
33
37
  };
38
+ /**
39
+ * Executable get stream command function.
40
+ */
34
41
  export const getStream = wrapCommand(GET_STREAM);
35
42
  //# sourceMappingURL=get-stream.command.js.map
@@ -18,10 +18,17 @@
18
18
  */
19
19
  import type { CommandResponse } from '../../client/client.type.js';
20
20
  import { type Stream } from './stream.utils.js';
21
+ /**
22
+ * Get streams command definition.
23
+ * Retrieves all streams.
24
+ */
21
25
  export declare const GET_STREAMS: {
22
26
  code: number;
23
27
  serialize: () => Buffer<ArrayBuffer>;
24
28
  deserialize: (r: CommandResponse) => Stream[];
25
29
  };
30
+ /**
31
+ * Executable get streams command function.
32
+ */
26
33
  export declare const getStreams: (getClient: import("../../client/client.type.js").ClientProvider) => (arg: void) => Promise<Stream[]>;
27
34
  //# sourceMappingURL=get-streams.command.d.ts.map
@@ -19,6 +19,10 @@
19
19
  import { wrapCommand } from '../command.utils.js';
20
20
  import { COMMAND_CODE } from '../command.code.js';
21
21
  import { deserializeToStream } from './stream.utils.js';
22
+ /**
23
+ * Get streams command definition.
24
+ * Retrieves all streams.
25
+ */
22
26
  export const GET_STREAMS = {
23
27
  code: COMMAND_CODE.GetStreams,
24
28
  serialize: () => Buffer.alloc(0),
@@ -34,5 +38,8 @@ export const GET_STREAMS = {
34
38
  return streams;
35
39
  }
36
40
  };
41
+ /**
42
+ * Executable get streams command function.
43
+ */
37
44
  export const getStreams = wrapCommand(GET_STREAMS);
38
45
  //# sourceMappingURL=get-streams.command.js.map
@@ -17,13 +17,24 @@
17
17
  * under the License.
18
18
  */
19
19
  import { type Id } from '../identifier.utils.js';
20
+ /**
21
+ * Parameters for the purge stream command.
22
+ */
20
23
  export type PurgeStream = {
24
+ /** Stream identifier (ID or name) */
21
25
  streamId: Id;
22
26
  };
27
+ /**
28
+ * Purge stream command definition.
29
+ * Deletes all messages from a stream while keeping the stream itself.
30
+ */
23
31
  export declare const PURGE_STREAM: {
24
32
  code: number;
25
33
  serialize: ({ streamId }: PurgeStream) => Buffer<ArrayBufferLike>;
26
34
  deserialize: (r: import("../../index.js").CommandResponse) => boolean;
27
35
  };
36
+ /**
37
+ * Executable purge stream command function.
38
+ */
28
39
  export declare const purgeStream: (getClient: import("../../index.js").ClientProvider) => (arg: PurgeStream) => Promise<boolean>;
29
40
  //# sourceMappingURL=purge-stream.command.d.ts.map
@@ -20,6 +20,10 @@ import { wrapCommand } from '../command.utils.js';
20
20
  import { COMMAND_CODE } from '../command.code.js';
21
21
  import { deserializeVoidResponse } from '../../client/client.utils.js';
22
22
  import { serializeIdentifier } from '../identifier.utils.js';
23
+ /**
24
+ * Purge stream command definition.
25
+ * Deletes all messages from a stream while keeping the stream itself.
26
+ */
23
27
  export const PURGE_STREAM = {
24
28
  code: COMMAND_CODE.PurgeStream,
25
29
  serialize: ({ streamId }) => {
@@ -27,5 +31,8 @@ export const PURGE_STREAM = {
27
31
  },
28
32
  deserialize: deserializeVoidResponse
29
33
  };
34
+ /**
35
+ * Executable purge stream command function.
36
+ */
30
37
  export const purgeStream = wrapCommand(PURGE_STREAM);
31
38
  //# sourceMappingURL=purge-stream.command.js.map
@@ -16,18 +16,40 @@
16
16
  * specific language governing permissions and limitations
17
17
  * under the License.
18
18
  */
19
+ /**
20
+ * Stream information returned from the server.
21
+ */
19
22
  export type Stream = {
23
+ /** Stream ID */
20
24
  id: number;
25
+ /** Stream name */
21
26
  name: string;
27
+ /** Number of topics in the stream */
22
28
  topicsCount: number;
29
+ /** Total size of the stream in bytes */
23
30
  sizeBytes: bigint;
31
+ /** Total number of messages in the stream */
24
32
  messagesCount: bigint;
33
+ /** Stream creation timestamp */
25
34
  createdAt: Date;
26
35
  };
36
+ /**
37
+ * Result of deserializing a stream.
38
+ */
27
39
  type StreamDeserialized = {
40
+ /** Number of bytes consumed */
28
41
  bytesRead: number;
42
+ /** Deserialized stream data */
29
43
  data: Stream;
30
44
  };
45
+ /**
46
+ * Deserializes a stream from a buffer.
47
+ *
48
+ * @param r - Buffer containing serialized stream data
49
+ * @param pos - Starting position in the buffer
50
+ * @returns Object with bytes read and deserialized stream data
51
+ * @throws Error if the buffer is empty (stream does not exist)
52
+ */
31
53
  export declare const deserializeToStream: (r: Buffer, pos?: number) => StreamDeserialized;
32
54
  export {};
33
55
  //# sourceMappingURL=stream.utils.d.ts.map
@@ -17,6 +17,14 @@
17
17
  * under the License.
18
18
  */
19
19
  import { toDate } from '../serialize.utils.js';
20
+ /**
21
+ * Deserializes a stream from a buffer.
22
+ *
23
+ * @param r - Buffer containing serialized stream data
24
+ * @param pos - Starting position in the buffer
25
+ * @returns Object with bytes read and deserialized stream data
26
+ * @throws Error if the buffer is empty (stream does not exist)
27
+ */
20
28
  export const deserializeToStream = (r, pos = 0) => {
21
29
  if (r.length === 0)
22
30
  throw new Error('Steam does not exist');
@@ -17,14 +17,26 @@
17
17
  * under the License.
18
18
  */
19
19
  import { type Id } from '../identifier.utils.js';
20
+ /**
21
+ * Parameters for the update stream command.
22
+ */
20
23
  export type UpdateStream = {
24
+ /** Stream identifier (ID or name) */
21
25
  streamId: Id;
26
+ /** New stream name (1-255 bytes) */
22
27
  name: string;
23
28
  };
29
+ /**
30
+ * Update stream command definition.
31
+ * Updates a stream's name.
32
+ */
24
33
  export declare const UPDATE_STREAM: {
25
34
  code: number;
26
35
  serialize: ({ streamId, name }: UpdateStream) => Buffer<ArrayBuffer>;
27
36
  deserialize: (r: import("../../index.js").CommandResponse) => boolean;
28
37
  };
38
+ /**
39
+ * Executable update stream command function.
40
+ */
29
41
  export declare const updateStream: (getClient: import("../../index.js").ClientProvider) => (arg: UpdateStream) => Promise<boolean>;
30
42
  //# sourceMappingURL=update-stream.command.d.ts.map
@@ -21,6 +21,10 @@ import { wrapCommand } from '../command.utils.js';
21
21
  import { COMMAND_CODE } from '../command.code.js';
22
22
  import { serializeIdentifier } from '../identifier.utils.js';
23
23
  import { uint8ToBuf } from '../number.utils.js';
24
+ /**
25
+ * Update stream command definition.
26
+ * Updates a stream's name.
27
+ */
24
28
  export const UPDATE_STREAM = {
25
29
  code: COMMAND_CODE.UpdateStream,
26
30
  serialize: ({ streamId, name }) => {
@@ -36,5 +40,8 @@ export const UPDATE_STREAM = {
36
40
  },
37
41
  deserialize: deserializeVoidResponse
38
42
  };
43
+ /**
44
+ * Executable update stream command function.
45
+ */
39
46
  export const updateStream = wrapCommand(UPDATE_STREAM);
40
47
  //# sourceMappingURL=update-stream.command.js.map
@@ -18,14 +18,26 @@
18
18
  */
19
19
  import type { CommandResponse } from '../../client/client.type.js';
20
20
  import { type CreateTokenResponse } from './token.utils.js';
21
+ /**
22
+ * Parameters for the create access token command.
23
+ */
21
24
  export type CreateToken = {
25
+ /** Token name (1-255 bytes) */
22
26
  name: string;
27
+ /** Token expiry time in seconds (default: 600) */
23
28
  expiry?: bigint;
24
29
  };
30
+ /**
31
+ * Create access token command definition.
32
+ * Creates a new access token for authentication.
33
+ */
25
34
  export declare const CREATE_TOKEN: {
26
35
  code: number;
27
36
  serialize: ({ name, expiry }: CreateToken) => Buffer;
28
37
  deserialize: (r: CommandResponse) => CreateTokenResponse;
29
38
  };
39
+ /**
40
+ * Executable create access token command function.
41
+ */
30
42
  export declare const createToken: (getClient: import("../../client/client.type.js").ClientProvider) => (arg: CreateToken) => Promise<CreateTokenResponse>;
31
43
  //# sourceMappingURL=create-token.command.d.ts.map
@@ -19,6 +19,10 @@
19
19
  import { deserializeCreateToken } from './token.utils.js';
20
20
  import { wrapCommand } from '../command.utils.js';
21
21
  import { COMMAND_CODE } from '../command.code.js';
22
+ /**
23
+ * Create access token command definition.
24
+ * Creates a new access token for authentication.
25
+ */
22
26
  export const CREATE_TOKEN = {
23
27
  code: COMMAND_CODE.CreateAccessToken,
24
28
  serialize: ({ name, expiry = 600n }) => {
@@ -33,5 +37,8 @@ export const CREATE_TOKEN = {
33
37
  },
34
38
  deserialize: (r) => deserializeCreateToken(r.data).data
35
39
  };
40
+ /**
41
+ * Executable create access token command function.
42
+ */
36
43
  export const createToken = wrapCommand(CREATE_TOKEN);
37
44
  //# sourceMappingURL=create-token.command.js.map
@@ -16,13 +16,24 @@
16
16
  * specific language governing permissions and limitations
17
17
  * under the License.
18
18
  */
19
+ /**
20
+ * Parameters for the delete access token command.
21
+ */
19
22
  export type DeleteToken = {
23
+ /** Token name (1-255 bytes) */
20
24
  name: string;
21
25
  };
26
+ /**
27
+ * Delete access token command definition.
28
+ * Removes an existing access token.
29
+ */
22
30
  export declare const DELETE_TOKEN: {
23
31
  code: number;
24
32
  serialize: ({ name }: DeleteToken) => Buffer;
25
33
  deserialize: (r: import("../../index.js").CommandResponse) => boolean;
26
34
  };
35
+ /**
36
+ * Executable delete access token command function.
37
+ */
27
38
  export declare const deleteToken: (getClient: import("../../index.js").ClientProvider) => (arg: DeleteToken) => Promise<boolean>;
28
39
  //# sourceMappingURL=delete-token.command.d.ts.map
@@ -20,6 +20,10 @@ import { deserializeVoidResponse } from '../../client/client.utils.js';
20
20
  import { wrapCommand } from '../command.utils.js';
21
21
  import { COMMAND_CODE } from '../command.code.js';
22
22
  import { uint8ToBuf } from '../number.utils.js';
23
+ /**
24
+ * Delete access token command definition.
25
+ * Removes an existing access token.
26
+ */
23
27
  export const DELETE_TOKEN = {
24
28
  code: COMMAND_CODE.DeleteAccessToken,
25
29
  serialize: ({ name }) => {
@@ -34,5 +38,8 @@ export const DELETE_TOKEN = {
34
38
  },
35
39
  deserialize: deserializeVoidResponse
36
40
  };
41
+ /**
42
+ * Executable delete access token command function.
43
+ */
37
44
  export const deleteToken = wrapCommand(DELETE_TOKEN);
38
45
  //# sourceMappingURL=delete-token.command.js.map
@@ -18,10 +18,17 @@
18
18
  */
19
19
  import type { CommandResponse } from '../../client/client.type.js';
20
20
  import { type Token } from './token.utils.js';
21
+ /**
22
+ * Get access tokens command definition.
23
+ * Retrieves all access tokens for the current user.
24
+ */
21
25
  export declare const GET_TOKENS: {
22
26
  code: number;
23
27
  serialize: () => Buffer;
24
28
  deserialize: (r: CommandResponse) => Token[];
25
29
  };
30
+ /**
31
+ * Executable get access tokens command function.
32
+ */
26
33
  export declare const getTokens: (getClient: import("../../client/client.type.js").ClientProvider) => (arg: void) => Promise<Token[]>;
27
34
  //# sourceMappingURL=get-tokens.command.d.ts.map
@@ -19,10 +19,17 @@
19
19
  import { wrapCommand } from '../command.utils.js';
20
20
  import { COMMAND_CODE } from '../command.code.js';
21
21
  import { deserializeTokens } from './token.utils.js';
22
+ /**
23
+ * Get access tokens command definition.
24
+ * Retrieves all access tokens for the current user.
25
+ */
22
26
  export const GET_TOKENS = {
23
27
  code: COMMAND_CODE.GetAccessTokens,
24
28
  serialize: () => Buffer.alloc(0),
25
29
  deserialize: (r) => deserializeTokens(r.data)
26
30
  };
31
+ /**
32
+ * Executable get access tokens command function.
33
+ */
27
34
  export const getTokens = wrapCommand(GET_TOKENS);
28
35
  //# sourceMappingURL=get-tokens.command.js.map
@@ -16,23 +16,63 @@
16
16
  * specific language governing permissions and limitations
17
17
  * under the License.
18
18
  */
19
+ /**
20
+ * Response from creating an access token.
21
+ */
19
22
  export type CreateTokenResponse = {
23
+ /** The generated access token string */
20
24
  token: string;
21
25
  };
26
+ /**
27
+ * Result of deserializing a token creation response.
28
+ */
22
29
  type TokenDeserialized = {
30
+ /** Number of bytes consumed */
23
31
  bytesRead: number;
32
+ /** Deserialized token response */
24
33
  data: CreateTokenResponse;
25
34
  };
35
+ /**
36
+ * Access token information.
37
+ */
26
38
  export type Token = {
39
+ /** Token name */
27
40
  name: string;
41
+ /** Token expiry timestamp (null if no expiry) */
28
42
  expiry: Date | null;
29
43
  };
44
+ /**
45
+ * Result of deserializing a token.
46
+ */
30
47
  type TokenSerialized = {
48
+ /** Number of bytes consumed */
31
49
  bytesRead: number;
50
+ /** Deserialized token data */
32
51
  data: Token;
33
52
  };
53
+ /**
54
+ * Deserializes a token creation response from a buffer.
55
+ *
56
+ * @param p - Buffer containing serialized token response
57
+ * @param pos - Starting position in the buffer
58
+ * @returns Object with bytes read and token string
59
+ */
34
60
  export declare const deserializeCreateToken: (p: Buffer, pos?: number) => TokenDeserialized;
61
+ /**
62
+ * Deserializes a token from a buffer.
63
+ *
64
+ * @param p - Buffer containing serialized token data
65
+ * @param pos - Starting position in the buffer
66
+ * @returns Object with bytes read and deserialized token data
67
+ */
35
68
  export declare const deserializeToken: (p: Buffer, pos?: number) => TokenSerialized;
69
+ /**
70
+ * Deserializes multiple tokens from a buffer.
71
+ *
72
+ * @param p - Buffer containing serialized tokens data
73
+ * @param pos - Starting position in the buffer
74
+ * @returns Array of deserialized tokens
75
+ */
36
76
  export declare const deserializeTokens: (p: Buffer, pos?: number) => Token[];
37
77
  export {};
38
78
  //# sourceMappingURL=token.utils.d.ts.map
@@ -17,11 +17,25 @@
17
17
  * under the License.
18
18
  */
19
19
  import { toDate } from '../serialize.utils.js';
20
+ /**
21
+ * Deserializes a token creation response from a buffer.
22
+ *
23
+ * @param p - Buffer containing serialized token response
24
+ * @param pos - Starting position in the buffer
25
+ * @returns Object with bytes read and token string
26
+ */
20
27
  export const deserializeCreateToken = (p, pos = 0) => {
21
28
  const len = p.readUInt8(pos);
22
29
  const token = p.subarray(pos + 1, pos + 1 + len).toString();
23
30
  return { bytesRead: 1 + len, data: { token } };
24
31
  };
32
+ /**
33
+ * Deserializes a token from a buffer.
34
+ *
35
+ * @param p - Buffer containing serialized token data
36
+ * @param pos - Starting position in the buffer
37
+ * @returns Object with bytes read and deserialized token data
38
+ */
25
39
  export const deserializeToken = (p, pos = 0) => {
26
40
  const nameLength = p.readUInt8(pos);
27
41
  const name = p.subarray(pos + 1, pos + 1 + nameLength).toString();
@@ -40,6 +54,13 @@ export const deserializeToken = (p, pos = 0) => {
40
54
  }
41
55
  };
42
56
  };
57
+ /**
58
+ * Deserializes multiple tokens from a buffer.
59
+ *
60
+ * @param p - Buffer containing serialized tokens data
61
+ * @param pos - Starting position in the buffer
62
+ * @returns Array of deserialized tokens
63
+ */
43
64
  export const deserializeTokens = (p, pos = 0) => {
44
65
  const tokens = [];
45
66
  const len = p.length;
@@ -19,19 +19,36 @@
19
19
  import type { CommandResponse } from '../../client/client.type.js';
20
20
  import { type Id } from '../identifier.utils.js';
21
21
  import { type Topic, type CompressionAlgorithm as CompressionAlgorithmT } from './topic.utils.js';
22
+ /**
23
+ * Parameters for the create topic command.
24
+ */
22
25
  export type CreateTopic = {
26
+ /** Stream identifier (ID or name) */
23
27
  streamId: Id;
28
+ /** Topic name (1-255 bytes) */
24
29
  name: string;
30
+ /** Number of partitions to create */
25
31
  partitionCount: number;
32
+ /** Compression algorithm (None or Gzip) */
26
33
  compressionAlgorithm: CompressionAlgorithmT;
34
+ /** Message expiry time in microseconds (0 = unlimited) */
27
35
  messageExpiry?: bigint;
36
+ /** Maximum topic size in bytes (0 = unlimited) */
28
37
  maxTopicSize?: bigint;
38
+ /** Replication factor (1-255) */
29
39
  replicationFactor?: number;
30
40
  };
41
+ /**
42
+ * Create topic command definition.
43
+ * Creates a new topic within a stream.
44
+ */
31
45
  export declare const CREATE_TOPIC: {
32
46
  code: number;
33
47
  serialize: ({ streamId, name, partitionCount, compressionAlgorithm, messageExpiry, maxTopicSize, replicationFactor }: CreateTopic) => Buffer<ArrayBuffer>;
34
48
  deserialize: (r: CommandResponse) => Topic;
35
49
  };
50
+ /**
51
+ * Executable create topic command function.
52
+ */
36
53
  export declare const createTopic: (getClient: import("../../client/client.type.js").ClientProvider) => (arg: CreateTopic) => Promise<Topic>;
37
54
  //# sourceMappingURL=create-topic.command.d.ts.map