@platformatic/kafka 1.23.0 → 1.24.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 (122) hide show
  1. package/dist/apis/admin/alter-client-quotas-v1.d.ts +4 -4
  2. package/dist/apis/admin/alter-configs-v2.d.ts +3 -2
  3. package/dist/apis/admin/alter-partition-reassignments-v0.js +1 -1
  4. package/dist/apis/admin/create-acls-v3.d.ts +3 -11
  5. package/dist/apis/admin/create-partitions-v3.d.ts +2 -2
  6. package/dist/apis/admin/delete-acls-v3.d.ts +4 -19
  7. package/dist/apis/admin/delete-acls-v3.js +6 -6
  8. package/dist/apis/admin/describe-acls-v3.d.ts +5 -13
  9. package/dist/apis/admin/describe-acls-v3.js +9 -9
  10. package/dist/apis/admin/describe-client-quotas-v0.d.ts +5 -5
  11. package/dist/apis/admin/describe-configs-v4.d.ts +7 -6
  12. package/dist/apis/admin/describe-configs-v4.js +1 -1
  13. package/dist/apis/admin/incremental-alter-configs-v1.d.ts +12 -5
  14. package/dist/apis/admin/incremental-alter-configs-v1.js +3 -1
  15. package/dist/apis/admin/list-groups-v4.d.ts +2 -2
  16. package/dist/apis/admin/list-groups-v5.d.ts +2 -2
  17. package/dist/apis/admin/offset-delete-v0.js +3 -3
  18. package/dist/apis/callbacks.d.ts +3 -1
  19. package/dist/apis/consumer/offset-commit-v9.d.ts +2 -2
  20. package/dist/apis/consumer/offset-fetch-v8.d.ts +2 -2
  21. package/dist/apis/consumer/offset-fetch-v9.d.ts +2 -2
  22. package/dist/apis/definitions.d.ts +2 -2
  23. package/dist/apis/enumerations.d.ts +134 -42
  24. package/dist/apis/enumerations.js +42 -6
  25. package/dist/apis/index.d.ts +1 -0
  26. package/dist/apis/index.js +1 -0
  27. package/dist/apis/producer/add-offsets-to-txn-v3.d.ts +10 -0
  28. package/dist/apis/producer/add-offsets-to-txn-v3.js +34 -0
  29. package/dist/apis/producer/add-partitions-to-txn-v3.d.ts +34 -0
  30. package/dist/apis/producer/add-partitions-to-txn-v3.js +67 -0
  31. package/dist/apis/producer/add-partitions-to-txn-v4.d.ts +34 -0
  32. package/dist/apis/producer/add-partitions-to-txn-v4.js +79 -0
  33. package/dist/apis/producer/end-txn-v3.d.ts +10 -0
  34. package/dist/apis/producer/end-txn-v3.js +34 -0
  35. package/dist/apis/producer/index.d.ts +5 -0
  36. package/dist/apis/producer/index.js +5 -0
  37. package/dist/apis/producer/txn-offset-commit-v3.d.ts +29 -0
  38. package/dist/apis/producer/txn-offset-commit-v3.js +74 -0
  39. package/dist/apis/types.d.ts +16 -0
  40. package/dist/apis/types.js +1 -0
  41. package/dist/clients/admin/admin.d.ts +31 -1
  42. package/dist/clients/admin/admin.js +732 -50
  43. package/dist/clients/admin/options.d.ts +577 -0
  44. package/dist/clients/admin/options.js +359 -2
  45. package/dist/clients/admin/types.d.ts +105 -3
  46. package/dist/clients/base/base.js +29 -26
  47. package/dist/clients/base/options.d.ts +2 -5
  48. package/dist/clients/base/options.js +0 -1
  49. package/dist/clients/base/types.d.ts +8 -2
  50. package/dist/clients/consumer/consumer.d.ts +58 -2
  51. package/dist/clients/consumer/consumer.js +116 -47
  52. package/dist/clients/consumer/messages-stream.d.ts +1 -0
  53. package/dist/clients/consumer/messages-stream.js +48 -17
  54. package/dist/clients/consumer/options.d.ts +6 -6
  55. package/dist/clients/consumer/options.js +3 -3
  56. package/dist/clients/consumer/types.d.ts +26 -3
  57. package/dist/clients/index.d.ts +1 -1
  58. package/dist/clients/index.js +1 -1
  59. package/dist/clients/producer/options.d.ts +12 -3
  60. package/dist/clients/producer/options.js +1 -0
  61. package/dist/clients/producer/producer.d.ts +19 -2
  62. package/dist/clients/producer/producer.js +335 -37
  63. package/dist/clients/producer/transaction.d.ts +30 -0
  64. package/dist/clients/producer/transaction.js +172 -0
  65. package/dist/clients/producer/types.d.ts +2 -0
  66. package/dist/diagnostic.d.ts +5 -0
  67. package/dist/diagnostic.js +5 -0
  68. package/dist/errors.js +1 -0
  69. package/dist/network/connection-pool.js +4 -4
  70. package/dist/network/connection.js +3 -2
  71. package/dist/protocol/records.d.ts +12 -0
  72. package/dist/protocol/records.js +6 -4
  73. package/dist/protocol/sasl/oauth-bearer.js +4 -4
  74. package/dist/protocol/sasl/plain.js +2 -2
  75. package/dist/protocol/sasl/scram-sha.js +8 -8
  76. package/dist/protocol/sasl/utils.js +5 -5
  77. package/dist/symbols.d.ts +8 -0
  78. package/dist/symbols.js +8 -0
  79. package/dist/typescript-4/dist/apis/admin/alter-client-quotas-v1.d.ts +4 -4
  80. package/dist/typescript-4/dist/apis/admin/alter-configs-v2.d.ts +3 -2
  81. package/dist/typescript-4/dist/apis/admin/create-acls-v3.d.ts +3 -11
  82. package/dist/typescript-4/dist/apis/admin/create-partitions-v3.d.ts +2 -2
  83. package/dist/typescript-4/dist/apis/admin/delete-acls-v3.d.ts +4 -19
  84. package/dist/typescript-4/dist/apis/admin/describe-acls-v3.d.ts +5 -13
  85. package/dist/typescript-4/dist/apis/admin/describe-client-quotas-v0.d.ts +5 -5
  86. package/dist/typescript-4/dist/apis/admin/describe-configs-v4.d.ts +7 -6
  87. package/dist/typescript-4/dist/apis/admin/incremental-alter-configs-v1.d.ts +13 -6
  88. package/dist/typescript-4/dist/apis/admin/list-groups-v4.d.ts +2 -2
  89. package/dist/typescript-4/dist/apis/admin/list-groups-v5.d.ts +2 -2
  90. package/dist/typescript-4/dist/apis/callbacks.d.ts +3 -1
  91. package/dist/typescript-4/dist/apis/consumer/offset-commit-v9.d.ts +2 -2
  92. package/dist/typescript-4/dist/apis/consumer/offset-fetch-v8.d.ts +2 -2
  93. package/dist/typescript-4/dist/apis/consumer/offset-fetch-v9.d.ts +2 -2
  94. package/dist/typescript-4/dist/apis/definitions.d.ts +2 -2
  95. package/dist/typescript-4/dist/apis/enumerations.d.ts +134 -42
  96. package/dist/typescript-4/dist/apis/index.d.ts +1 -0
  97. package/dist/typescript-4/dist/apis/producer/add-offsets-to-txn-v3.d.ts +10 -0
  98. package/dist/typescript-4/dist/apis/producer/add-partitions-to-txn-v3.d.ts +34 -0
  99. package/dist/typescript-4/dist/apis/producer/add-partitions-to-txn-v4.d.ts +34 -0
  100. package/dist/typescript-4/dist/apis/producer/end-txn-v3.d.ts +10 -0
  101. package/dist/typescript-4/dist/apis/producer/index.d.ts +5 -0
  102. package/dist/typescript-4/dist/apis/producer/txn-offset-commit-v3.d.ts +29 -0
  103. package/dist/typescript-4/dist/apis/types.d.ts +14 -0
  104. package/dist/typescript-4/dist/clients/admin/admin.d.ts +31 -1
  105. package/dist/typescript-4/dist/clients/admin/options.d.ts +577 -0
  106. package/dist/typescript-4/dist/clients/admin/types.d.ts +105 -3
  107. package/dist/typescript-4/dist/clients/base/options.d.ts +2 -5
  108. package/dist/typescript-4/dist/clients/base/types.d.ts +8 -2
  109. package/dist/typescript-4/dist/clients/consumer/consumer.d.ts +58 -2
  110. package/dist/typescript-4/dist/clients/consumer/messages-stream.d.ts +1 -0
  111. package/dist/typescript-4/dist/clients/consumer/options.d.ts +6 -6
  112. package/dist/typescript-4/dist/clients/consumer/types.d.ts +27 -4
  113. package/dist/typescript-4/dist/clients/index.d.ts +1 -1
  114. package/dist/typescript-4/dist/clients/producer/options.d.ts +12 -3
  115. package/dist/typescript-4/dist/clients/producer/producer.d.ts +19 -2
  116. package/dist/typescript-4/dist/clients/producer/transaction.d.ts +30 -0
  117. package/dist/typescript-4/dist/clients/producer/types.d.ts +2 -0
  118. package/dist/typescript-4/dist/diagnostic.d.ts +5 -0
  119. package/dist/typescript-4/dist/protocol/records.d.ts +12 -0
  120. package/dist/typescript-4/dist/symbols.d.ts +9 -1
  121. package/dist/version.js +1 -1
  122. package/package.json +1 -1
@@ -5,39 +5,58 @@ export declare const SASLMechanisms: {
5
5
  readonly OAUTHBEARER: "OAUTHBEARER";
6
6
  readonly GSSAPI: "GSSAPI";
7
7
  };
8
- export declare const allowedSASLMechanisms: SASLMechanismValue[];
9
- export type SASLMechanism = keyof typeof SASLMechanisms;
10
- export type SASLMechanismValue = (typeof SASLMechanisms)[keyof typeof SASLMechanisms];
8
+ export declare const allowedSASLMechanisms: ("PLAIN" | "SCRAM-SHA-256" | "SCRAM-SHA-512" | "OAUTHBEARER" | "GSSAPI")[];
9
+ export type SASLMechanismLabel = keyof typeof SASLMechanisms;
10
+ export type SASLMechanismValue = (typeof SASLMechanisms)[SASLMechanismLabel];
11
+ /** @deprecated Use SASLMechanismLabel */
12
+ export type SASLMechanism = SASLMechanismLabel;
11
13
  export declare const FindCoordinatorKeyTypes: {
12
14
  readonly GROUP: 0;
13
15
  readonly TRANSACTION: 1;
14
16
  readonly SHARE: 2;
15
17
  };
16
- export type FindCoordinatorKeyType = keyof typeof FindCoordinatorKeyTypes;
18
+ export declare const allowedFindCoordinatorKeyTypes: (0 | 1 | 2)[];
19
+ export type FindCoordinatorKeyTypeLabel = keyof typeof FindCoordinatorKeyTypes;
20
+ export type FindCoordinatorKeyTypeValue = (typeof FindCoordinatorKeyTypes)[FindCoordinatorKeyTypeLabel];
21
+ /** @deprecated Use FindCoordinatorKeyTypeLabel */
22
+ export type FindCoordinatorKeyType = FindCoordinatorKeyTypeLabel;
17
23
  export declare const ProduceAcks: {
18
24
  readonly ALL: -1;
19
25
  readonly NO_RESPONSE: 0;
20
26
  readonly LEADER: 1;
21
27
  };
22
- export declare const allowedProduceAcks: number[];
23
- export type ProduceAck = keyof typeof ProduceAcks;
28
+ export declare const allowedProduceAcks: (0 | 1 | -1)[];
29
+ export type ProduceAckLabel = keyof typeof ProduceAcks;
30
+ export type ProduceAckValue = (typeof ProduceAcks)[ProduceAckLabel];
31
+ /** @deprecated Use ProduceAckLabel */
32
+ export type ProduceAck = ProduceAckLabel;
24
33
  export declare const GroupProtocols: {
25
34
  readonly CLASSIC: "classic";
26
35
  readonly CONSUMER: "consumer";
27
36
  };
28
37
  export declare const allowedGroupProtocols: ("consumer" | "classic")[];
29
- export type GroupProtocol = keyof typeof GroupProtocols;
38
+ export type GroupProtocolLabel = keyof typeof GroupProtocols;
39
+ export type GroupProtocolValue = (typeof GroupProtocols)[GroupProtocolLabel];
40
+ /** @deprecated Use GroupProtocolLabel */
41
+ export type GroupProtocol = GroupProtocolLabel;
30
42
  export declare const FetchIsolationLevels: {
31
- READ_UNCOMMITTED: number;
32
- READ_COMMITTED: number;
33
- };
34
- export declare const allowedFetchIsolationLevels: number[];
35
- export type FetchIsolationLevel = keyof typeof FetchIsolationLevels;
43
+ readonly READ_UNCOMMITTED: 0;
44
+ readonly READ_COMMITTED: 1;
45
+ };
46
+ export declare const allowedFetchIsolationLevels: (0 | 1)[];
47
+ export type FetchIsolationLevelLabel = keyof typeof FetchIsolationLevels;
48
+ export type FetchIsolationLevelValue = (typeof FetchIsolationLevels)[FetchIsolationLevelLabel];
49
+ /** @deprecated Use FetchIsolationLevelLabel */
50
+ export type FetchIsolationLevel = FetchIsolationLevelLabel;
36
51
  export declare const ListOffsetTimestamps: {
37
- LATEST: bigint;
38
- EARLIEST: bigint;
39
- };
40
- export type ListOffsetTimestamp = keyof typeof ListOffsetTimestamps;
52
+ readonly LATEST: -1n;
53
+ readonly EARLIEST: -2n;
54
+ };
55
+ export declare const allowedListOffsetTimestamps: (-1n | -2n)[];
56
+ export type ListOffsetTimestampLabel = keyof typeof ListOffsetTimestamps;
57
+ export type ListOffsetTimestampValue = (typeof ListOffsetTimestamps)[ListOffsetTimestampLabel];
58
+ /** @deprecated Use ListOffsetTimestampLabel */
59
+ export type ListOffsetTimestamp = ListOffsetTimestampLabel;
41
60
  export declare const ResourceTypes: {
42
61
  readonly UNKNOWN: 0;
43
62
  readonly ANY: 1;
@@ -46,8 +65,13 @@ export declare const ResourceTypes: {
46
65
  readonly CLUSTER: 4;
47
66
  readonly TRANSACTIONAL_ID: 5;
48
67
  readonly DELEGATION_TOKEN: 6;
68
+ readonly USER: 7;
49
69
  };
50
- export type ResourceType = keyof typeof ResourceTypes;
70
+ export declare const allowedResourceTypes: (0 | 1 | 7 | 2 | 4 | 3 | 5 | 6)[];
71
+ export type ResourceTypeLabel = keyof typeof ResourceTypes;
72
+ export type ResourceTypeValue = (typeof ResourceTypes)[ResourceTypeLabel];
73
+ /** @deprecated Use ResourceTypeLabel */
74
+ export type ResourceType = ResourceTypeLabel;
51
75
  export declare const ResourcePatternTypes: {
52
76
  readonly UNKNOWN: 0;
53
77
  readonly ANY: 1;
@@ -55,7 +79,11 @@ export declare const ResourcePatternTypes: {
55
79
  readonly LITERAL: 3;
56
80
  readonly PREFIXED: 4;
57
81
  };
58
- export type ResourcePatternType = keyof typeof ResourcePatternTypes;
82
+ export declare const allowedResourcePatternTypes: (0 | 1 | 2 | 4 | 3)[];
83
+ export type ResourcePatternTypeLabel = keyof typeof ResourcePatternTypes;
84
+ export type ResourcePatternTypeValue = (typeof ResourcePatternTypes)[ResourcePatternTypeLabel];
85
+ /** @deprecated Use ResourcePatternTypeLabel */
86
+ export type ResourcePatternType = ResourcePatternTypeLabel;
59
87
  export declare const AclOperations: {
60
88
  readonly UNKNOWN: 0;
61
89
  readonly ANY: 1;
@@ -70,15 +98,26 @@ export declare const AclOperations: {
70
98
  readonly DESCRIBE_CONFIGS: 10;
71
99
  readonly ALTER_CONFIGS: 11;
72
100
  readonly IDEMPOTENT_WRITE: 12;
73
- };
74
- export type AclOperation = keyof typeof AclOperations;
101
+ readonly CREATE_TOKENS: 13;
102
+ readonly DESCRIBE_TOKENS: 14;
103
+ readonly TWO_PHASE_COMMIT: 15;
104
+ };
105
+ export declare const allowedAclOperations: (0 | 1 | 7 | 8 | 2 | 4 | 10 | 3 | 5 | 6 | 9 | 11 | 12 | 13 | 14 | 15)[];
106
+ export type AclOperationLabel = keyof typeof AclOperations;
107
+ export type AclOperationValue = (typeof AclOperations)[AclOperationLabel];
108
+ /** @deprecated Use AclOperationLabel */
109
+ export type AclOperation = AclOperationLabel;
75
110
  export declare const AclPermissionTypes: {
76
111
  readonly UNKNOWN: 0;
77
112
  readonly ANY: 1;
78
113
  readonly DENY: 2;
79
114
  readonly ALLOW: 3;
80
115
  };
81
- export type AclPermissionType = keyof typeof AclPermissionTypes;
116
+ export declare const allowedAclPermissionTypes: (0 | 1 | 2 | 3)[];
117
+ export type AclPermissionTypeLabel = keyof typeof AclPermissionTypes;
118
+ export type AclPermissionTypeValue = (typeof AclPermissionTypes)[AclPermissionTypeLabel];
119
+ /** @deprecated Use AclPermissionTypeLabel */
120
+ export type AclPermissionType = AclPermissionTypeLabel;
82
121
  export declare const ConfigSources: {
83
122
  readonly UNKNOWN: 0;
84
123
  readonly TOPIC_CONFIG: 1;
@@ -87,52 +126,101 @@ export declare const ConfigSources: {
87
126
  readonly STATIC_BROKER_CONFIG: 4;
88
127
  readonly DEFAULT_CONFIG: 5;
89
128
  readonly DYNAMIC_BROKER_LOGGER_CONFIG: 6;
90
- };
91
- export type ConfigSource = keyof typeof ConfigSources;
92
- export declare const ConfigTypes: {
129
+ readonly CLIENT_METRICS_CONFIG: 7;
130
+ readonly GROUP_CONFIG: 8;
131
+ };
132
+ export declare const allowedConfigSources: (0 | 1 | 7 | 8 | 2 | 4 | 3 | 5 | 6)[];
133
+ export type ConfigSourceLabel = keyof typeof ConfigSources;
134
+ export type ConfigSourceValue = (typeof ConfigSources)[ConfigSourceLabel];
135
+ /** @deprecated Use ConfigSourceLabel */
136
+ export type ConfigSource = ConfigSourceLabel;
137
+ export declare const ConfigResourceTypes: {
93
138
  readonly UNKNOWN: 0;
94
139
  readonly TOPIC: 2;
95
140
  readonly BROKER: 4;
96
141
  readonly BROKER_LOGGER: 8;
142
+ readonly CLIENT_METRICS: 16;
143
+ readonly GROUP: 32;
97
144
  };
98
- export type ConfigType = keyof typeof ConfigTypes;
99
- export declare const IncrementalAlterConfigTypes: {
100
- SET: number;
101
- DELETE: number;
102
- APPEND: number;
103
- SUBTRACT: number;
104
- };
105
- export type IncrementalAlterConfigType = keyof typeof IncrementalAlterConfigTypes;
145
+ export declare const allowedConfigResourceTypes: (0 | 8 | 2 | 4 | 16 | 32)[];
146
+ export type ConfigResourceTypeLabel = keyof typeof ConfigResourceTypes;
147
+ export type ConfigResourceTypeValue = (typeof ConfigResourceTypes)[ConfigResourceTypeLabel];
148
+ export declare const ConfigTypes: {
149
+ readonly UNKNOWN: 0;
150
+ readonly BOOLEAN: 1;
151
+ readonly STRING: 2;
152
+ readonly INT: 3;
153
+ readonly SHORT: 4;
154
+ readonly LONG: 5;
155
+ readonly DOUBLE: 6;
156
+ readonly LIST: 7;
157
+ readonly CLASS: 8;
158
+ readonly PASSWORD: 9;
159
+ };
160
+ export declare const allowedConfigTypes: (0 | 1 | 7 | 8 | 2 | 4 | 3 | 5 | 6 | 9)[];
161
+ export type ConfigTypeLabel = keyof typeof ConfigTypes;
162
+ export type ConfigTypeValue = (typeof ConfigTypes)[ConfigTypeLabel];
163
+ export declare const IncrementalAlterConfigOperationTypes: {
164
+ readonly SET: 0;
165
+ readonly DELETE: 1;
166
+ readonly APPEND: 2;
167
+ readonly SUBTRACT: 3;
168
+ };
169
+ export declare const allowedIncrementalAlterConfigOperationTypes: (0 | 1 | 2 | 3)[];
170
+ export type IncrementalAlterConfigOperationTypeLabel = keyof typeof IncrementalAlterConfigOperationTypes;
171
+ export type IncrementalAlterConfigOperationTypeValue = (typeof IncrementalAlterConfigOperationTypes)[IncrementalAlterConfigOperationTypeLabel];
106
172
  export declare const ClientQuotaMatchTypes: {
107
173
  readonly EXACT: 0;
108
174
  readonly DEFAULT: 1;
109
175
  readonly ANY: 2;
110
176
  };
111
- export type ClientQuotaMatchType = (typeof ClientQuotaMatchTypes)[keyof typeof ClientQuotaMatchTypes];
177
+ export declare const allowedClientQuotaMatchTypes: (0 | 1 | 2)[];
178
+ export type ClientQuotaMatchTypeLabel = keyof typeof ClientQuotaMatchTypes;
179
+ export type ClientQuotaMatchTypeValue = (typeof ClientQuotaMatchTypes)[ClientQuotaMatchTypeLabel];
180
+ /** @deprecated Use ClientQuotaMatchTypeValue */
181
+ export type ClientQuotaMatchType = ClientQuotaMatchTypeValue;
112
182
  export declare const ClientQuotaEntityTypes: {
113
183
  readonly CLIENT_ID: "client-id";
114
184
  readonly USER: "user";
115
185
  };
116
- export type ClientQuotaEntityType = (typeof ClientQuotaEntityTypes)[keyof typeof ClientQuotaEntityTypes];
186
+ export declare const allowedClientQuotaEntityTypes: ("client-id" | "user")[];
187
+ export type ClientQuotaEntityTypeLabel = keyof typeof ClientQuotaEntityTypes;
188
+ export type ClientQuotaEntityTypeValue = (typeof ClientQuotaEntityTypes)[ClientQuotaEntityTypeLabel];
189
+ /** @deprecated Use ClientQuotaEntityTypeValue */
190
+ export type ClientQuotaEntityType = ClientQuotaEntityTypeValue;
117
191
  export declare const ClientQuotaKeys: {
118
192
  readonly PRODUCER_BYTE_RATE: "producer_byte_rate";
119
193
  readonly CONSUMER_BYTE_RATE: "consumer_byte_rate";
120
194
  readonly REQUEST_PERCENTAGE: "request_percentage";
121
195
  };
122
- export type ClientQuotaKey = (typeof ClientQuotaKeys)[keyof typeof ClientQuotaKeys];
196
+ export declare const allowedClientQuotaKeys: ("producer_byte_rate" | "consumer_byte_rate" | "request_percentage")[];
197
+ export type ClientQuotaKeyLabel = keyof typeof ClientQuotaKeys;
198
+ export type ClientQuotaKeyValue = (typeof ClientQuotaKeys)[ClientQuotaKeyLabel];
199
+ /** @deprecated Use ClientQuotaKeyValue */
200
+ export type ClientQuotaKey = ClientQuotaKeyValue;
123
201
  export declare const ScramMechanisms: {
124
202
  readonly UNKNOWN: 0;
125
203
  readonly SCRAM_SHA_256: 1;
126
204
  readonly SCRAM_SHA_512: 2;
127
205
  };
128
- export type ScramMechanism = keyof typeof ScramMechanisms;
206
+ export declare const allowedScramMechanisms: (0 | 1 | 2)[];
207
+ export type ScramMechanismLabel = keyof typeof ScramMechanisms;
208
+ export type ScramMechanismValue = (typeof ScramMechanisms)[ScramMechanismLabel];
209
+ /** @deprecated Use ScramMechanismLabel */
210
+ export type ScramMechanism = ScramMechanismLabel;
129
211
  export declare const DescribeClusterEndpointTypes: {
130
- BROKERS: number;
131
- CONTROLLERS: number;
132
- };
133
- export type DescribeClusterEndpointType = keyof typeof DescribeClusterEndpointTypes;
212
+ readonly BROKERS: 1;
213
+ readonly CONTROLLERS: 2;
214
+ };
215
+ export declare const allowedDescribeClusterEndpointTypes: (1 | 2)[];
216
+ export type DescribeClusterEndpointTypeLabel = keyof typeof DescribeClusterEndpointTypes;
217
+ export type DescribeClusterEndpointTypeValue = (typeof DescribeClusterEndpointTypes)[DescribeClusterEndpointTypeLabel];
218
+ /** @deprecated Use DescribeClusterEndpointTypeLabel */
219
+ export type DescribeClusterEndpointType = DescribeClusterEndpointTypeLabel;
134
220
  export declare const ConsumerGroupStates: readonly ["PREPARING_REBALANCE", "COMPLETING_REBALANCE", "STABLE", "DEAD", "EMPTY"];
135
- export type ConsumerGroupState = (typeof ConsumerGroupStates)[number];
221
+ export type ConsumerGroupStateValue = (typeof ConsumerGroupStates)[number];
222
+ /** @deprecated Use ConsumerGroupStateValue */
223
+ export type ConsumerGroupState = ConsumerGroupStateValue;
136
224
  export declare const TransactionStates: readonly ["EMPTY", "ONGOING", "PREPARE_ABORT", "COMMITTING", "ABORTING", "COMPLETE_COMMIT", "COMPLETE_ABORT"];
137
225
  export type TransactionState = (typeof TransactionStates)[number];
138
226
  export declare const FeatureUpgradeTypes: {
@@ -140,4 +228,8 @@ export declare const FeatureUpgradeTypes: {
140
228
  readonly SAFE_DOWNGRADE: 2;
141
229
  readonly UNSAFE_DOWNGRADE: 3;
142
230
  };
143
- export type FeatureUpgradeType = keyof typeof FeatureUpgradeTypes;
231
+ export declare const allowedFeatureUpgradeTypes: (1 | 2 | 3)[];
232
+ export type FeatureUpgradeTypeLabel = keyof typeof FeatureUpgradeTypes;
233
+ export type FeatureUpgradeTypeValue = (typeof FeatureUpgradeTypes)[FeatureUpgradeTypeLabel];
234
+ /** @deprecated Use FeatureUpgradeTypeLabel */
235
+ export type FeatureUpgradeType = FeatureUpgradeTypeLabel;
@@ -10,6 +10,7 @@ export const allowedSASLMechanisms = Object.values(SASLMechanisms);
10
10
  // Metadata API
11
11
  // ./metadata/find-coordinator.ts
12
12
  export const FindCoordinatorKeyTypes = { GROUP: 0, TRANSACTION: 1, SHARE: 2 };
13
+ export const allowedFindCoordinatorKeyTypes = Object.values(FindCoordinatorKeyTypes);
13
14
  // Producer API
14
15
  export const ProduceAcks = {
15
16
  ALL: -1,
@@ -24,6 +25,7 @@ export const allowedGroupProtocols = Object.values(GroupProtocols);
24
25
  export const FetchIsolationLevels = { READ_UNCOMMITTED: 0, READ_COMMITTED: 1 };
25
26
  export const allowedFetchIsolationLevels = Object.values(FetchIsolationLevels);
26
27
  export const ListOffsetTimestamps = { LATEST: -1n, EARLIEST: -2n };
28
+ export const allowedListOffsetTimestamps = Object.values(ListOffsetTimestamps);
27
29
  // Admin API
28
30
  // ./admin/*-acls.ts - See: https://cwiki.apache.org/confluence/display/KAFKA/KIP-140%3A+Add+administrative+RPCs+for+adding%2C+deleting%2C+and+listing+ACLs
29
31
  export const ResourceTypes = {
@@ -33,9 +35,12 @@ export const ResourceTypes = {
33
35
  GROUP: 3,
34
36
  CLUSTER: 4,
35
37
  TRANSACTIONAL_ID: 5,
36
- DELEGATION_TOKEN: 6
38
+ DELEGATION_TOKEN: 6,
39
+ USER: 7
37
40
  };
41
+ export const allowedResourceTypes = Object.values(ResourceTypes);
38
42
  export const ResourcePatternTypes = { UNKNOWN: 0, ANY: 1, MATCH: 2, LITERAL: 3, PREFIXED: 4 };
43
+ export const allowedResourcePatternTypes = Object.values(ResourcePatternTypes);
39
44
  export const AclOperations = {
40
45
  UNKNOWN: 0,
41
46
  ANY: 1,
@@ -49,9 +54,14 @@ export const AclOperations = {
49
54
  CLUSTER_ACTION: 9,
50
55
  DESCRIBE_CONFIGS: 10,
51
56
  ALTER_CONFIGS: 11,
52
- IDEMPOTENT_WRITE: 12
57
+ IDEMPOTENT_WRITE: 12,
58
+ CREATE_TOKENS: 13,
59
+ DESCRIBE_TOKENS: 14,
60
+ TWO_PHASE_COMMIT: 15
53
61
  };
62
+ export const allowedAclOperations = Object.values(AclOperations);
54
63
  export const AclPermissionTypes = { UNKNOWN: 0, ANY: 1, DENY: 2, ALLOW: 3 };
64
+ export const allowedAclPermissionTypes = Object.values(AclPermissionTypes);
55
65
  // ./admin/*-configs.ts
56
66
  export const ConfigSources = {
57
67
  UNKNOWN: 0,
@@ -60,27 +70,52 @@ export const ConfigSources = {
60
70
  DYNAMIC_DEFAULT_BROKER_CONFIG: 3,
61
71
  STATIC_BROKER_CONFIG: 4,
62
72
  DEFAULT_CONFIG: 5,
63
- DYNAMIC_BROKER_LOGGER_CONFIG: 6
73
+ DYNAMIC_BROKER_LOGGER_CONFIG: 6,
74
+ CLIENT_METRICS_CONFIG: 7,
75
+ GROUP_CONFIG: 8
64
76
  };
65
- export const ConfigTypes = {
77
+ export const allowedConfigSources = Object.values(ConfigSources);
78
+ export const ConfigResourceTypes = {
66
79
  UNKNOWN: 0,
67
80
  TOPIC: 2,
68
81
  BROKER: 4,
69
- BROKER_LOGGER: 8
82
+ BROKER_LOGGER: 8,
83
+ CLIENT_METRICS: 16,
84
+ GROUP: 32
85
+ };
86
+ export const allowedConfigResourceTypes = Object.values(ConfigResourceTypes);
87
+ export const ConfigTypes = {
88
+ UNKNOWN: 0,
89
+ BOOLEAN: 1,
90
+ STRING: 2,
91
+ INT: 3,
92
+ SHORT: 4,
93
+ LONG: 5,
94
+ DOUBLE: 6,
95
+ LIST: 7,
96
+ CLASS: 8,
97
+ PASSWORD: 9
70
98
  };
71
- export const IncrementalAlterConfigTypes = { SET: 0, DELETE: 1, APPEND: 2, SUBTRACT: 3 };
99
+ export const allowedConfigTypes = Object.values(ConfigTypes);
100
+ export const IncrementalAlterConfigOperationTypes = { SET: 0, DELETE: 1, APPEND: 2, SUBTRACT: 3 };
101
+ export const allowedIncrementalAlterConfigOperationTypes = Object.values(IncrementalAlterConfigOperationTypes);
72
102
  // ./admin/*-client-quotas.ts
73
103
  export const ClientQuotaMatchTypes = { EXACT: 0, DEFAULT: 1, ANY: 2 };
104
+ export const allowedClientQuotaMatchTypes = Object.values(ClientQuotaMatchTypes);
74
105
  export const ClientQuotaEntityTypes = { CLIENT_ID: 'client-id', USER: 'user' };
106
+ export const allowedClientQuotaEntityTypes = Object.values(ClientQuotaEntityTypes);
75
107
  export const ClientQuotaKeys = {
76
108
  PRODUCER_BYTE_RATE: 'producer_byte_rate',
77
109
  CONSUMER_BYTE_RATE: 'consumer_byte_rate',
78
110
  REQUEST_PERCENTAGE: 'request_percentage'
79
111
  };
112
+ export const allowedClientQuotaKeys = Object.values(ClientQuotaKeys);
80
113
  // ./admin/*-scram-credentials.ts
81
114
  export const ScramMechanisms = { UNKNOWN: 0, SCRAM_SHA_256: 1, SCRAM_SHA_512: 2 };
115
+ export const allowedScramMechanisms = Object.values(ScramMechanisms);
82
116
  // ./admin/describe-cluster.ts
83
117
  export const DescribeClusterEndpointTypes = { BROKERS: 1, CONTROLLERS: 2 };
118
+ export const allowedDescribeClusterEndpointTypes = Object.values(DescribeClusterEndpointTypes);
84
119
  // ./admin/list-groups.ts
85
120
  export const ConsumerGroupStates = ['PREPARING_REBALANCE', 'COMPLETING_REBALANCE', 'STABLE', 'DEAD', 'EMPTY'];
86
121
  // ./admin/list-transactions.ts
@@ -95,3 +130,4 @@ export const TransactionStates = [
95
130
  ];
96
131
  // ./admin/update-features.ts
97
132
  export const FeatureUpgradeTypes = { UPGRADE: 1, SAFE_DOWNGRADE: 2, UNSAFE_DOWNGRADE: 3 };
133
+ export const allowedFeatureUpgradeTypes = Object.values(FeatureUpgradeTypes);
@@ -1,6 +1,7 @@
1
1
  export * from './callbacks.ts';
2
2
  export * from './definitions.ts';
3
3
  export * from './enumerations.ts';
4
+ export * from './types.ts';
4
5
  export * from './admin/index.ts';
5
6
  export * from './consumer/index.ts';
6
7
  export * from './metadata/index.ts';
@@ -2,6 +2,7 @@
2
2
  export * from "./callbacks.js";
3
3
  export * from "./definitions.js";
4
4
  export * from "./enumerations.js";
5
+ export * from "./types.js";
5
6
  // Low-level APIs
6
7
  export * from "./admin/index.js";
7
8
  export * from "./consumer/index.js";
@@ -0,0 +1,10 @@
1
+ import { type Reader } from '../../protocol/reader.ts';
2
+ import { Writer } from '../../protocol/writer.ts';
3
+ export type AddOffsetsToTxnRequest = Parameters<typeof createRequest>;
4
+ export interface AddOffsetsToTxnResponse {
5
+ throttleTimeMs: number;
6
+ errorCode: number;
7
+ }
8
+ export declare function createRequest(transactionalId: string, producerId: bigint, producerEpoch: number, groupId: string): Writer;
9
+ export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): AddOffsetsToTxnResponse;
10
+ export declare const api: import("../definitions.ts").API<[transactionalId: string, producerId: bigint, producerEpoch: number, groupId: string], AddOffsetsToTxnResponse>;
@@ -0,0 +1,34 @@
1
+ import { ResponseError } from "../../errors.js";
2
+ import { Writer } from "../../protocol/writer.js";
3
+ import { createAPI } from "../definitions.js";
4
+ /*
5
+ AddOffsetsToTxn Request (Version: 3) => transactional_id producer_id producer_epoch group_id TAG_BUFFER
6
+ transactional_id => COMPACT_STRING
7
+ producer_id => INT64
8
+ producer_epoch => INT16
9
+ group_id => COMPACT_STRING
10
+ */
11
+ export function createRequest(transactionalId, producerId, producerEpoch, groupId) {
12
+ return Writer.create()
13
+ .appendString(transactionalId, true)
14
+ .appendInt64(producerId)
15
+ .appendInt16(producerEpoch)
16
+ .appendString(groupId, true)
17
+ .appendTaggedFields();
18
+ }
19
+ /*
20
+ AddOffsetsToTxn Response (Version: 3) => throttle_time_ms error_code TAG_BUFFER
21
+ throttle_time_ms => INT32
22
+ error_code => INT16
23
+ */
24
+ export function parseResponse(_correlationId, apiKey, apiVersion, reader) {
25
+ const response = {
26
+ throttleTimeMs: reader.readInt32(),
27
+ errorCode: reader.readInt16()
28
+ };
29
+ if (response.errorCode !== 0) {
30
+ throw new ResponseError(apiKey, apiVersion, { '/': [response.errorCode, null] }, response);
31
+ }
32
+ return response;
33
+ }
34
+ export const api = createAPI(25, 3, createRequest, parseResponse);
@@ -0,0 +1,34 @@
1
+ import { type Reader } from '../../protocol/reader.ts';
2
+ import { Writer } from '../../protocol/writer.ts';
3
+ export interface AddPartitionsToTxnRequestTopic {
4
+ name: string;
5
+ partitions: number[];
6
+ }
7
+ export interface AddPartitionsToTxnRequestTransaction {
8
+ transactionalId: string;
9
+ producerId: bigint;
10
+ producerEpoch: number;
11
+ verifyOnly: boolean;
12
+ topics: AddPartitionsToTxnRequestTopic[];
13
+ }
14
+ export type AddPartitionsToTxnRequest = Parameters<typeof createRequest>;
15
+ export interface AddPartitionsToTxnResponsePartition {
16
+ partitionIndex: number;
17
+ partitionErrorCode: number;
18
+ }
19
+ export interface AddPartitionsToTxnResponseTopic {
20
+ name: string;
21
+ resultsByPartition: AddPartitionsToTxnResponsePartition[];
22
+ }
23
+ export interface AddPartitionsToTxnResponseTransaction {
24
+ transactionalId: string;
25
+ topicResults: AddPartitionsToTxnResponseTopic[];
26
+ }
27
+ export interface AddPartitionsToTxnResponse {
28
+ throttleTimeMs: number;
29
+ errorCode: number;
30
+ resultsByTransaction: AddPartitionsToTxnResponseTransaction[];
31
+ }
32
+ export declare function createRequest(transactions: AddPartitionsToTxnRequestTransaction[]): Writer;
33
+ export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): AddPartitionsToTxnResponse;
34
+ export declare const api: import("../definitions.ts").API<[transactions: AddPartitionsToTxnRequestTransaction[]], AddPartitionsToTxnResponse>;
@@ -0,0 +1,67 @@
1
+ import { ResponseError } from "../../errors.js";
2
+ import { Writer } from "../../protocol/writer.js";
3
+ import { createAPI } from "../definitions.js";
4
+ /*
5
+ AddPartitionsToTxn Request (Version: 3) => transactional_id producer_id producer_epoch [topics] TAG_BUFFER
6
+ transactional_id => COMPACT_STRING
7
+ producer_id => INT64
8
+ producer_epoch => INT16
9
+ topics => name [partitions] TAG_BUFFER
10
+ name => COMPACT_STRING
11
+ partitions => INT32
12
+ */
13
+ export function createRequest(transactions) {
14
+ return Writer.create()
15
+ .appendString(transactions[0].transactionalId)
16
+ .appendInt64(transactions[0].producerId)
17
+ .appendInt16(transactions[0].producerEpoch)
18
+ .appendArray(transactions[0].topics, (w, topic) => {
19
+ w.appendString(topic.name).appendArray(topic.partitions, (w, partition) => w.appendInt32(partition), true, false);
20
+ })
21
+ .appendTaggedFields();
22
+ }
23
+ /*
24
+ AddPartitionsToTxn Response (Version: 3) => throttle_time_ms [results_by_transaction] TAG_BUFFER
25
+ throttle_time_ms => INT32
26
+ results_by_topic => name [results_by_partition] TAG_BUFFER
27
+ name => COMPACT_STRING
28
+ results_by_partition => partition_index partition_error_code TAG_BUFFER
29
+ partition_index => INT32
30
+ partition_error_code => INT16
31
+ */
32
+ export function parseResponse(_correlationId, apiKey, apiVersion, reader) {
33
+ const errors = [];
34
+ const throttleTimeMs = reader.readInt32();
35
+ const response = {
36
+ throttleTimeMs,
37
+ errorCode: 0,
38
+ resultsByTransaction: [
39
+ {
40
+ transactionalId: '',
41
+ topicResults: reader.readArray((r, j) => {
42
+ return {
43
+ name: r.readString(),
44
+ resultsByPartition: r.readArray((r, k) => {
45
+ const partition = {
46
+ partitionIndex: r.readInt32(),
47
+ partitionErrorCode: r.readInt16()
48
+ };
49
+ if (partition.partitionErrorCode !== 0) {
50
+ errors.push([
51
+ `/results_by_transaction/0/topic_results/${j}/results_by_partitions/${k}`,
52
+ [partition.partitionErrorCode, null]
53
+ ]);
54
+ }
55
+ return partition;
56
+ })
57
+ };
58
+ })
59
+ }
60
+ ]
61
+ };
62
+ if (errors.length) {
63
+ throw new ResponseError(apiKey, apiVersion, Object.fromEntries(errors), response);
64
+ }
65
+ return response;
66
+ }
67
+ export const api = createAPI(24, 3, createRequest, parseResponse);
@@ -0,0 +1,34 @@
1
+ import { type Reader } from '../../protocol/reader.ts';
2
+ import { Writer } from '../../protocol/writer.ts';
3
+ export interface AddPartitionsToTxnRequestTopic {
4
+ name: string;
5
+ partitions: number[];
6
+ }
7
+ export interface AddPartitionsToTxnRequestTransaction {
8
+ transactionalId: string;
9
+ producerId: bigint;
10
+ producerEpoch: number;
11
+ verifyOnly: boolean;
12
+ topics: AddPartitionsToTxnRequestTopic[];
13
+ }
14
+ export type AddPartitionsToTxnRequest = Parameters<typeof createRequest>;
15
+ export interface AddPartitionsToTxnResponsePartition {
16
+ partitionIndex: number;
17
+ partitionErrorCode: number;
18
+ }
19
+ export interface AddPartitionsToTxnResponseTopic {
20
+ name: string;
21
+ resultsByPartition: AddPartitionsToTxnResponsePartition[];
22
+ }
23
+ export interface AddPartitionsToTxnResponseTransaction {
24
+ transactionalId: string;
25
+ topicResults: AddPartitionsToTxnResponseTopic[];
26
+ }
27
+ export interface AddPartitionsToTxnResponse {
28
+ throttleTimeMs: number;
29
+ errorCode: number;
30
+ resultsByTransaction: AddPartitionsToTxnResponseTransaction[];
31
+ }
32
+ export declare function createRequest(transactions: AddPartitionsToTxnRequestTransaction[]): Writer;
33
+ export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): AddPartitionsToTxnResponse;
34
+ export declare const api: import("../definitions.ts").API<[transactions: AddPartitionsToTxnRequestTransaction[]], AddPartitionsToTxnResponse>;
@@ -0,0 +1,79 @@
1
+ import { ResponseError } from "../../errors.js";
2
+ import { Writer } from "../../protocol/writer.js";
3
+ import { createAPI } from "../definitions.js";
4
+ /*
5
+ AddPartitionsToTxn Request (Version: 4) => [transactions] TAG_BUFFER
6
+ transactions => transactional_id producer_id producer_epoch verify_only [topics] TAG_BUFFER
7
+ transactional_id => COMPACT_STRING
8
+ producer_id => INT64
9
+ producer_epoch => INT16
10
+ verify_only => BOOLEAN
11
+ topics => name [partitions] TAG_BUFFER
12
+ name => COMPACT_STRING
13
+ partitions => INT32
14
+ */
15
+ export function createRequest(transactions) {
16
+ return Writer.create()
17
+ .appendArray(transactions, (w, transaction) => {
18
+ w.appendString(transaction.transactionalId)
19
+ .appendInt64(transaction.producerId)
20
+ .appendInt16(transaction.producerEpoch)
21
+ .appendBoolean(transaction.verifyOnly)
22
+ .appendArray(transaction.topics, (w, topic) => {
23
+ w.appendString(topic.name).appendArray(topic.partitions, (w, partition) => w.appendInt32(partition), true, false);
24
+ });
25
+ })
26
+ .appendTaggedFields();
27
+ }
28
+ /*
29
+ AddPartitionsToTxn Response (Version: 4) => throttle_time_ms error_code [results_by_transaction] TAG_BUFFER
30
+ throttle_time_ms => INT32
31
+ error_code => INT16
32
+ results_by_transaction => transactional_id [topic_results] TAG_BUFFER
33
+ transactional_id => COMPACT_STRING
34
+ topic_results => name [results_by_partition] TAG_BUFFER
35
+ name => COMPACT_STRING
36
+ results_by_partition => partition_index partition_error_code TAG_BUFFER
37
+ partition_index => INT32
38
+ partition_error_code => INT16
39
+ */
40
+ export function parseResponse(_correlationId, apiKey, apiVersion, reader) {
41
+ const errors = [];
42
+ const throttleTimeMs = reader.readInt32();
43
+ const errorCode = reader.readInt16();
44
+ if (errorCode !== 0) {
45
+ errors.push(['', [errorCode, null]]);
46
+ }
47
+ const response = {
48
+ throttleTimeMs,
49
+ errorCode,
50
+ resultsByTransaction: reader.readArray((r, i) => {
51
+ return {
52
+ transactionalId: r.readString(),
53
+ topicResults: r.readArray((r, j) => {
54
+ return {
55
+ name: r.readString(),
56
+ resultsByPartition: r.readArray((r, k) => {
57
+ const partition = {
58
+ partitionIndex: r.readInt32(),
59
+ partitionErrorCode: r.readInt16()
60
+ };
61
+ if (partition.partitionErrorCode !== 0) {
62
+ errors.push([
63
+ `/results_by_transaction/${i}/topic_results/${j}/results_by_partitions/${k}`,
64
+ [partition.partitionErrorCode, null]
65
+ ]);
66
+ }
67
+ return partition;
68
+ })
69
+ };
70
+ })
71
+ };
72
+ })
73
+ };
74
+ if (errors.length) {
75
+ throw new ResponseError(apiKey, apiVersion, Object.fromEntries(errors), response);
76
+ }
77
+ return response;
78
+ }
79
+ export const api = createAPI(24, 4, createRequest, parseResponse);
@@ -0,0 +1,10 @@
1
+ import { type Reader } from '../../protocol/reader.ts';
2
+ import { Writer } from '../../protocol/writer.ts';
3
+ export type EndTxnRequest = Parameters<typeof createRequest>;
4
+ export interface EndTxnResponse {
5
+ throttleTimeMs: number;
6
+ errorCode: number;
7
+ }
8
+ export declare function createRequest(transactionalId: string, producerId: bigint, producerEpoch: number, committed: boolean): Writer;
9
+ export declare function parseResponse(_correlationId: number, apiKey: number, apiVersion: number, reader: Reader): EndTxnResponse;
10
+ export declare const api: import("../definitions.ts").API<[transactionalId: string, producerId: bigint, producerEpoch: number, committed: boolean], EndTxnResponse>;