@platformatic/kafka 2.1.0 → 2.2.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.
- package/README.md +4 -1
- package/dist/apis/admin/alter-client-quotas-v0.d.ts +40 -0
- package/dist/apis/admin/alter-client-quotas-v0.js +60 -0
- package/dist/apis/admin/alter-client-quotas-v1.d.ts +6 -5
- package/dist/apis/admin/alter-client-quotas-v1.js +3 -1
- package/dist/apis/admin/alter-configs-v0.d.ts +7 -0
- package/dist/apis/admin/alter-configs-v0.js +10 -0
- package/dist/apis/admin/alter-configs-v1.d.ts +2 -0
- package/dist/apis/admin/alter-configs-v1.js +5 -0
- package/dist/apis/admin/alter-configs-v2.js +3 -1
- package/dist/apis/admin/alter-partition-reassignments-v0.d.ts +3 -2
- package/dist/apis/admin/alter-partition-reassignments-v0.js +4 -1
- package/dist/apis/admin/alter-partition-reassignments-v1.d.ts +6 -4
- package/dist/apis/admin/alter-partition-reassignments-v1.js +7 -3
- package/dist/apis/admin/alter-partition-v0.d.ts +40 -0
- package/dist/apis/admin/alter-partition-v0.js +81 -0
- package/dist/apis/admin/alter-partition-v1.d.ts +37 -0
- package/dist/apis/admin/alter-partition-v1.js +84 -0
- package/dist/apis/admin/alter-partition-v2.d.ts +36 -0
- package/dist/apis/admin/alter-partition-v2.js +83 -0
- package/dist/apis/admin/alter-partition-v3.d.ts +6 -35
- package/dist/apis/admin/alter-partition-v3.js +10 -8
- package/dist/apis/admin/alter-replica-log-dirs-v0.d.ts +23 -0
- package/dist/apis/admin/alter-replica-log-dirs-v0.js +29 -0
- package/dist/apis/admin/alter-replica-log-dirs-v1.d.ts +4 -0
- package/dist/apis/admin/alter-replica-log-dirs-v1.js +8 -0
- package/dist/apis/admin/alter-replica-log-dirs-v2.d.ts +1 -1
- package/dist/apis/admin/alter-replica-log-dirs-v2.js +1 -0
- package/dist/apis/admin/alter-user-scram-credentials-v0.js +1 -1
- package/dist/apis/admin/client-quotas.d.ts +2 -0
- package/dist/apis/admin/client-quotas.js +1 -0
- package/dist/apis/admin/consumer-group-describe-v0.d.ts +2 -1
- package/dist/apis/admin/consumer-group-describe-v0.js +51 -30
- package/dist/apis/admin/create-acls-v0.d.ts +16 -0
- package/dist/apis/admin/create-acls-v0.js +10 -0
- package/dist/apis/admin/create-acls-v1.d.ts +15 -0
- package/dist/apis/admin/create-acls-v1.js +10 -0
- package/dist/apis/admin/create-acls-v2.js +1 -0
- package/dist/apis/admin/create-acls-v3.js +1 -0
- package/dist/apis/admin/create-delegation-token-v0.d.ts +24 -0
- package/dist/apis/admin/create-delegation-token-v0.js +47 -0
- package/dist/apis/admin/create-delegation-token-v1.d.ts +4 -0
- package/dist/apis/admin/create-delegation-token-v1.js +8 -0
- package/dist/apis/admin/create-delegation-token-v2.d.ts +9 -0
- package/dist/apis/admin/create-delegation-token-v2.js +30 -0
- package/dist/apis/admin/create-delegation-token-v3.js +1 -0
- package/dist/apis/admin/create-partitions-v0.d.ts +2 -0
- package/dist/apis/admin/create-partitions-v0.js +5 -0
- package/dist/apis/admin/create-partitions-v1.d.ts +2 -2
- package/dist/apis/admin/create-partitions-v1.js +5 -5
- package/dist/apis/admin/create-partitions-v2.d.ts +2 -2
- package/dist/apis/admin/create-partitions-v2.js +1 -0
- package/dist/apis/admin/create-partitions-v3.js +1 -0
- package/dist/apis/admin/create-topics-v0.d.ts +42 -0
- package/dist/apis/admin/create-topics-v0.js +63 -0
- package/dist/apis/admin/create-topics-v1.d.ts +42 -0
- package/dist/apis/admin/create-topics-v1.js +65 -0
- package/dist/apis/admin/create-topics-v2.d.ts +42 -0
- package/dist/apis/admin/create-topics-v2.js +66 -0
- package/dist/apis/admin/create-topics-v3.d.ts +42 -0
- package/dist/apis/admin/create-topics-v3.js +66 -0
- package/dist/apis/admin/create-topics-v4.d.ts +42 -0
- package/dist/apis/admin/create-topics-v4.js +66 -0
- package/dist/apis/admin/create-topics-v5.d.ts +42 -0
- package/dist/apis/admin/create-topics-v5.js +88 -0
- package/dist/apis/admin/create-topics-v6.d.ts +42 -0
- package/dist/apis/admin/create-topics-v6.js +88 -0
- package/dist/apis/admin/create-topics-v7.d.ts +2 -1
- package/dist/apis/admin/create-topics-v7.js +20 -5
- package/dist/apis/admin/delete-acls-v0.d.ts +28 -0
- package/dist/apis/admin/delete-acls-v0.js +12 -0
- package/dist/apis/admin/delete-acls-v1.d.ts +27 -0
- package/dist/apis/admin/delete-acls-v1.js +11 -0
- package/dist/apis/admin/delete-acls-v2.js +5 -2
- package/dist/apis/admin/delete-acls-v3.js +1 -0
- package/dist/apis/admin/delete-groups-v0.d.ts +14 -0
- package/dist/apis/admin/delete-groups-v0.js +38 -0
- package/dist/apis/admin/delete-groups-v1.d.ts +14 -0
- package/dist/apis/admin/delete-groups-v1.js +38 -0
- package/dist/apis/admin/delete-groups-v2.js +1 -0
- package/dist/apis/admin/delete-records-v0.d.ts +27 -0
- package/dist/apis/admin/delete-records-v0.js +50 -0
- package/dist/apis/admin/delete-records-v1.d.ts +27 -0
- package/dist/apis/admin/delete-records-v1.js +50 -0
- package/dist/apis/admin/delete-records-v2.js +1 -0
- package/dist/apis/admin/delete-topics-v0.d.ts +19 -0
- package/dist/apis/admin/delete-topics-v0.js +39 -0
- package/dist/apis/admin/delete-topics-v1.d.ts +19 -0
- package/dist/apis/admin/delete-topics-v1.js +37 -0
- package/dist/apis/admin/delete-topics-v2.d.ts +19 -0
- package/dist/apis/admin/delete-topics-v2.js +37 -0
- package/dist/apis/admin/delete-topics-v3.d.ts +19 -0
- package/dist/apis/admin/delete-topics-v3.js +37 -0
- package/dist/apis/admin/delete-topics-v4.d.ts +19 -0
- package/dist/apis/admin/delete-topics-v4.js +41 -0
- package/dist/apis/admin/delete-topics-v5.d.ts +19 -0
- package/dist/apis/admin/delete-topics-v5.js +45 -0
- package/dist/apis/admin/delete-topics-v6.d.ts +1 -1
- package/dist/apis/admin/delete-topics-v6.js +5 -1
- package/dist/apis/admin/describe-acls-v0.d.ts +21 -0
- package/dist/apis/admin/describe-acls-v0.js +19 -0
- package/dist/apis/admin/describe-acls-v1.d.ts +21 -0
- package/dist/apis/admin/describe-acls-v1.js +18 -0
- package/dist/apis/admin/describe-acls-v2.js +1 -0
- package/dist/apis/admin/describe-acls-v3.js +1 -0
- package/dist/apis/admin/describe-client-quotas-v0.d.ts +8 -7
- package/dist/apis/admin/describe-client-quotas-v0.js +28 -25
- package/dist/apis/admin/describe-client-quotas-v1.d.ts +9 -0
- package/dist/apis/admin/describe-client-quotas-v1.js +34 -0
- package/dist/apis/admin/describe-cluster-v0.d.ts +4 -3
- package/dist/apis/admin/describe-cluster-v0.js +3 -1
- package/dist/apis/admin/describe-cluster-v1.d.ts +4 -3
- package/dist/apis/admin/describe-cluster-v1.js +1 -0
- package/dist/apis/admin/describe-configs-v0.d.ts +41 -0
- package/dist/apis/admin/describe-configs-v0.js +72 -0
- package/dist/apis/admin/describe-configs-v1.d.ts +39 -0
- package/dist/apis/admin/describe-configs-v1.js +81 -0
- package/dist/apis/admin/describe-configs-v2.d.ts +9 -8
- package/dist/apis/admin/describe-configs-v2.js +10 -14
- package/dist/apis/admin/describe-configs-v3.d.ts +9 -8
- package/dist/apis/admin/describe-configs-v3.js +7 -7
- package/dist/apis/admin/describe-configs-v4.d.ts +2 -2
- package/dist/apis/admin/describe-configs-v4.js +14 -7
- package/dist/apis/admin/describe-delegation-token-v0.d.ts +31 -0
- package/dist/apis/admin/describe-delegation-token-v0.js +51 -0
- package/dist/apis/admin/describe-delegation-token-v1.d.ts +4 -0
- package/dist/apis/admin/describe-delegation-token-v1.js +8 -0
- package/dist/apis/admin/describe-delegation-token-v2.d.ts +8 -0
- package/dist/apis/admin/describe-delegation-token-v2.js +32 -0
- package/dist/apis/admin/describe-delegation-token-v3.d.ts +4 -27
- package/dist/apis/admin/describe-delegation-token-v3.js +1 -0
- package/dist/apis/admin/describe-groups-v0.d.ts +28 -0
- package/dist/apis/admin/describe-groups-v0.js +60 -0
- package/dist/apis/admin/describe-groups-v1.d.ts +28 -0
- package/dist/apis/admin/describe-groups-v1.js +62 -0
- package/dist/apis/admin/describe-groups-v2.d.ts +28 -0
- package/dist/apis/admin/describe-groups-v2.js +62 -0
- package/dist/apis/admin/describe-groups-v3.d.ts +28 -0
- package/dist/apis/admin/describe-groups-v3.js +64 -0
- package/dist/apis/admin/describe-groups-v4.d.ts +28 -0
- package/dist/apis/admin/describe-groups-v4.js +64 -0
- package/dist/apis/admin/describe-groups-v5.js +1 -0
- package/dist/apis/admin/describe-log-dirs-v0.d.ts +30 -0
- package/dist/apis/admin/describe-log-dirs-v0.js +39 -0
- package/dist/apis/admin/describe-log-dirs-v1.d.ts +4 -0
- package/dist/apis/admin/describe-log-dirs-v1.js +8 -0
- package/dist/apis/admin/describe-log-dirs-v2.d.ts +3 -2
- package/dist/apis/admin/describe-log-dirs-v2.js +9 -5
- package/dist/apis/admin/describe-log-dirs-v3.d.ts +3 -2
- package/dist/apis/admin/describe-log-dirs-v3.js +3 -2
- package/dist/apis/admin/describe-log-dirs-v4.d.ts +3 -2
- package/dist/apis/admin/describe-log-dirs-v4.js +1 -0
- package/dist/apis/admin/describe-producers-v0.js +1 -0
- package/dist/apis/admin/describe-quorum-v0.d.ts +13 -0
- package/dist/apis/admin/describe-quorum-v0.js +85 -0
- package/dist/apis/admin/describe-quorum-v1.d.ts +13 -0
- package/dist/apis/admin/describe-quorum-v1.js +84 -0
- package/dist/apis/admin/describe-quorum-v2.js +1 -0
- package/dist/apis/admin/describe-topic-partitions-v0.d.ts +3 -3
- package/dist/apis/admin/describe-topic-partitions-v0.js +5 -2
- package/dist/apis/admin/describe-transactions-v0.js +1 -0
- package/dist/apis/admin/describe-user-scram-credentials-v0.d.ts +4 -3
- package/dist/apis/admin/describe-user-scram-credentials-v0.js +1 -0
- package/dist/apis/admin/envelope-v0.js +1 -0
- package/dist/apis/admin/expire-delegation-token-v0.d.ts +11 -0
- package/dist/apis/admin/expire-delegation-token-v0.js +29 -0
- package/dist/apis/admin/expire-delegation-token-v1.d.ts +4 -0
- package/dist/apis/admin/expire-delegation-token-v1.js +8 -0
- package/dist/apis/admin/expire-delegation-token-v2.js +1 -0
- package/dist/apis/admin/incremental-alter-configs-v0.d.ts +26 -0
- package/dist/apis/admin/incremental-alter-configs-v0.js +10 -0
- package/dist/apis/admin/incremental-alter-configs-v1.js +1 -0
- package/dist/apis/admin/index.d.ts +60 -0
- package/dist/apis/admin/index.js +60 -0
- package/dist/apis/admin/list-groups-v0.d.ts +18 -0
- package/dist/apis/admin/list-groups-v0.js +30 -0
- package/dist/apis/admin/list-groups-v1.d.ts +18 -0
- package/dist/apis/admin/list-groups-v1.js +37 -0
- package/dist/apis/admin/list-groups-v2.d.ts +18 -0
- package/dist/apis/admin/list-groups-v2.js +37 -0
- package/dist/apis/admin/list-groups-v3.d.ts +18 -0
- package/dist/apis/admin/list-groups-v3.js +38 -0
- package/dist/apis/admin/list-groups-v4.d.ts +4 -3
- package/dist/apis/admin/list-groups-v4.js +15 -4
- package/dist/apis/admin/list-groups-v5.d.ts +3 -3
- package/dist/apis/admin/list-groups-v5.js +25 -3
- package/dist/apis/admin/list-partition-reassignments-v0.d.ts +3 -3
- package/dist/apis/admin/list-partition-reassignments-v0.js +1 -0
- package/dist/apis/admin/list-transactions-v0.d.ts +5 -3
- package/dist/apis/admin/list-transactions-v0.js +23 -1
- package/dist/apis/admin/list-transactions-v1.d.ts +5 -3
- package/dist/apis/admin/list-transactions-v1.js +15 -1
- package/dist/apis/admin/list-transactions-v2.d.ts +5 -4
- package/dist/apis/admin/list-transactions-v2.js +17 -5
- package/dist/apis/admin/renew-delegation-token-v0.d.ts +11 -0
- package/dist/apis/admin/renew-delegation-token-v0.js +29 -0
- package/dist/apis/admin/renew-delegation-token-v1.d.ts +4 -0
- package/dist/apis/admin/renew-delegation-token-v1.js +8 -0
- package/dist/apis/admin/renew-delegation-token-v2.js +1 -0
- package/dist/apis/admin/unregister-broker-v0.js +1 -0
- package/dist/apis/admin/update-features-v0.d.ts +24 -0
- package/dist/apis/admin/update-features-v0.js +59 -0
- package/dist/apis/admin/update-features-v1.d.ts +2 -1
- package/dist/apis/admin/update-features-v1.js +1 -0
- package/dist/apis/callbacks.d.ts +1 -3
- package/dist/apis/callbacks.js +26 -11
- package/dist/apis/consumer/consumer-group-heartbeat-v0.d.ts +2 -2
- package/dist/apis/consumer/consumer-group-heartbeat-v0.js +17 -10
- package/dist/apis/consumer/consumer-group-heartbeat-v1.d.ts +2 -2
- package/dist/apis/consumer/consumer-group-heartbeat-v1.js +17 -10
- package/dist/apis/consumer/fetch-v10.d.ts +51 -0
- package/dist/apis/consumer/fetch-v10.js +122 -0
- package/dist/apis/consumer/fetch-v11.d.ts +51 -0
- package/dist/apis/consumer/fetch-v11.js +125 -0
- package/dist/apis/consumer/fetch-v12.d.ts +20 -4
- package/dist/apis/consumer/fetch-v12.js +29 -12
- package/dist/apis/consumer/fetch-v13.d.ts +20 -4
- package/dist/apis/consumer/fetch-v13.js +25 -7
- package/dist/apis/consumer/fetch-v14.d.ts +20 -4
- package/dist/apis/consumer/fetch-v14.js +25 -7
- package/dist/apis/consumer/fetch-v15.d.ts +20 -4
- package/dist/apis/consumer/fetch-v15.js +25 -7
- package/dist/apis/consumer/fetch-v16.d.ts +27 -4
- package/dist/apis/consumer/fetch-v16.js +36 -8
- package/dist/apis/consumer/fetch-v17.d.ts +28 -4
- package/dist/apis/consumer/fetch-v17.js +43 -9
- package/dist/apis/consumer/fetch-v4.d.ts +51 -0
- package/dist/apis/consumer/fetch-v4.js +87 -0
- package/dist/apis/consumer/fetch-v5.d.ts +51 -0
- package/dist/apis/consumer/fetch-v5.js +89 -0
- package/dist/apis/consumer/fetch-v6.d.ts +51 -0
- package/dist/apis/consumer/fetch-v6.js +99 -0
- package/dist/apis/consumer/fetch-v7.d.ts +51 -0
- package/dist/apis/consumer/fetch-v7.js +117 -0
- package/dist/apis/consumer/fetch-v8.d.ts +51 -0
- package/dist/apis/consumer/fetch-v8.js +117 -0
- package/dist/apis/consumer/fetch-v9.d.ts +51 -0
- package/dist/apis/consumer/fetch-v9.js +122 -0
- package/dist/apis/consumer/heartbeat-v0.d.ts +11 -0
- package/dist/apis/consumer/heartbeat-v0.js +24 -0
- package/dist/apis/consumer/heartbeat-v1.d.ts +11 -0
- package/dist/apis/consumer/heartbeat-v1.js +31 -0
- package/dist/apis/consumer/heartbeat-v2.d.ts +11 -0
- package/dist/apis/consumer/heartbeat-v2.js +31 -0
- package/dist/apis/consumer/heartbeat-v3.d.ts +11 -0
- package/dist/apis/consumer/heartbeat-v3.js +33 -0
- package/dist/apis/consumer/heartbeat-v4.js +1 -0
- package/dist/apis/consumer/index.d.ts +51 -0
- package/dist/apis/consumer/index.js +51 -0
- package/dist/apis/consumer/join-group-v0.d.ts +27 -0
- package/dist/apis/consumer/join-group-v0.js +51 -0
- package/dist/apis/consumer/join-group-v1.d.ts +8 -0
- package/dist/apis/consumer/join-group-v1.js +43 -0
- package/dist/apis/consumer/join-group-v2.d.ts +27 -0
- package/dist/apis/consumer/join-group-v2.js +60 -0
- package/dist/apis/consumer/join-group-v3.d.ts +27 -0
- package/dist/apis/consumer/join-group-v3.js +60 -0
- package/dist/apis/consumer/join-group-v4.d.ts +27 -0
- package/dist/apis/consumer/join-group-v4.js +60 -0
- package/dist/apis/consumer/join-group-v5.d.ts +27 -0
- package/dist/apis/consumer/join-group-v5.js +63 -0
- package/dist/apis/consumer/join-group-v6.d.ts +2 -2
- package/dist/apis/consumer/join-group-v6.js +10 -7
- package/dist/apis/consumer/join-group-v7.d.ts +2 -2
- package/dist/apis/consumer/join-group-v7.js +5 -3
- package/dist/apis/consumer/join-group-v8.d.ts +2 -2
- package/dist/apis/consumer/join-group-v8.js +5 -3
- package/dist/apis/consumer/join-group-v9.d.ts +2 -2
- package/dist/apis/consumer/join-group-v9.js +5 -3
- package/dist/apis/consumer/leave-group-v0.d.ts +22 -0
- package/dist/apis/consumer/leave-group-v0.js +23 -0
- package/dist/apis/consumer/leave-group-v1.d.ts +22 -0
- package/dist/apis/consumer/leave-group-v1.js +30 -0
- package/dist/apis/consumer/leave-group-v2.d.ts +22 -0
- package/dist/apis/consumer/leave-group-v2.js +30 -0
- package/dist/apis/consumer/leave-group-v3.d.ts +22 -0
- package/dist/apis/consumer/leave-group-v3.js +54 -0
- package/dist/apis/consumer/leave-group-v4.d.ts +1 -1
- package/dist/apis/consumer/leave-group-v4.js +4 -2
- package/dist/apis/consumer/leave-group-v5.d.ts +1 -1
- package/dist/apis/consumer/leave-group-v5.js +4 -2
- package/dist/apis/consumer/list-offsets-v0.d.ts +30 -0
- package/dist/apis/consumer/list-offsets-v0.js +50 -0
- package/dist/apis/consumer/list-offsets-v1.d.ts +12 -0
- package/dist/apis/consumer/list-offsets-v1.js +52 -0
- package/dist/apis/consumer/list-offsets-v2.d.ts +30 -0
- package/dist/apis/consumer/list-offsets-v2.js +64 -0
- package/dist/apis/consumer/list-offsets-v3.d.ts +30 -0
- package/dist/apis/consumer/list-offsets-v3.js +64 -0
- package/dist/apis/consumer/list-offsets-v4.d.ts +30 -0
- package/dist/apis/consumer/list-offsets-v4.js +67 -0
- package/dist/apis/consumer/list-offsets-v6.js +6 -3
- package/dist/apis/consumer/list-offsets-v7.js +6 -3
- package/dist/apis/consumer/list-offsets-v8.js +6 -3
- package/dist/apis/consumer/list-offsets-v9.js +6 -3
- package/dist/apis/consumer/offset-commit-v0.d.ts +29 -0
- package/dist/apis/consumer/offset-commit-v0.js +52 -0
- package/dist/apis/consumer/offset-commit-v1.d.ts +7 -0
- package/dist/apis/consumer/offset-commit-v1.js +30 -0
- package/dist/apis/consumer/offset-commit-v2.d.ts +8 -0
- package/dist/apis/consumer/offset-commit-v2.js +31 -0
- package/dist/apis/consumer/offset-commit-v3.d.ts +29 -0
- package/dist/apis/consumer/offset-commit-v3.js +58 -0
- package/dist/apis/consumer/offset-commit-v4.d.ts +29 -0
- package/dist/apis/consumer/offset-commit-v4.js +58 -0
- package/dist/apis/consumer/offset-commit-v5.d.ts +29 -0
- package/dist/apis/consumer/offset-commit-v5.js +56 -0
- package/dist/apis/consumer/offset-commit-v6.d.ts +29 -0
- package/dist/apis/consumer/offset-commit-v6.js +60 -0
- package/dist/apis/consumer/offset-commit-v7.d.ts +29 -0
- package/dist/apis/consumer/offset-commit-v7.js +62 -0
- package/dist/apis/consumer/offset-commit-v8.d.ts +2 -2
- package/dist/apis/consumer/offset-commit-v8.js +6 -3
- package/dist/apis/consumer/offset-commit-v9.d.ts +2 -2
- package/dist/apis/consumer/offset-commit-v9.js +6 -3
- package/dist/apis/consumer/offset-fetch-v0.d.ts +40 -0
- package/dist/apis/consumer/offset-fetch-v0.js +62 -0
- package/dist/apis/consumer/offset-fetch-v1.d.ts +6 -0
- package/dist/apis/consumer/offset-fetch-v1.js +41 -0
- package/dist/apis/consumer/offset-fetch-v2.d.ts +7 -0
- package/dist/apis/consumer/offset-fetch-v2.js +48 -0
- package/dist/apis/consumer/offset-fetch-v3.d.ts +39 -0
- package/dist/apis/consumer/offset-fetch-v3.js +64 -0
- package/dist/apis/consumer/offset-fetch-v4.d.ts +39 -0
- package/dist/apis/consumer/offset-fetch-v4.js +64 -0
- package/dist/apis/consumer/offset-fetch-v5.d.ts +39 -0
- package/dist/apis/consumer/offset-fetch-v5.js +65 -0
- package/dist/apis/consumer/offset-fetch-v6.d.ts +39 -0
- package/dist/apis/consumer/offset-fetch-v6.js +68 -0
- package/dist/apis/consumer/offset-fetch-v7.d.ts +39 -0
- package/dist/apis/consumer/offset-fetch-v7.js +70 -0
- package/dist/apis/consumer/offset-fetch-v8.js +5 -2
- package/dist/apis/consumer/offset-fetch-v9.js +5 -2
- package/dist/apis/consumer/offset-for-leader-epoch-v0.d.ts +29 -0
- package/dist/apis/consumer/offset-for-leader-epoch-v0.js +48 -0
- package/dist/apis/consumer/offset-for-leader-epoch-v1.d.ts +29 -0
- package/dist/apis/consumer/offset-for-leader-epoch-v1.js +54 -0
- package/dist/apis/consumer/offset-for-leader-epoch-v2.d.ts +29 -0
- package/dist/apis/consumer/offset-for-leader-epoch-v2.js +58 -0
- package/dist/apis/consumer/offset-for-leader-epoch-v3.d.ts +29 -0
- package/dist/apis/consumer/offset-for-leader-epoch-v3.js +59 -0
- package/dist/apis/consumer/offset-for-leader-epoch-v4.d.ts +1 -1
- package/dist/apis/consumer/offset-for-leader-epoch-v4.js +11 -8
- package/dist/apis/consumer/sync-group-v0.d.ts +18 -0
- package/dist/apis/consumer/sync-group-v0.js +38 -0
- package/dist/apis/consumer/sync-group-v1.d.ts +18 -0
- package/dist/apis/consumer/sync-group-v1.js +39 -0
- package/dist/apis/consumer/sync-group-v2.d.ts +18 -0
- package/dist/apis/consumer/sync-group-v2.js +39 -0
- package/dist/apis/consumer/sync-group-v3.d.ts +18 -0
- package/dist/apis/consumer/sync-group-v3.js +41 -0
- package/dist/apis/consumer/sync-group-v4.js +1 -0
- package/dist/apis/consumer/sync-group-v5.js +1 -0
- package/dist/apis/enumerations.d.ts +21 -6
- package/dist/apis/enumerations.js +57 -5
- package/dist/apis/index.d.ts +1 -0
- package/dist/apis/index.js +1 -0
- package/dist/apis/metadata/api-versions-v0.d.ts +17 -0
- package/dist/apis/metadata/api-versions-v0.js +24 -0
- package/dist/apis/metadata/api-versions-v1.d.ts +17 -0
- package/dist/apis/metadata/api-versions-v1.js +39 -0
- package/dist/apis/metadata/api-versions-v2.d.ts +17 -0
- package/dist/apis/metadata/api-versions-v2.js +39 -0
- package/dist/apis/metadata/api-versions-v3.d.ts +16 -2
- package/dist/apis/metadata/api-versions-v3.js +43 -4
- package/dist/apis/metadata/api-versions-v4.d.ts +16 -2
- package/dist/apis/metadata/api-versions-v4.js +35 -3
- package/dist/apis/metadata/find-coordinator-v0.d.ts +18 -0
- package/dist/apis/metadata/find-coordinator-v0.js +24 -0
- package/dist/apis/metadata/find-coordinator-v1.d.ts +18 -0
- package/dist/apis/metadata/find-coordinator-v1.js +41 -0
- package/dist/apis/metadata/find-coordinator-v2.d.ts +18 -0
- package/dist/apis/metadata/find-coordinator-v2.js +41 -0
- package/dist/apis/metadata/find-coordinator-v3.d.ts +18 -0
- package/dist/apis/metadata/find-coordinator-v3.js +44 -0
- package/dist/apis/metadata/find-coordinator-v4.js +3 -1
- package/dist/apis/metadata/find-coordinator-v5.js +3 -1
- package/dist/apis/metadata/find-coordinator-v6.js +3 -1
- package/dist/apis/metadata/index.d.ts +16 -0
- package/dist/apis/metadata/index.js +16 -0
- package/dist/apis/metadata/metadata-v0.d.ts +38 -0
- package/dist/apis/metadata/metadata-v0.js +47 -0
- package/dist/apis/metadata/metadata-v1.d.ts +38 -0
- package/dist/apis/metadata/metadata-v1.js +52 -0
- package/dist/apis/metadata/metadata-v10.d.ts +4 -2
- package/dist/apis/metadata/metadata-v10.js +29 -16
- package/dist/apis/metadata/metadata-v11.d.ts +3 -2
- package/dist/apis/metadata/metadata-v11.js +23 -15
- package/dist/apis/metadata/metadata-v12.d.ts +9 -2
- package/dist/apis/metadata/metadata-v12.js +21 -9
- package/dist/apis/metadata/metadata-v2.d.ts +38 -0
- package/dist/apis/metadata/metadata-v2.js +52 -0
- package/dist/apis/metadata/metadata-v3.d.ts +38 -0
- package/dist/apis/metadata/metadata-v3.js +52 -0
- package/dist/apis/metadata/metadata-v4.d.ts +38 -0
- package/dist/apis/metadata/metadata-v4.js +54 -0
- package/dist/apis/metadata/metadata-v5.d.ts +38 -0
- package/dist/apis/metadata/metadata-v5.js +85 -0
- package/dist/apis/metadata/metadata-v6.d.ts +38 -0
- package/dist/apis/metadata/metadata-v6.js +85 -0
- package/dist/apis/metadata/metadata-v7.d.ts +38 -0
- package/dist/apis/metadata/metadata-v7.js +86 -0
- package/dist/apis/metadata/metadata-v8.d.ts +39 -0
- package/dist/apis/metadata/metadata-v8.js +94 -0
- package/dist/apis/metadata/metadata-v9.d.ts +5 -3
- package/dist/apis/metadata/metadata-v9.js +28 -21
- package/dist/apis/producer/add-offsets-to-txn-v0.d.ts +10 -0
- package/dist/apis/producer/add-offsets-to-txn-v0.js +30 -0
- package/dist/apis/producer/add-offsets-to-txn-v3.js +1 -0
- package/dist/apis/producer/add-offsets-to-txn-v4.js +1 -0
- package/dist/apis/producer/add-partitions-to-txn-v0.d.ts +34 -0
- package/dist/apis/producer/add-partitions-to-txn-v0.js +62 -0
- package/dist/apis/producer/add-partitions-to-txn-v1.d.ts +5 -0
- package/dist/apis/producer/add-partitions-to-txn-v1.js +9 -0
- package/dist/apis/producer/add-partitions-to-txn-v2.d.ts +5 -0
- package/dist/apis/producer/add-partitions-to-txn-v2.js +9 -0
- package/dist/apis/producer/add-partitions-to-txn-v3.js +13 -8
- package/dist/apis/producer/add-partitions-to-txn-v4.js +11 -5
- package/dist/apis/producer/add-partitions-to-txn-v5.js +11 -5
- package/dist/apis/producer/end-txn-v0.d.ts +10 -0
- package/dist/apis/producer/end-txn-v0.js +30 -0
- package/dist/apis/producer/end-txn-v1.d.ts +5 -0
- package/dist/apis/producer/end-txn-v1.js +9 -0
- package/dist/apis/producer/end-txn-v2.d.ts +5 -0
- package/dist/apis/producer/end-txn-v2.js +9 -0
- package/dist/apis/producer/end-txn-v3.js +1 -0
- package/dist/apis/producer/end-txn-v4.js +1 -0
- package/dist/apis/producer/index.d.ts +17 -0
- package/dist/apis/producer/index.js +17 -0
- package/dist/apis/producer/init-producer-id-v0.d.ts +13 -0
- package/dist/apis/producer/init-producer-id-v0.js +31 -0
- package/dist/apis/producer/init-producer-id-v1.d.ts +5 -0
- package/dist/apis/producer/init-producer-id-v1.js +9 -0
- package/dist/apis/producer/init-producer-id-v2.d.ts +13 -0
- package/dist/apis/producer/init-producer-id-v2.js +24 -0
- package/dist/apis/producer/init-producer-id-v3.d.ts +2 -2
- package/dist/apis/producer/init-producer-id-v3.js +9 -1
- package/dist/apis/producer/init-producer-id-v4.d.ts +2 -2
- package/dist/apis/producer/init-producer-id-v4.js +9 -1
- package/dist/apis/producer/init-producer-id-v5.d.ts +2 -2
- package/dist/apis/producer/init-producer-id-v5.js +9 -1
- package/dist/apis/producer/produce-v10.d.ts +12 -0
- package/dist/apis/producer/produce-v10.js +42 -5
- package/dist/apis/producer/produce-v11.d.ts +12 -0
- package/dist/apis/producer/produce-v11.js +42 -5
- package/dist/apis/producer/produce-v3.d.ts +29 -0
- package/dist/apis/producer/produce-v3.js +88 -0
- package/dist/apis/producer/produce-v4.d.ts +29 -0
- package/dist/apis/producer/produce-v4.js +88 -0
- package/dist/apis/producer/produce-v5.d.ts +29 -0
- package/dist/apis/producer/produce-v5.js +88 -0
- package/dist/apis/producer/produce-v6.d.ts +29 -0
- package/dist/apis/producer/produce-v6.js +88 -0
- package/dist/apis/producer/produce-v7.js +1 -1
- package/dist/apis/producer/produce-v9.js +7 -3
- package/dist/apis/producer/txn-offset-commit-v0.d.ts +29 -0
- package/dist/apis/producer/txn-offset-commit-v0.js +60 -0
- package/dist/apis/producer/txn-offset-commit-v1.d.ts +29 -0
- package/dist/apis/producer/txn-offset-commit-v1.js +60 -0
- package/dist/apis/producer/txn-offset-commit-v2.d.ts +29 -0
- package/dist/apis/producer/txn-offset-commit-v2.js +62 -0
- package/dist/apis/producer/txn-offset-commit-v3.js +7 -3
- package/dist/apis/producer/txn-offset-commit-v4.js +7 -3
- package/dist/apis/security/index.d.ts +3 -0
- package/dist/apis/security/index.js +3 -0
- package/dist/apis/security/sasl-authenticate-v0.d.ts +15 -0
- package/dist/apis/security/sasl-authenticate-v0.js +30 -0
- package/dist/apis/security/sasl-authenticate-v1.d.ts +15 -0
- package/dist/apis/security/sasl-authenticate-v1.js +30 -0
- package/dist/apis/security/sasl-authenticate-v2.js +1 -0
- package/dist/apis/security/sasl-handshake-v0.d.ts +10 -0
- package/dist/apis/security/sasl-handshake-v0.js +28 -0
- package/dist/apis/tagged-fields.d.ts +7 -0
- package/dist/apis/tagged-fields.js +27 -0
- package/dist/apis/telemetry/compression-types.d.ts +8 -0
- package/dist/apis/telemetry/compression-types.js +7 -0
- package/dist/apis/telemetry/get-telemetry-subscriptions-v0.d.ts +2 -1
- package/dist/apis/telemetry/get-telemetry-subscriptions-v0.js +1 -0
- package/dist/apis/telemetry/index.d.ts +3 -0
- package/dist/apis/telemetry/index.js +3 -0
- package/dist/apis/telemetry/list-client-metrics-resources-v0.d.ts +6 -4
- package/dist/apis/telemetry/list-client-metrics-resources-v0.js +13 -8
- package/dist/apis/telemetry/list-config-resources-v1.d.ts +16 -0
- package/dist/apis/telemetry/list-config-resources-v1.js +38 -0
- package/dist/apis/telemetry/push-telemetry-v0.d.ts +3 -2
- package/dist/apis/telemetry/push-telemetry-v0.js +1 -0
- package/dist/clients/admin/admin.js +428 -378
- package/dist/clients/admin/options.d.ts +62 -6
- package/dist/clients/admin/options.js +41 -10
- package/dist/clients/admin/types.d.ts +8 -2
- package/dist/clients/base/base.d.ts +3 -3
- package/dist/clients/base/base.js +77 -20
- package/dist/clients/consumer/consumer.d.ts +2 -1
- package/dist/clients/consumer/consumer.js +386 -77
- package/dist/clients/consumer/messages-stream.js +228 -43
- package/dist/clients/consumer/options.d.ts +38 -0
- package/dist/clients/consumer/options.js +3 -0
- package/dist/clients/consumer/types.d.ts +40 -2
- package/dist/clients/consumer/types.js +5 -0
- package/dist/clients/consumer/utils.d.ts +1 -0
- package/dist/clients/consumer/utils.js +6 -0
- package/dist/clients/producer/producer.js +112 -54
- package/dist/clients/serde.d.ts +1 -1
- package/dist/errors.d.ts +4 -0
- package/dist/errors.js +22 -0
- package/dist/network/connection-pool.js +12 -2
- package/dist/network/connection.js +100 -22
- package/dist/network/utils.js +26 -8
- package/dist/protocol/definitions.js +1 -1
- package/dist/protocol/reader.js +11 -6
- package/dist/protocol/records.d.ts +4 -0
- package/dist/protocol/writer.js +17 -4
- package/dist/registries/abstract.d.ts +2 -2
- package/dist/registries/abstract.js +27 -8
- package/dist/registries/confluent-schema-registry.d.ts +57 -4
- package/dist/registries/confluent-schema-registry.js +253 -41
- package/dist/symbols.d.ts +1 -0
- package/dist/symbols.js +1 -0
- package/dist/typescript-4/dist/apis/admin/alter-client-quotas-v0.d.ts +40 -0
- package/dist/typescript-4/dist/apis/admin/alter-client-quotas-v1.d.ts +6 -5
- package/dist/typescript-4/dist/apis/admin/alter-configs-v0.d.ts +7 -0
- package/dist/typescript-4/dist/apis/admin/alter-configs-v1.d.ts +2 -0
- package/dist/typescript-4/dist/apis/admin/alter-partition-reassignments-v0.d.ts +3 -2
- package/dist/typescript-4/dist/apis/admin/alter-partition-reassignments-v1.d.ts +6 -4
- package/dist/typescript-4/dist/apis/admin/alter-partition-v0.d.ts +40 -0
- package/dist/typescript-4/dist/apis/admin/alter-partition-v1.d.ts +37 -0
- package/dist/typescript-4/dist/apis/admin/alter-partition-v2.d.ts +36 -0
- package/dist/typescript-4/dist/apis/admin/alter-partition-v3.d.ts +6 -35
- package/dist/typescript-4/dist/apis/admin/alter-replica-log-dirs-v0.d.ts +23 -0
- package/dist/typescript-4/dist/apis/admin/alter-replica-log-dirs-v1.d.ts +4 -0
- package/dist/typescript-4/dist/apis/admin/alter-replica-log-dirs-v2.d.ts +1 -1
- package/dist/typescript-4/dist/apis/admin/client-quotas.d.ts +2 -0
- package/dist/typescript-4/dist/apis/admin/consumer-group-describe-v0.d.ts +2 -1
- package/dist/typescript-4/dist/apis/admin/create-acls-v0.d.ts +16 -0
- package/dist/typescript-4/dist/apis/admin/create-acls-v1.d.ts +15 -0
- package/dist/typescript-4/dist/apis/admin/create-delegation-token-v0.d.ts +24 -0
- package/dist/typescript-4/dist/apis/admin/create-delegation-token-v1.d.ts +4 -0
- package/dist/typescript-4/dist/apis/admin/create-delegation-token-v2.d.ts +9 -0
- package/dist/typescript-4/dist/apis/admin/create-partitions-v0.d.ts +2 -0
- package/dist/typescript-4/dist/apis/admin/create-partitions-v1.d.ts +2 -2
- package/dist/typescript-4/dist/apis/admin/create-partitions-v2.d.ts +2 -2
- package/dist/typescript-4/dist/apis/admin/create-topics-v0.d.ts +42 -0
- package/dist/typescript-4/dist/apis/admin/create-topics-v1.d.ts +42 -0
- package/dist/typescript-4/dist/apis/admin/create-topics-v2.d.ts +42 -0
- package/dist/typescript-4/dist/apis/admin/create-topics-v3.d.ts +42 -0
- package/dist/typescript-4/dist/apis/admin/create-topics-v4.d.ts +42 -0
- package/dist/typescript-4/dist/apis/admin/create-topics-v5.d.ts +42 -0
- package/dist/typescript-4/dist/apis/admin/create-topics-v6.d.ts +42 -0
- package/dist/typescript-4/dist/apis/admin/create-topics-v7.d.ts +2 -1
- package/dist/typescript-4/dist/apis/admin/delete-acls-v0.d.ts +28 -0
- package/dist/typescript-4/dist/apis/admin/delete-acls-v1.d.ts +27 -0
- package/dist/typescript-4/dist/apis/admin/delete-groups-v0.d.ts +14 -0
- package/dist/typescript-4/dist/apis/admin/delete-groups-v1.d.ts +14 -0
- package/dist/typescript-4/dist/apis/admin/delete-records-v0.d.ts +27 -0
- package/dist/typescript-4/dist/apis/admin/delete-records-v1.d.ts +27 -0
- package/dist/typescript-4/dist/apis/admin/delete-topics-v0.d.ts +19 -0
- package/dist/typescript-4/dist/apis/admin/delete-topics-v1.d.ts +19 -0
- package/dist/typescript-4/dist/apis/admin/delete-topics-v2.d.ts +19 -0
- package/dist/typescript-4/dist/apis/admin/delete-topics-v3.d.ts +19 -0
- package/dist/typescript-4/dist/apis/admin/delete-topics-v4.d.ts +19 -0
- package/dist/typescript-4/dist/apis/admin/delete-topics-v5.d.ts +19 -0
- package/dist/typescript-4/dist/apis/admin/delete-topics-v6.d.ts +1 -1
- package/dist/typescript-4/dist/apis/admin/describe-acls-v0.d.ts +21 -0
- package/dist/typescript-4/dist/apis/admin/describe-acls-v1.d.ts +21 -0
- package/dist/typescript-4/dist/apis/admin/describe-client-quotas-v0.d.ts +8 -7
- package/dist/typescript-4/dist/apis/admin/describe-client-quotas-v1.d.ts +9 -0
- package/dist/typescript-4/dist/apis/admin/describe-cluster-v0.d.ts +4 -3
- package/dist/typescript-4/dist/apis/admin/describe-cluster-v1.d.ts +4 -3
- package/dist/typescript-4/dist/apis/admin/describe-configs-v0.d.ts +41 -0
- package/dist/typescript-4/dist/apis/admin/describe-configs-v1.d.ts +39 -0
- package/dist/typescript-4/dist/apis/admin/describe-configs-v2.d.ts +9 -8
- package/dist/typescript-4/dist/apis/admin/describe-configs-v3.d.ts +9 -8
- package/dist/typescript-4/dist/apis/admin/describe-configs-v4.d.ts +2 -2
- package/dist/typescript-4/dist/apis/admin/describe-delegation-token-v0.d.ts +31 -0
- package/dist/typescript-4/dist/apis/admin/describe-delegation-token-v1.d.ts +4 -0
- package/dist/typescript-4/dist/apis/admin/describe-delegation-token-v2.d.ts +8 -0
- package/dist/typescript-4/dist/apis/admin/describe-delegation-token-v3.d.ts +4 -27
- package/dist/typescript-4/dist/apis/admin/describe-groups-v0.d.ts +28 -0
- package/dist/typescript-4/dist/apis/admin/describe-groups-v1.d.ts +28 -0
- package/dist/typescript-4/dist/apis/admin/describe-groups-v2.d.ts +28 -0
- package/dist/typescript-4/dist/apis/admin/describe-groups-v3.d.ts +28 -0
- package/dist/typescript-4/dist/apis/admin/describe-groups-v4.d.ts +28 -0
- package/dist/typescript-4/dist/apis/admin/describe-log-dirs-v0.d.ts +30 -0
- package/dist/typescript-4/dist/apis/admin/describe-log-dirs-v1.d.ts +4 -0
- package/dist/typescript-4/dist/apis/admin/describe-log-dirs-v2.d.ts +3 -2
- package/dist/typescript-4/dist/apis/admin/describe-log-dirs-v3.d.ts +3 -2
- package/dist/typescript-4/dist/apis/admin/describe-log-dirs-v4.d.ts +3 -2
- package/dist/typescript-4/dist/apis/admin/describe-quorum-v0.d.ts +13 -0
- package/dist/typescript-4/dist/apis/admin/describe-quorum-v1.d.ts +13 -0
- package/dist/typescript-4/dist/apis/admin/describe-topic-partitions-v0.d.ts +3 -3
- package/dist/typescript-4/dist/apis/admin/describe-user-scram-credentials-v0.d.ts +4 -3
- package/dist/typescript-4/dist/apis/admin/expire-delegation-token-v0.d.ts +11 -0
- package/dist/typescript-4/dist/apis/admin/expire-delegation-token-v1.d.ts +4 -0
- package/dist/typescript-4/dist/apis/admin/incremental-alter-configs-v0.d.ts +26 -0
- package/dist/typescript-4/dist/apis/admin/index.d.ts +60 -0
- package/dist/typescript-4/dist/apis/admin/list-groups-v0.d.ts +18 -0
- package/dist/typescript-4/dist/apis/admin/list-groups-v1.d.ts +18 -0
- package/dist/typescript-4/dist/apis/admin/list-groups-v2.d.ts +18 -0
- package/dist/typescript-4/dist/apis/admin/list-groups-v3.d.ts +18 -0
- package/dist/typescript-4/dist/apis/admin/list-groups-v4.d.ts +4 -3
- package/dist/typescript-4/dist/apis/admin/list-groups-v5.d.ts +3 -3
- package/dist/typescript-4/dist/apis/admin/list-partition-reassignments-v0.d.ts +3 -3
- package/dist/typescript-4/dist/apis/admin/list-transactions-v0.d.ts +5 -3
- package/dist/typescript-4/dist/apis/admin/list-transactions-v1.d.ts +5 -3
- package/dist/typescript-4/dist/apis/admin/list-transactions-v2.d.ts +5 -4
- package/dist/typescript-4/dist/apis/admin/renew-delegation-token-v0.d.ts +11 -0
- package/dist/typescript-4/dist/apis/admin/renew-delegation-token-v1.d.ts +4 -0
- package/dist/typescript-4/dist/apis/admin/update-features-v0.d.ts +24 -0
- package/dist/typescript-4/dist/apis/admin/update-features-v1.d.ts +2 -1
- package/dist/typescript-4/dist/apis/callbacks.d.ts +1 -3
- package/dist/typescript-4/dist/apis/consumer/consumer-group-heartbeat-v0.d.ts +2 -2
- package/dist/typescript-4/dist/apis/consumer/consumer-group-heartbeat-v1.d.ts +2 -2
- package/dist/typescript-4/dist/apis/consumer/fetch-v10.d.ts +51 -0
- package/dist/typescript-4/dist/apis/consumer/fetch-v11.d.ts +51 -0
- package/dist/typescript-4/dist/apis/consumer/fetch-v12.d.ts +20 -4
- package/dist/typescript-4/dist/apis/consumer/fetch-v13.d.ts +20 -4
- package/dist/typescript-4/dist/apis/consumer/fetch-v14.d.ts +20 -4
- package/dist/typescript-4/dist/apis/consumer/fetch-v15.d.ts +20 -4
- package/dist/typescript-4/dist/apis/consumer/fetch-v16.d.ts +27 -4
- package/dist/typescript-4/dist/apis/consumer/fetch-v17.d.ts +28 -4
- package/dist/typescript-4/dist/apis/consumer/fetch-v4.d.ts +51 -0
- package/dist/typescript-4/dist/apis/consumer/fetch-v5.d.ts +51 -0
- package/dist/typescript-4/dist/apis/consumer/fetch-v6.d.ts +51 -0
- package/dist/typescript-4/dist/apis/consumer/fetch-v7.d.ts +51 -0
- package/dist/typescript-4/dist/apis/consumer/fetch-v8.d.ts +51 -0
- package/dist/typescript-4/dist/apis/consumer/fetch-v9.d.ts +51 -0
- package/dist/typescript-4/dist/apis/consumer/heartbeat-v0.d.ts +11 -0
- package/dist/typescript-4/dist/apis/consumer/heartbeat-v1.d.ts +11 -0
- package/dist/typescript-4/dist/apis/consumer/heartbeat-v2.d.ts +11 -0
- package/dist/typescript-4/dist/apis/consumer/heartbeat-v3.d.ts +11 -0
- package/dist/typescript-4/dist/apis/consumer/index.d.ts +51 -0
- package/dist/typescript-4/dist/apis/consumer/join-group-v0.d.ts +27 -0
- package/dist/typescript-4/dist/apis/consumer/join-group-v1.d.ts +8 -0
- package/dist/typescript-4/dist/apis/consumer/join-group-v2.d.ts +27 -0
- package/dist/typescript-4/dist/apis/consumer/join-group-v3.d.ts +27 -0
- package/dist/typescript-4/dist/apis/consumer/join-group-v4.d.ts +27 -0
- package/dist/typescript-4/dist/apis/consumer/join-group-v5.d.ts +27 -0
- package/dist/typescript-4/dist/apis/consumer/join-group-v6.d.ts +2 -2
- package/dist/typescript-4/dist/apis/consumer/join-group-v7.d.ts +2 -2
- package/dist/typescript-4/dist/apis/consumer/join-group-v8.d.ts +2 -2
- package/dist/typescript-4/dist/apis/consumer/join-group-v9.d.ts +2 -2
- package/dist/typescript-4/dist/apis/consumer/leave-group-v0.d.ts +22 -0
- package/dist/typescript-4/dist/apis/consumer/leave-group-v1.d.ts +22 -0
- package/dist/typescript-4/dist/apis/consumer/leave-group-v2.d.ts +22 -0
- package/dist/typescript-4/dist/apis/consumer/leave-group-v3.d.ts +22 -0
- package/dist/typescript-4/dist/apis/consumer/leave-group-v4.d.ts +1 -1
- package/dist/typescript-4/dist/apis/consumer/leave-group-v5.d.ts +1 -1
- package/dist/typescript-4/dist/apis/consumer/list-offsets-v0.d.ts +30 -0
- package/dist/typescript-4/dist/apis/consumer/list-offsets-v1.d.ts +12 -0
- package/dist/typescript-4/dist/apis/consumer/list-offsets-v2.d.ts +30 -0
- package/dist/typescript-4/dist/apis/consumer/list-offsets-v3.d.ts +30 -0
- package/dist/typescript-4/dist/apis/consumer/list-offsets-v4.d.ts +30 -0
- package/dist/typescript-4/dist/apis/consumer/offset-commit-v0.d.ts +29 -0
- package/dist/typescript-4/dist/apis/consumer/offset-commit-v1.d.ts +7 -0
- package/dist/typescript-4/dist/apis/consumer/offset-commit-v2.d.ts +8 -0
- package/dist/typescript-4/dist/apis/consumer/offset-commit-v3.d.ts +29 -0
- package/dist/typescript-4/dist/apis/consumer/offset-commit-v4.d.ts +29 -0
- package/dist/typescript-4/dist/apis/consumer/offset-commit-v5.d.ts +29 -0
- package/dist/typescript-4/dist/apis/consumer/offset-commit-v6.d.ts +29 -0
- package/dist/typescript-4/dist/apis/consumer/offset-commit-v7.d.ts +29 -0
- package/dist/typescript-4/dist/apis/consumer/offset-commit-v8.d.ts +2 -2
- package/dist/typescript-4/dist/apis/consumer/offset-commit-v9.d.ts +2 -2
- package/dist/typescript-4/dist/apis/consumer/offset-fetch-v0.d.ts +40 -0
- package/dist/typescript-4/dist/apis/consumer/offset-fetch-v1.d.ts +6 -0
- package/dist/typescript-4/dist/apis/consumer/offset-fetch-v2.d.ts +7 -0
- package/dist/typescript-4/dist/apis/consumer/offset-fetch-v3.d.ts +39 -0
- package/dist/typescript-4/dist/apis/consumer/offset-fetch-v4.d.ts +39 -0
- package/dist/typescript-4/dist/apis/consumer/offset-fetch-v5.d.ts +39 -0
- package/dist/typescript-4/dist/apis/consumer/offset-fetch-v6.d.ts +39 -0
- package/dist/typescript-4/dist/apis/consumer/offset-fetch-v7.d.ts +39 -0
- package/dist/typescript-4/dist/apis/consumer/offset-for-leader-epoch-v0.d.ts +29 -0
- package/dist/typescript-4/dist/apis/consumer/offset-for-leader-epoch-v1.d.ts +29 -0
- package/dist/typescript-4/dist/apis/consumer/offset-for-leader-epoch-v2.d.ts +29 -0
- package/dist/typescript-4/dist/apis/consumer/offset-for-leader-epoch-v3.d.ts +29 -0
- package/dist/typescript-4/dist/apis/consumer/offset-for-leader-epoch-v4.d.ts +1 -1
- package/dist/typescript-4/dist/apis/consumer/sync-group-v0.d.ts +18 -0
- package/dist/typescript-4/dist/apis/consumer/sync-group-v1.d.ts +18 -0
- package/dist/typescript-4/dist/apis/consumer/sync-group-v2.d.ts +18 -0
- package/dist/typescript-4/dist/apis/consumer/sync-group-v3.d.ts +18 -0
- package/dist/typescript-4/dist/apis/enumerations.d.ts +21 -6
- package/dist/typescript-4/dist/apis/index.d.ts +1 -0
- package/dist/typescript-4/dist/apis/metadata/api-versions-v0.d.ts +17 -0
- package/dist/typescript-4/dist/apis/metadata/api-versions-v1.d.ts +17 -0
- package/dist/typescript-4/dist/apis/metadata/api-versions-v2.d.ts +17 -0
- package/dist/typescript-4/dist/apis/metadata/api-versions-v3.d.ts +16 -2
- package/dist/typescript-4/dist/apis/metadata/api-versions-v4.d.ts +16 -2
- package/dist/typescript-4/dist/apis/metadata/find-coordinator-v0.d.ts +18 -0
- package/dist/typescript-4/dist/apis/metadata/find-coordinator-v1.d.ts +18 -0
- package/dist/typescript-4/dist/apis/metadata/find-coordinator-v2.d.ts +18 -0
- package/dist/typescript-4/dist/apis/metadata/find-coordinator-v3.d.ts +18 -0
- package/dist/typescript-4/dist/apis/metadata/index.d.ts +16 -0
- package/dist/typescript-4/dist/apis/metadata/metadata-v0.d.ts +38 -0
- package/dist/typescript-4/dist/apis/metadata/metadata-v1.d.ts +38 -0
- package/dist/typescript-4/dist/apis/metadata/metadata-v10.d.ts +4 -2
- package/dist/typescript-4/dist/apis/metadata/metadata-v11.d.ts +3 -2
- package/dist/typescript-4/dist/apis/metadata/metadata-v12.d.ts +9 -2
- package/dist/typescript-4/dist/apis/metadata/metadata-v2.d.ts +38 -0
- package/dist/typescript-4/dist/apis/metadata/metadata-v3.d.ts +38 -0
- package/dist/typescript-4/dist/apis/metadata/metadata-v4.d.ts +38 -0
- package/dist/typescript-4/dist/apis/metadata/metadata-v5.d.ts +38 -0
- package/dist/typescript-4/dist/apis/metadata/metadata-v6.d.ts +38 -0
- package/dist/typescript-4/dist/apis/metadata/metadata-v7.d.ts +38 -0
- package/dist/typescript-4/dist/apis/metadata/metadata-v8.d.ts +39 -0
- package/dist/typescript-4/dist/apis/metadata/metadata-v9.d.ts +5 -3
- package/dist/typescript-4/dist/apis/producer/add-offsets-to-txn-v0.d.ts +10 -0
- package/dist/typescript-4/dist/apis/producer/add-partitions-to-txn-v0.d.ts +34 -0
- package/dist/typescript-4/dist/apis/producer/add-partitions-to-txn-v1.d.ts +5 -0
- package/dist/typescript-4/dist/apis/producer/add-partitions-to-txn-v2.d.ts +5 -0
- package/dist/typescript-4/dist/apis/producer/end-txn-v0.d.ts +10 -0
- package/dist/typescript-4/dist/apis/producer/end-txn-v1.d.ts +5 -0
- package/dist/typescript-4/dist/apis/producer/end-txn-v2.d.ts +5 -0
- package/dist/typescript-4/dist/apis/producer/index.d.ts +17 -0
- package/dist/typescript-4/dist/apis/producer/init-producer-id-v0.d.ts +13 -0
- package/dist/typescript-4/dist/apis/producer/init-producer-id-v1.d.ts +5 -0
- package/dist/typescript-4/dist/apis/producer/init-producer-id-v2.d.ts +13 -0
- package/dist/typescript-4/dist/apis/producer/init-producer-id-v3.d.ts +2 -2
- package/dist/typescript-4/dist/apis/producer/init-producer-id-v4.d.ts +2 -2
- package/dist/typescript-4/dist/apis/producer/init-producer-id-v5.d.ts +2 -2
- package/dist/typescript-4/dist/apis/producer/produce-v10.d.ts +12 -0
- package/dist/typescript-4/dist/apis/producer/produce-v11.d.ts +12 -0
- package/dist/typescript-4/dist/apis/producer/produce-v3.d.ts +29 -0
- package/dist/typescript-4/dist/apis/producer/produce-v4.d.ts +29 -0
- package/dist/typescript-4/dist/apis/producer/produce-v5.d.ts +29 -0
- package/dist/typescript-4/dist/apis/producer/produce-v6.d.ts +29 -0
- package/dist/typescript-4/dist/apis/producer/txn-offset-commit-v0.d.ts +29 -0
- package/dist/typescript-4/dist/apis/producer/txn-offset-commit-v1.d.ts +29 -0
- package/dist/typescript-4/dist/apis/producer/txn-offset-commit-v2.d.ts +29 -0
- package/dist/typescript-4/dist/apis/security/index.d.ts +3 -0
- package/dist/typescript-4/dist/apis/security/sasl-authenticate-v0.d.ts +15 -0
- package/dist/typescript-4/dist/apis/security/sasl-authenticate-v1.d.ts +15 -0
- package/dist/typescript-4/dist/apis/security/sasl-handshake-v0.d.ts +10 -0
- package/dist/typescript-4/dist/apis/tagged-fields.d.ts +7 -0
- package/dist/typescript-4/dist/apis/telemetry/compression-types.d.ts +8 -0
- package/dist/typescript-4/dist/apis/telemetry/get-telemetry-subscriptions-v0.d.ts +2 -1
- package/dist/typescript-4/dist/apis/telemetry/index.d.ts +3 -0
- package/dist/typescript-4/dist/apis/telemetry/list-client-metrics-resources-v0.d.ts +6 -4
- package/dist/typescript-4/dist/apis/telemetry/list-config-resources-v1.d.ts +16 -0
- package/dist/typescript-4/dist/apis/telemetry/push-telemetry-v0.d.ts +3 -2
- package/dist/typescript-4/dist/clients/admin/options.d.ts +62 -6
- package/dist/typescript-4/dist/clients/admin/types.d.ts +8 -2
- package/dist/typescript-4/dist/clients/base/base.d.ts +3 -3
- package/dist/typescript-4/dist/clients/consumer/consumer.d.ts +2 -1
- package/dist/typescript-4/dist/clients/consumer/options.d.ts +38 -0
- package/dist/typescript-4/dist/clients/consumer/types.d.ts +40 -2
- package/dist/typescript-4/dist/clients/consumer/utils.d.ts +2 -1
- package/dist/typescript-4/dist/clients/serde.d.ts +1 -1
- package/dist/typescript-4/dist/errors.d.ts +4 -0
- package/dist/typescript-4/dist/protocol/records.d.ts +4 -0
- package/dist/typescript-4/dist/registries/abstract.d.ts +2 -2
- package/dist/typescript-4/dist/registries/confluent-schema-registry.d.ts +57 -4
- package/dist/typescript-4/dist/symbols.d.ts +1 -0
- package/dist/version.js +1 -1
- package/package.json +4 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createPromisifiedCallback, kCallbackPromise, runConcurrentCallbacks } from "../../apis/callbacks.js";
|
|
2
|
-
import { ConfigResourceTypes, FetchIsolationLevels, FindCoordinatorKeyTypes } from "../../apis/enumerations.js";
|
|
2
|
+
import { ConfigResourceTypes, FetchIsolationLevels, FindCoordinatorKeyTypes, legacyConsumerGroupStates } from "../../apis/enumerations.js";
|
|
3
3
|
import { adminAclsChannel, adminClientQuotasChannel, adminConfigsChannel, adminConsumerGroupOffsetsChannel, adminGroupsChannel, adminLogDirsChannel, adminOffsetsChannel, adminTopicsChannel, createDiagnosticContext } from "../../diagnostic.js";
|
|
4
|
-
import { MultipleErrors, UserError } from "../../errors.js";
|
|
4
|
+
import { findErrorBy, MultipleErrors, NetworkError, UserError } from "../../errors.js";
|
|
5
5
|
import { Reader } from "../../protocol/reader.js";
|
|
6
6
|
import { Base, kAfterCreate, kCheckNotClosed, kConnections, kGetApi, kGetBootstrapConnection, kGetConnection, kMetadata, kOptions, kPerformDeduplicated, kPerformWithRetry, kValidateOptions } from "../base/base.js";
|
|
7
7
|
import { adminListOffsetsOptionsValidator, alterClientQuotasOptionsValidator, alterConfigsOptionsValidator, alterConsumerGroupOffsetsOptionsValidator, createAclsOptionsValidator, createPartitionsOptionsValidator, createTopicsOptionsValidator, deleteAclsOptionsValidator, deleteConsumerGroupOffsetsOptionsValidator, deleteGroupsOptionsValidator, deleteRecordsOptionsValidator, deleteTopicsOptionsValidator, describeAclsOptionsValidator, describeClientQuotasOptionsValidator, describeConfigsOptionsValidator, describeGroupsOptionsValidator, describeLogDirsOptionsValidator, findCoordinatorOptionsValidator, incrementalAlterConfigsOptionsValidator, listConsumerGroupOffsetsOptionsValidator, listGroupsOptionsValidator, listTopicsOptionsValidator, removeMembersFromConsumerGroupOptionsValidator } from "./options.js";
|
|
@@ -366,15 +366,20 @@ export class Admin extends Base {
|
|
|
366
366
|
}
|
|
367
367
|
#getControllerConnection(callback) {
|
|
368
368
|
if (this.#controller) {
|
|
369
|
-
this[kConnections].get(this.#controller,
|
|
369
|
+
this[kConnections].get(this.#controller, (error, connection) => {
|
|
370
|
+
if (NetworkError.isRetryable(error)) {
|
|
371
|
+
this.#controller = null;
|
|
372
|
+
}
|
|
373
|
+
callback(error, connection);
|
|
374
|
+
});
|
|
370
375
|
}
|
|
371
376
|
else {
|
|
372
377
|
this[kGetBootstrapConnection](callback);
|
|
373
378
|
}
|
|
374
379
|
}
|
|
375
380
|
#handleNotControllerError(error, value, callback) {
|
|
376
|
-
if (error
|
|
377
|
-
this
|
|
381
|
+
if (findErrorBy(error, 'apiCode', 41)) {
|
|
382
|
+
this[kMetadata]({ topics: [], forceUpdate: true }, (metadataError, metadata) => {
|
|
378
383
|
/* c8 ignore next 4 - Hard to test */
|
|
379
384
|
if (metadataError) {
|
|
380
385
|
callback(metadataError);
|
|
@@ -407,7 +412,7 @@ export class Admin extends Base {
|
|
|
407
412
|
});
|
|
408
413
|
}, (error, metadata) => {
|
|
409
414
|
if (error) {
|
|
410
|
-
deduplicateCallback(error);
|
|
415
|
+
deduplicateCallback(new MultipleErrors('Listing topics failed.', [error]));
|
|
411
416
|
return;
|
|
412
417
|
}
|
|
413
418
|
const topics = new Set();
|
|
@@ -422,26 +427,34 @@ export class Admin extends Base {
|
|
|
422
427
|
}, 0);
|
|
423
428
|
}, callback);
|
|
424
429
|
}
|
|
430
|
+
#mapTopicAssignments(assignments) {
|
|
431
|
+
const mapped = [];
|
|
432
|
+
for (const { partition, brokers } of assignments ?? []) {
|
|
433
|
+
mapped.push({ partitionIndex: partition, brokerIds: brokers });
|
|
434
|
+
}
|
|
435
|
+
return mapped;
|
|
436
|
+
}
|
|
425
437
|
#createTopics(options, callback) {
|
|
426
438
|
// -1 is required if manual assignments are used. If no manual assignments are used, -1 will default to broker settings.
|
|
427
439
|
const numPartitions = options.partitions ?? -1;
|
|
428
440
|
const replicationFactor = options.replicas ?? -1;
|
|
429
|
-
const assignments =
|
|
441
|
+
const assignments = this.#mapTopicAssignments(options.assignments);
|
|
430
442
|
const configs = options.configs ?? [];
|
|
431
|
-
for (const { partition, brokers } of options.assignments ?? []) {
|
|
432
|
-
assignments.push({ partitionIndex: partition, brokerIds: brokers });
|
|
433
|
-
}
|
|
434
443
|
const requests = [];
|
|
435
444
|
for (const topic of options.topics) {
|
|
445
|
+
if (typeof topic === 'string') {
|
|
446
|
+
requests.push({ name: topic, numPartitions, replicationFactor, assignments, configs });
|
|
447
|
+
continue;
|
|
448
|
+
}
|
|
436
449
|
requests.push({
|
|
437
|
-
name: topic,
|
|
438
|
-
numPartitions,
|
|
439
|
-
replicationFactor,
|
|
440
|
-
assignments,
|
|
450
|
+
name: topic.topic,
|
|
451
|
+
numPartitions: topic.partitions ?? numPartitions,
|
|
452
|
+
replicationFactor: topic.replicas ?? replicationFactor,
|
|
453
|
+
assignments: topic.assignments ? this.#mapTopicAssignments(topic.assignments) : assignments,
|
|
441
454
|
configs
|
|
442
455
|
});
|
|
443
456
|
}
|
|
444
|
-
this[kPerformDeduplicated](`createTopics-${options.topics.join(',')}`, deduplicateCallback => {
|
|
457
|
+
this[kPerformDeduplicated](`createTopics-${options.topics.map(topic => (typeof topic === 'string' ? topic : topic.topic)).join(',')}`, deduplicateCallback => {
|
|
445
458
|
this[kPerformWithRetry]('createTopics', retryCallback => {
|
|
446
459
|
this.#getControllerConnection((error, connection) => {
|
|
447
460
|
if (error) {
|
|
@@ -460,13 +473,14 @@ export class Admin extends Base {
|
|
|
460
473
|
});
|
|
461
474
|
}, (error, response) => {
|
|
462
475
|
if (error) {
|
|
463
|
-
deduplicateCallback(error);
|
|
476
|
+
deduplicateCallback(new MultipleErrors('Creating topics failed.', [error]));
|
|
464
477
|
return;
|
|
465
478
|
}
|
|
466
479
|
const created = [];
|
|
467
|
-
|
|
480
|
+
const topics = response.topics;
|
|
481
|
+
for (const { name, topicId: id = '', numPartitions: partitions = -1, replicationFactor: replicas = -1, configs: topicConfigs } of topics) {
|
|
468
482
|
const configuration = {};
|
|
469
|
-
for (const { name, value } of
|
|
483
|
+
for (const { name, value } of topicConfigs ?? []) {
|
|
470
484
|
configuration[name] = value;
|
|
471
485
|
}
|
|
472
486
|
created.push({ id, name, partitions, replicas, configuration });
|
|
@@ -497,7 +511,13 @@ export class Admin extends Base {
|
|
|
497
511
|
});
|
|
498
512
|
});
|
|
499
513
|
});
|
|
500
|
-
},
|
|
514
|
+
}, (error, response) => {
|
|
515
|
+
if (error) {
|
|
516
|
+
deduplicateCallback(new MultipleErrors('Deleting topics failed.', [error]));
|
|
517
|
+
return;
|
|
518
|
+
}
|
|
519
|
+
deduplicateCallback(null, response);
|
|
520
|
+
}, 0);
|
|
501
521
|
}, error => callback(error));
|
|
502
522
|
}
|
|
503
523
|
#createPartitions(options, callback) {
|
|
@@ -529,13 +549,14 @@ export class Admin extends Base {
|
|
|
529
549
|
});
|
|
530
550
|
}
|
|
531
551
|
#listGroups(options, callback) {
|
|
532
|
-
|
|
533
|
-
this[kMetadata]({ topics: [] }, (error, metadata) => {
|
|
552
|
+
this[kMetadata]({ topics: [], forceUpdate: true }, (error, metadata) => {
|
|
534
553
|
if (error) {
|
|
535
554
|
callback(error);
|
|
536
555
|
return;
|
|
537
556
|
}
|
|
538
|
-
runConcurrentCallbacks('Listing groups failed.',
|
|
557
|
+
runConcurrentCallbacks('Listing groups failed.',
|
|
558
|
+
// metadata must be defined as error was undefined
|
|
559
|
+
metadata.brokers, ([, broker], concurrentCallback) => {
|
|
539
560
|
this[kGetConnection](broker, (error, connection) => {
|
|
540
561
|
if (error) {
|
|
541
562
|
concurrentCallback(error);
|
|
@@ -547,8 +568,11 @@ export class Admin extends Base {
|
|
|
547
568
|
retryCallback(error);
|
|
548
569
|
return;
|
|
549
570
|
}
|
|
571
|
+
// Brokers filter on the values they put on the wire, so the legacy Java enum
|
|
572
|
+
// constant names have to be translated or they would silently match nothing.
|
|
573
|
+
const states = (options.states ?? []).map(state => legacyConsumerGroupStates[state] ?? state);
|
|
550
574
|
/* c8 ignore next 5 */
|
|
551
|
-
api(connection,
|
|
575
|
+
api(connection, states, options.types, retryCallback);
|
|
552
576
|
});
|
|
553
577
|
}, concurrentCallback, 0);
|
|
554
578
|
});
|
|
@@ -562,8 +586,10 @@ export class Admin extends Base {
|
|
|
562
586
|
for (const raw of result.groups) {
|
|
563
587
|
groups.set(raw.groupId, {
|
|
564
588
|
id: raw.groupId,
|
|
565
|
-
|
|
566
|
-
|
|
589
|
+
// ListGroups only carries group_state from v4, so below that the codec has nothing
|
|
590
|
+
// to report. 'Unknown' is the value Kafka itself uses for exactly this case.
|
|
591
|
+
state: (raw.groupState || 'Unknown'),
|
|
592
|
+
groupType: raw.groupType || undefined,
|
|
567
593
|
protocolType: raw.protocolType
|
|
568
594
|
});
|
|
569
595
|
}
|
|
@@ -573,45 +599,42 @@ export class Admin extends Base {
|
|
|
573
599
|
});
|
|
574
600
|
}
|
|
575
601
|
#describeGroups(options, callback) {
|
|
576
|
-
this[
|
|
577
|
-
if (error) {
|
|
578
|
-
callback(error);
|
|
579
|
-
return;
|
|
580
|
-
}
|
|
602
|
+
this[kPerformWithRetry]('describeGroups', retryCallback => {
|
|
581
603
|
this.#findCoordinator({ keyType: FindCoordinatorKeyTypes.GROUP, keys: options.groups }, (error, coordinators) => {
|
|
582
604
|
if (error) {
|
|
583
|
-
|
|
605
|
+
// FindCoordinator already retried some times so no retry again
|
|
606
|
+
callback(new MultipleErrors('Describing groups failed.', error instanceof MultipleErrors ? error.errors : [error]));
|
|
584
607
|
return;
|
|
585
608
|
}
|
|
586
|
-
// Group the groups by coordinator
|
|
587
609
|
const coordinatorsMap = new Map();
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
610
|
+
// coordinators must be defined as error was undefined
|
|
611
|
+
for (const coordinator of coordinators) {
|
|
612
|
+
let coordinatorAggregate = coordinatorsMap.get(coordinator.nodeId);
|
|
613
|
+
if (!coordinatorAggregate) {
|
|
614
|
+
coordinatorAggregate = { host: coordinator.host, port: coordinator.port, groups: [] };
|
|
615
|
+
coordinatorsMap.set(coordinator.nodeId, coordinatorAggregate);
|
|
593
616
|
}
|
|
594
|
-
|
|
617
|
+
coordinatorAggregate.groups.push(coordinator.key);
|
|
595
618
|
}
|
|
596
|
-
runConcurrentCallbacks('Describing groups failed.', coordinatorsMap, (
|
|
597
|
-
this[
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
619
|
+
runConcurrentCallbacks('Describing groups failed.', coordinatorsMap.values(), (coordinator, concurrentCallback) => {
|
|
620
|
+
this[kPerformWithRetry]('describeGroupsOnCoordinator', retryCallback => {
|
|
621
|
+
this[kGetConnection](coordinator, (error, connection) => {
|
|
622
|
+
if (error) {
|
|
623
|
+
retryCallback(error);
|
|
624
|
+
return;
|
|
625
|
+
}
|
|
603
626
|
this[kGetApi]('DescribeGroups', (error, api) => {
|
|
604
627
|
if (error) {
|
|
605
628
|
retryCallback(error);
|
|
606
629
|
return;
|
|
607
630
|
}
|
|
608
|
-
api(connection, groups, options.includeAuthorizedOperations ?? false, retryCallback);
|
|
631
|
+
api(connection, coordinator.groups, options.includeAuthorizedOperations ?? false, retryCallback);
|
|
609
632
|
});
|
|
610
|
-
}
|
|
611
|
-
});
|
|
633
|
+
});
|
|
634
|
+
}, concurrentCallback, 0);
|
|
612
635
|
}, (error, results) => {
|
|
613
636
|
if (error) {
|
|
614
|
-
|
|
637
|
+
retryCallback(error);
|
|
615
638
|
return;
|
|
616
639
|
}
|
|
617
640
|
const groups = new Map();
|
|
@@ -619,7 +642,7 @@ export class Admin extends Base {
|
|
|
619
642
|
for (const raw of result.groups) {
|
|
620
643
|
const group = {
|
|
621
644
|
id: raw.groupId,
|
|
622
|
-
state: raw.groupState
|
|
645
|
+
state: raw.groupState,
|
|
623
646
|
protocolType: raw.protocolType,
|
|
624
647
|
protocol: raw.protocolData,
|
|
625
648
|
members: new Map(),
|
|
@@ -655,59 +678,58 @@ export class Admin extends Base {
|
|
|
655
678
|
groups.set(group.id, group);
|
|
656
679
|
}
|
|
657
680
|
}
|
|
658
|
-
|
|
681
|
+
retryCallback(null, groups);
|
|
659
682
|
});
|
|
660
683
|
});
|
|
661
|
-
});
|
|
684
|
+
}, callback, 0);
|
|
662
685
|
}
|
|
663
686
|
#deleteGroups(options, callback) {
|
|
664
|
-
this[
|
|
665
|
-
if (error) {
|
|
666
|
-
callback(error);
|
|
667
|
-
return;
|
|
668
|
-
}
|
|
687
|
+
this[kPerformWithRetry]('deleteGroups', retryCallback => {
|
|
669
688
|
this.#findCoordinator({ keyType: FindCoordinatorKeyTypes.GROUP, keys: options.groups }, (error, coordinators) => {
|
|
670
689
|
if (error) {
|
|
671
|
-
|
|
690
|
+
// FindCoordinator already retried some times so no retry again
|
|
691
|
+
callback(new MultipleErrors('Deleting groups failed.', error instanceof MultipleErrors ? error.errors : [error]));
|
|
672
692
|
return;
|
|
673
693
|
}
|
|
674
|
-
// Group the groups by coordinator
|
|
675
694
|
const coordinatorsMap = new Map();
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
695
|
+
// coordinators must be defined as error was undefined
|
|
696
|
+
for (const coordinator of coordinators) {
|
|
697
|
+
let coordinatorAggregate = coordinatorsMap.get(coordinator.nodeId);
|
|
698
|
+
if (!coordinatorAggregate) {
|
|
699
|
+
coordinatorAggregate = { host: coordinator.host, port: coordinator.port, groups: [] };
|
|
700
|
+
coordinatorsMap.set(coordinator.nodeId, coordinatorAggregate);
|
|
681
701
|
}
|
|
682
|
-
|
|
702
|
+
coordinatorAggregate.groups.push(coordinator.key);
|
|
683
703
|
}
|
|
684
|
-
runConcurrentCallbacks('Deleting groups failed.', coordinatorsMap, (
|
|
685
|
-
this[
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
704
|
+
runConcurrentCallbacks('Deleting groups failed.', coordinatorsMap.values(), (coordinator, concurrentCallback) => {
|
|
705
|
+
this[kPerformWithRetry]('deleteGroupsOnCoordinator', retryCallback => {
|
|
706
|
+
this[kGetConnection](coordinator, (error, connection) => {
|
|
707
|
+
if (error) {
|
|
708
|
+
retryCallback(error);
|
|
709
|
+
return;
|
|
710
|
+
}
|
|
691
711
|
this[kGetApi]('DeleteGroups', (error, api) => {
|
|
692
712
|
if (error) {
|
|
693
713
|
retryCallback(error);
|
|
694
714
|
return;
|
|
695
715
|
}
|
|
696
|
-
api(connection, groups, retryCallback);
|
|
716
|
+
api(connection, coordinator.groups, retryCallback);
|
|
697
717
|
});
|
|
698
|
-
}
|
|
699
|
-
});
|
|
700
|
-
},
|
|
718
|
+
});
|
|
719
|
+
}, concurrentCallback, 0);
|
|
720
|
+
}, retryCallback);
|
|
701
721
|
});
|
|
702
|
-
});
|
|
722
|
+
}, callback, 0);
|
|
703
723
|
}
|
|
704
724
|
#removeMembersFromConsumerGroup(options, callback) {
|
|
705
725
|
if (!options.members || options.members.length === 0) {
|
|
726
|
+
// Remove all members if none are specified
|
|
706
727
|
this.#describeGroups({ groups: [options.groupId] }, (error, groupsMap) => {
|
|
707
728
|
if (error) {
|
|
708
729
|
callback(new MultipleErrors('Removing members from consumer group failed.', [error]));
|
|
709
730
|
return;
|
|
710
731
|
}
|
|
732
|
+
// groupsMap must be defined as error was undefined
|
|
711
733
|
const group = groupsMap.get(options.groupId);
|
|
712
734
|
/* c8 ignore next 4 - Hard to test */
|
|
713
735
|
if (!group) {
|
|
@@ -724,61 +746,52 @@ export class Admin extends Base {
|
|
|
724
746
|
});
|
|
725
747
|
return;
|
|
726
748
|
}
|
|
727
|
-
this[
|
|
728
|
-
if (error) {
|
|
729
|
-
callback(error, undefined);
|
|
730
|
-
return;
|
|
731
|
-
}
|
|
749
|
+
this[kPerformWithRetry]('removeMembersFromConsumerGroup', retryCallback => {
|
|
732
750
|
this.#findCoordinator({ keyType: FindCoordinatorKeyTypes.GROUP, keys: [options.groupId] }, (error, coordinators) => {
|
|
733
751
|
if (error) {
|
|
734
|
-
|
|
752
|
+
// FindCoordinator already retried some times so no retry again
|
|
753
|
+
callback(new MultipleErrors('Removing members from consumer group failed.', error instanceof MultipleErrors ? error.errors : [error]));
|
|
735
754
|
return;
|
|
736
755
|
}
|
|
737
756
|
const coordinator = coordinators.find(c => c.key === options.groupId);
|
|
738
757
|
/* c8 ignore next 8 - Hard to test */
|
|
739
758
|
if (!coordinator) {
|
|
740
|
-
|
|
741
|
-
new Error(`No coordinator found for group ${options.groupId}`)
|
|
742
|
-
]));
|
|
743
|
-
return;
|
|
744
|
-
}
|
|
745
|
-
const broker = metadata.brokers.get(coordinator.nodeId);
|
|
746
|
-
/* c8 ignore next 8 - Hard to test */
|
|
747
|
-
if (!broker) {
|
|
748
|
-
callback(new MultipleErrors('Removing members from consumer group failed.', [
|
|
749
|
-
new Error(`Broker ${coordinator.nodeId} not found`)
|
|
750
|
-
]));
|
|
759
|
+
retryCallback(new Error('Group coordinator not found'));
|
|
751
760
|
return;
|
|
752
761
|
}
|
|
753
|
-
this[kGetConnection](
|
|
762
|
+
this[kGetConnection](coordinator, (error, connection) => {
|
|
754
763
|
if (error) {
|
|
755
|
-
|
|
764
|
+
retryCallback(error);
|
|
756
765
|
return;
|
|
757
766
|
}
|
|
758
|
-
this[
|
|
759
|
-
this[kGetApi]('LeaveGroup', (error, api) => {
|
|
760
|
-
if (error) {
|
|
761
|
-
retryCallback(error);
|
|
762
|
-
return;
|
|
763
|
-
}
|
|
764
|
-
/* c8 ignore next 5 - Hard to test */
|
|
765
|
-
const members = options.members.map(member => ({
|
|
766
|
-
memberId: typeof member === 'string' ? member : member.memberId,
|
|
767
|
-
groupInstanceId: null,
|
|
768
|
-
reason: typeof member === 'string' ? 'Not specified' : member.reason
|
|
769
|
-
}));
|
|
770
|
-
api(connection, options.groupId, members, retryCallback);
|
|
771
|
-
});
|
|
772
|
-
}, error => {
|
|
767
|
+
this[kGetApi]('LeaveGroup', (error, api) => {
|
|
773
768
|
if (error) {
|
|
774
|
-
|
|
769
|
+
retryCallback(error);
|
|
770
|
+
return;
|
|
771
|
+
}
|
|
772
|
+
/* c8 ignore next 5 - Hard to test */
|
|
773
|
+
const members = options.members.map(member => ({
|
|
774
|
+
memberId: typeof member === 'string' ? member : member.memberId,
|
|
775
|
+
groupInstanceId: null,
|
|
776
|
+
reason: typeof member === 'string' ? 'Not specified' : member.reason
|
|
777
|
+
}));
|
|
778
|
+
if (api.version >= 3) {
|
|
779
|
+
api(connection, options.groupId, members, retryCallback);
|
|
775
780
|
return;
|
|
776
781
|
}
|
|
777
|
-
|
|
778
|
-
|
|
782
|
+
runConcurrentCallbacks('Removing members from consumer group failed.', members, (member, concurrentCallback) => {
|
|
783
|
+
api(connection, options.groupId, [member], concurrentCallback);
|
|
784
|
+
}, error => retryCallback(error));
|
|
785
|
+
});
|
|
779
786
|
});
|
|
780
787
|
});
|
|
781
|
-
}
|
|
788
|
+
}, error => {
|
|
789
|
+
if (error) {
|
|
790
|
+
callback(new MultipleErrors('Removing members from consumer group failed.', [error]));
|
|
791
|
+
return;
|
|
792
|
+
}
|
|
793
|
+
callback(null);
|
|
794
|
+
}, 0);
|
|
782
795
|
}
|
|
783
796
|
#findCoordinator(options, callback) {
|
|
784
797
|
this[kPerformWithRetry]('findCoordinator', retryCallback => {
|
|
@@ -792,12 +805,33 @@ export class Admin extends Base {
|
|
|
792
805
|
retryCallback(error);
|
|
793
806
|
return;
|
|
794
807
|
}
|
|
795
|
-
api
|
|
808
|
+
if (api.version >= 4) {
|
|
809
|
+
api(connection, options.keyType, options.keys, retryCallback);
|
|
810
|
+
return;
|
|
811
|
+
}
|
|
812
|
+
runConcurrentCallbacks('Finding coordinator failed.', options.keys, (key, concurrentCallback) => {
|
|
813
|
+
api(connection, options.keyType, [key], (error, response) => {
|
|
814
|
+
if (response) {
|
|
815
|
+
response.coordinators[0].key = key;
|
|
816
|
+
}
|
|
817
|
+
concurrentCallback(error, response);
|
|
818
|
+
});
|
|
819
|
+
}, (error, responses) => {
|
|
820
|
+
if (error) {
|
|
821
|
+
retryCallback(error);
|
|
822
|
+
return;
|
|
823
|
+
}
|
|
824
|
+
retryCallback(null, {
|
|
825
|
+
// The caller controls how many keys are looked up, so reduce rather than spread.
|
|
826
|
+
throttleTimeMs: responses.reduce((max, response) => Math.max(max, response.throttleTimeMs), 0),
|
|
827
|
+
coordinators: responses.flatMap(response => response.coordinators)
|
|
828
|
+
});
|
|
829
|
+
});
|
|
796
830
|
});
|
|
797
831
|
});
|
|
798
832
|
}, (error, response) => {
|
|
799
833
|
if (error) {
|
|
800
|
-
callback(error);
|
|
834
|
+
callback(new MultipleErrors('Finding coordinator failed.', [error]));
|
|
801
835
|
return;
|
|
802
836
|
}
|
|
803
837
|
callback(null, response.coordinators.map(coordinator => ({
|
|
@@ -828,7 +862,7 @@ export class Admin extends Base {
|
|
|
828
862
|
callback(new MultipleErrors('Describing client quotas failed.', [error]));
|
|
829
863
|
return;
|
|
830
864
|
}
|
|
831
|
-
callback(null, response.entries);
|
|
865
|
+
callback(null, response.entries ?? []);
|
|
832
866
|
}, 0);
|
|
833
867
|
}
|
|
834
868
|
#alterClientQuotas(options, callback) {
|
|
@@ -855,19 +889,21 @@ export class Admin extends Base {
|
|
|
855
889
|
}, 0);
|
|
856
890
|
}
|
|
857
891
|
#describeLogDirs(options, callback) {
|
|
858
|
-
this[kMetadata]({ topics: [] }, (error, metadata) => {
|
|
892
|
+
this[kMetadata]({ topics: [], forceUpdate: true }, (error, metadata) => {
|
|
859
893
|
/* c8 ignore next 4 - Hard to test */
|
|
860
894
|
if (error) {
|
|
861
895
|
callback(error);
|
|
862
896
|
return;
|
|
863
897
|
}
|
|
864
|
-
runConcurrentCallbacks('Describing log dirs failed.',
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
898
|
+
runConcurrentCallbacks('Describing log dirs failed.',
|
|
899
|
+
// metadata must be defined as error was undefined
|
|
900
|
+
metadata.brokers, ([id, broker], concurrentCallback) => {
|
|
901
|
+
this[kPerformWithRetry]('describeLogDirs', retryCallback => {
|
|
902
|
+
this[kGetConnection](broker, (error, connection) => {
|
|
903
|
+
if (error) {
|
|
904
|
+
retryCallback(error);
|
|
905
|
+
return;
|
|
906
|
+
}
|
|
871
907
|
this[kGetApi]('DescribeLogDirs', (error, api) => {
|
|
872
908
|
if (error) {
|
|
873
909
|
retryCallback(error);
|
|
@@ -875,82 +911,114 @@ export class Admin extends Base {
|
|
|
875
911
|
}
|
|
876
912
|
api(connection, options.topics, retryCallback);
|
|
877
913
|
});
|
|
878
|
-
}
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
})
|
|
893
|
-
}
|
|
894
|
-
});
|
|
914
|
+
});
|
|
915
|
+
}, (error, response) => {
|
|
916
|
+
if (error) {
|
|
917
|
+
concurrentCallback(error);
|
|
918
|
+
return;
|
|
919
|
+
}
|
|
920
|
+
concurrentCallback(null, {
|
|
921
|
+
broker: id,
|
|
922
|
+
throttleTimeMs: response.throttleTimeMs,
|
|
923
|
+
results: response.results.map(result => ({
|
|
924
|
+
logDir: result.logDir,
|
|
925
|
+
topics: result.topics,
|
|
926
|
+
totalBytes: result.totalBytes,
|
|
927
|
+
usableBytes: result.usableBytes
|
|
928
|
+
}))
|
|
929
|
+
});
|
|
930
|
+
}, 0);
|
|
895
931
|
}, callback);
|
|
896
932
|
});
|
|
897
933
|
}
|
|
898
934
|
#listConsumerGroupOffsets(options, callback) {
|
|
899
|
-
this[
|
|
900
|
-
if (error) {
|
|
901
|
-
callback(error);
|
|
902
|
-
return;
|
|
903
|
-
}
|
|
935
|
+
this[kPerformWithRetry]('listConsumerGroupOffsets', retryCallback => {
|
|
904
936
|
/* c8 ignore next - Hard to test */
|
|
905
937
|
const groupIds = options.groups.map(group => (typeof group === 'string' ? group : group.groupId));
|
|
906
938
|
this.#findCoordinator({ keyType: FindCoordinatorKeyTypes.GROUP, keys: groupIds }, (error, coordinators) => {
|
|
907
939
|
if (error) {
|
|
908
|
-
|
|
940
|
+
// FindCoordinator already retried some times so no retry again
|
|
941
|
+
callback(new MultipleErrors('Listing consumer group offsets failed.', error instanceof MultipleErrors ? error.errors : [error]));
|
|
909
942
|
return;
|
|
910
943
|
}
|
|
911
944
|
const coordinatorsMap = new Map();
|
|
912
|
-
for (const
|
|
945
|
+
for (const coordinator of coordinators) {
|
|
913
946
|
const groupRequest = {
|
|
914
|
-
groupId,
|
|
947
|
+
groupId: coordinator.key,
|
|
915
948
|
memberId: null,
|
|
916
949
|
memberEpoch: -1
|
|
917
950
|
};
|
|
918
951
|
for (const group of options.groups) {
|
|
919
|
-
if (typeof group !== 'string' &&
|
|
952
|
+
if (typeof group !== 'string' &&
|
|
953
|
+
group.groupId === coordinator.key &&
|
|
954
|
+
!!group.topics &&
|
|
955
|
+
group.topics.length > 0) {
|
|
920
956
|
groupRequest.topics = group.topics;
|
|
921
957
|
break;
|
|
922
958
|
}
|
|
923
959
|
}
|
|
924
|
-
let
|
|
925
|
-
if (!
|
|
926
|
-
|
|
927
|
-
coordinatorsMap.set(
|
|
960
|
+
let offsetFetchRequestGroups = coordinatorsMap.get(coordinator.nodeId);
|
|
961
|
+
if (!offsetFetchRequestGroups) {
|
|
962
|
+
offsetFetchRequestGroups = { coordinator, groupRequests: [] };
|
|
963
|
+
coordinatorsMap.set(coordinator.nodeId, offsetFetchRequestGroups);
|
|
928
964
|
}
|
|
929
|
-
|
|
965
|
+
offsetFetchRequestGroups.groupRequests.push(groupRequest);
|
|
930
966
|
}
|
|
931
|
-
runConcurrentCallbacks('Listing consumer group offsets failed.', coordinatorsMap, (
|
|
932
|
-
this[
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
967
|
+
runConcurrentCallbacks('Listing consumer group offsets failed.', coordinatorsMap.values(), ({ coordinator, groupRequests }, concurrentCallback) => {
|
|
968
|
+
this[kPerformWithRetry]('offsetFetch', retryCallback => {
|
|
969
|
+
this[kGetConnection](coordinator, (error, connection) => {
|
|
970
|
+
if (error) {
|
|
971
|
+
retryCallback(error);
|
|
972
|
+
return;
|
|
973
|
+
}
|
|
938
974
|
this[kGetApi]('OffsetFetch', (error, api) => {
|
|
939
975
|
if (error) {
|
|
940
976
|
retryCallback(error);
|
|
941
977
|
return;
|
|
942
978
|
}
|
|
943
|
-
|
|
944
|
-
|
|
979
|
+
if (api.version >= 8) {
|
|
980
|
+
api(connection, groupRequests, options.requireStable ?? false, retryCallback);
|
|
981
|
+
return;
|
|
982
|
+
}
|
|
983
|
+
runConcurrentCallbacks('Listing consumer group offsets failed.', groupRequests, (groupRequest, groupCallback) => {
|
|
984
|
+
api(connection, [groupRequest], options.requireStable ?? false, (error, response) => {
|
|
985
|
+
if (error) {
|
|
986
|
+
groupCallback(error);
|
|
987
|
+
return;
|
|
988
|
+
}
|
|
989
|
+
const legacyResponse = response;
|
|
990
|
+
groupCallback(null, {
|
|
991
|
+
throttleTimeMs: legacyResponse.throttleTimeMs,
|
|
992
|
+
groups: [
|
|
993
|
+
{
|
|
994
|
+
groupId: groupRequest.groupId,
|
|
995
|
+
topics: legacyResponse.topics,
|
|
996
|
+
errorCode: legacyResponse.errorCode
|
|
997
|
+
}
|
|
998
|
+
]
|
|
999
|
+
});
|
|
1000
|
+
});
|
|
1001
|
+
}, (error, responses) => {
|
|
1002
|
+
if (error) {
|
|
1003
|
+
retryCallback(error);
|
|
1004
|
+
return;
|
|
1005
|
+
}
|
|
1006
|
+
retryCallback(null, {
|
|
1007
|
+
throttleTimeMs: responses.reduce((max, response) => Math.max(max, response.throttleTimeMs), 0),
|
|
1008
|
+
groups: responses.flatMap(response => response.groups)
|
|
1009
|
+
});
|
|
1010
|
+
});
|
|
945
1011
|
});
|
|
946
|
-
}
|
|
947
|
-
});
|
|
1012
|
+
});
|
|
1013
|
+
}, concurrentCallback, 0);
|
|
948
1014
|
}, (error, responses) => {
|
|
949
1015
|
if (error) {
|
|
950
|
-
|
|
1016
|
+
retryCallback(error);
|
|
951
1017
|
return;
|
|
952
1018
|
}
|
|
953
|
-
|
|
1019
|
+
retryCallback(null,
|
|
1020
|
+
// responses must be defined as error was undefined
|
|
1021
|
+
responses.flatMap(r => r.groups.map(group => ({
|
|
954
1022
|
groupId: group.groupId,
|
|
955
1023
|
topics: group.topics.map(topic => ({
|
|
956
1024
|
name: topic.name,
|
|
@@ -964,125 +1032,101 @@ export class Admin extends Base {
|
|
|
964
1032
|
}))));
|
|
965
1033
|
});
|
|
966
1034
|
});
|
|
967
|
-
});
|
|
1035
|
+
}, callback, 0);
|
|
968
1036
|
}
|
|
969
1037
|
#alterConsumerGroupOffsets(options, callback) {
|
|
970
|
-
this[
|
|
971
|
-
if (error) {
|
|
972
|
-
callback(error, undefined);
|
|
973
|
-
return;
|
|
974
|
-
}
|
|
1038
|
+
this[kPerformWithRetry]('alterConsumerGroupOffsets', retryCallback => {
|
|
975
1039
|
this.#findCoordinator({ keyType: FindCoordinatorKeyTypes.GROUP, keys: [options.groupId] }, (error, coordinators) => {
|
|
976
1040
|
if (error) {
|
|
977
|
-
|
|
1041
|
+
// FindCoordinator already retried some times so no retry again
|
|
1042
|
+
callback(new MultipleErrors('Altering consumer group offsets failed.', error instanceof MultipleErrors ? error.errors : [error]));
|
|
978
1043
|
return;
|
|
979
1044
|
}
|
|
980
1045
|
const coordinator = coordinators.find(c => c.key === options.groupId);
|
|
981
1046
|
/* c8 ignore next 9 - Hard to test */
|
|
982
1047
|
if (!coordinator) {
|
|
983
|
-
|
|
984
|
-
new Error(`No coordinator found for group ${options.groupId}`)
|
|
985
|
-
]));
|
|
1048
|
+
retryCallback(new Error('Group coordinator not found'));
|
|
986
1049
|
return;
|
|
987
1050
|
}
|
|
988
|
-
|
|
989
|
-
/* c8 ignore next 9 - Hard to test */
|
|
990
|
-
if (!broker) {
|
|
991
|
-
callback(new MultipleErrors('Altering consumer group offsets failed.', [
|
|
992
|
-
new Error(`Broker ${coordinator.nodeId} not found`)
|
|
993
|
-
]));
|
|
994
|
-
return;
|
|
995
|
-
}
|
|
996
|
-
this[kGetConnection](broker, (error, connection) => {
|
|
1051
|
+
this[kGetConnection](coordinator, (error, connection) => {
|
|
997
1052
|
if (error) {
|
|
998
|
-
|
|
1053
|
+
retryCallback(error);
|
|
999
1054
|
return;
|
|
1000
1055
|
}
|
|
1001
|
-
this[
|
|
1002
|
-
this[kGetApi]('OffsetCommit', (error, api) => {
|
|
1003
|
-
if (error) {
|
|
1004
|
-
retryCallback(error);
|
|
1005
|
-
return;
|
|
1006
|
-
}
|
|
1007
|
-
const topics = [];
|
|
1008
|
-
for (const topic of options.topics) {
|
|
1009
|
-
const partitions = topic.partitionOffsets.map(p => ({
|
|
1010
|
-
partitionIndex: p.partition,
|
|
1011
|
-
committedOffset: p.offset,
|
|
1012
|
-
committedLeaderEpoch: -1,
|
|
1013
|
-
committedMetadata: null
|
|
1014
|
-
}));
|
|
1015
|
-
topics.push({ name: topic.name, partitions });
|
|
1016
|
-
}
|
|
1017
|
-
api(connection, options.groupId, -1, '', null, topics, retryCallback);
|
|
1018
|
-
});
|
|
1019
|
-
}, error => {
|
|
1056
|
+
this[kGetApi]('OffsetCommit', (error, api) => {
|
|
1020
1057
|
if (error) {
|
|
1021
|
-
|
|
1058
|
+
retryCallback(error);
|
|
1022
1059
|
return;
|
|
1023
1060
|
}
|
|
1024
|
-
|
|
1025
|
-
|
|
1061
|
+
const topics = [];
|
|
1062
|
+
for (const topic of options.topics) {
|
|
1063
|
+
const partitions = topic.partitionOffsets.map(p => ({
|
|
1064
|
+
partitionIndex: p.partition,
|
|
1065
|
+
committedOffset: p.offset,
|
|
1066
|
+
committedLeaderEpoch: -1,
|
|
1067
|
+
committedMetadata: null
|
|
1068
|
+
}));
|
|
1069
|
+
topics.push({ name: topic.name, partitions });
|
|
1070
|
+
}
|
|
1071
|
+
api(connection, options.groupId, -1, '', null, topics, retryCallback);
|
|
1072
|
+
});
|
|
1026
1073
|
});
|
|
1027
1074
|
});
|
|
1028
|
-
}
|
|
1029
|
-
}
|
|
1030
|
-
#deleteConsumerGroupOffsets(options, callback) {
|
|
1031
|
-
this[kMetadata]({ topics: [] }, (error, metadata) => {
|
|
1075
|
+
}, error => {
|
|
1032
1076
|
if (error) {
|
|
1033
|
-
callback(error);
|
|
1077
|
+
callback(new MultipleErrors('Altering consumer group offsets failed.', [error]));
|
|
1034
1078
|
return;
|
|
1035
1079
|
}
|
|
1080
|
+
callback(null);
|
|
1081
|
+
}, 0);
|
|
1082
|
+
}
|
|
1083
|
+
#deleteConsumerGroupOffsets(options, callback) {
|
|
1084
|
+
this[kPerformWithRetry]('deleteConsumerGroupOffsets', retryCallback => {
|
|
1036
1085
|
this.#findCoordinator({ keyType: FindCoordinatorKeyTypes.GROUP, keys: [options.groupId] }, (error, coordinators) => {
|
|
1037
1086
|
if (error) {
|
|
1038
|
-
|
|
1087
|
+
// FindCoordinator already retried some times so no retry again
|
|
1088
|
+
callback(new MultipleErrors('Deleting consumer group offsets failed.', error instanceof MultipleErrors ? error.errors : [error]));
|
|
1039
1089
|
return;
|
|
1040
1090
|
}
|
|
1041
1091
|
const coordinator = coordinators.find(c => c.key === options.groupId);
|
|
1042
1092
|
/* c8 ignore next 9 - Hard to test */
|
|
1043
1093
|
if (!coordinator) {
|
|
1044
|
-
|
|
1045
|
-
new Error(`No coordinator found for group ${options.groupId}`)
|
|
1046
|
-
]));
|
|
1094
|
+
retryCallback(new Error('Group coordinator not found'));
|
|
1047
1095
|
return;
|
|
1048
1096
|
}
|
|
1049
|
-
|
|
1050
|
-
/* c8 ignore next 9 - Hard to test */
|
|
1051
|
-
if (!broker) {
|
|
1052
|
-
callback(new MultipleErrors('Deleting consumer group offsets failed.', [
|
|
1053
|
-
new Error(`Broker ${coordinator.nodeId} not found`)
|
|
1054
|
-
]));
|
|
1055
|
-
return;
|
|
1056
|
-
}
|
|
1057
|
-
this[kGetConnection](broker, (error, connection) => {
|
|
1097
|
+
this[kGetConnection](coordinator, (error, connection) => {
|
|
1058
1098
|
if (error) {
|
|
1059
|
-
|
|
1099
|
+
retryCallback(error);
|
|
1060
1100
|
return;
|
|
1061
1101
|
}
|
|
1062
|
-
this[
|
|
1063
|
-
|
|
1102
|
+
this[kGetApi]('OffsetDelete', (error, api) => {
|
|
1103
|
+
if (error) {
|
|
1104
|
+
retryCallback(error);
|
|
1105
|
+
return;
|
|
1106
|
+
}
|
|
1107
|
+
api(connection, options.groupId, options.topics.map(t => ({
|
|
1108
|
+
name: t.name,
|
|
1109
|
+
partitions: t.partitionIndexes.map(p => ({ partitionIndex: p }))
|
|
1110
|
+
})), (error, response) => {
|
|
1064
1111
|
if (error) {
|
|
1065
1112
|
retryCallback(error);
|
|
1066
1113
|
return;
|
|
1067
1114
|
}
|
|
1068
|
-
|
|
1069
|
-
name:
|
|
1070
|
-
|
|
1071
|
-
}))
|
|
1115
|
+
retryCallback(null, response.topics.map(topic => ({
|
|
1116
|
+
name: topic.name,
|
|
1117
|
+
partitionIndexes: topic.partitions.map(p => p.partitionIndex)
|
|
1118
|
+
})));
|
|
1072
1119
|
});
|
|
1073
|
-
}
|
|
1074
|
-
if (error) {
|
|
1075
|
-
callback(new MultipleErrors('Deleting consumer group offsets failed.', [error]));
|
|
1076
|
-
return;
|
|
1077
|
-
}
|
|
1078
|
-
callback(null, response.topics.map(topic => ({
|
|
1079
|
-
name: topic.name,
|
|
1080
|
-
partitionIndexes: topic.partitions.map(p => p.partitionIndex)
|
|
1081
|
-
})));
|
|
1082
|
-
}, 0);
|
|
1120
|
+
});
|
|
1083
1121
|
});
|
|
1084
1122
|
});
|
|
1085
|
-
})
|
|
1123
|
+
}, (error, results) => {
|
|
1124
|
+
if (error) {
|
|
1125
|
+
callback(new MultipleErrors('Deleting consumer group offsets failed.', [error]));
|
|
1126
|
+
return;
|
|
1127
|
+
}
|
|
1128
|
+
callback(null, results);
|
|
1129
|
+
}, 0);
|
|
1086
1130
|
}
|
|
1087
1131
|
#getConfigRequestsDistributedToBrokers(resources) {
|
|
1088
1132
|
const brokerConfigResourceMap = new Map();
|
|
@@ -1108,7 +1152,7 @@ export class Admin extends Base {
|
|
|
1108
1152
|
this[kGetBootstrapConnection](callback);
|
|
1109
1153
|
return;
|
|
1110
1154
|
}
|
|
1111
|
-
this[kMetadata]({ topics: [] }, (error, metadata) => {
|
|
1155
|
+
this[kMetadata]({ topics: [], forceUpdate: true }, (error, metadata) => {
|
|
1112
1156
|
/* c8 ignore next 4 - Hard to test */
|
|
1113
1157
|
if (error) {
|
|
1114
1158
|
callback(error);
|
|
@@ -1125,13 +1169,7 @@ export class Admin extends Base {
|
|
|
1125
1169
|
}
|
|
1126
1170
|
#describeConfigs(options, callback) {
|
|
1127
1171
|
runConcurrentCallbacks('Describing configs failed.', this.#getConfigRequestsDistributedToBrokers(options.resources), ([brokerId, resources], concurrentCallback) => {
|
|
1128
|
-
this.#describeConfigsOnBroker({ ...options, resources }, brokerId,
|
|
1129
|
-
if (error) {
|
|
1130
|
-
concurrentCallback(error);
|
|
1131
|
-
return;
|
|
1132
|
-
}
|
|
1133
|
-
concurrentCallback(null, response);
|
|
1134
|
-
});
|
|
1172
|
+
this.#describeConfigsOnBroker({ ...options, resources }, brokerId, concurrentCallback);
|
|
1135
1173
|
}, (error, results) => {
|
|
1136
1174
|
callback(error, results?.flat());
|
|
1137
1175
|
});
|
|
@@ -1307,154 +1345,166 @@ export class Admin extends Base {
|
|
|
1307
1345
|
}, 0);
|
|
1308
1346
|
}
|
|
1309
1347
|
#deleteRecords(options, callback) {
|
|
1310
|
-
this[
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
for (const topic of options.topics) {
|
|
1317
|
-
for (const partition of topic.partitions) {
|
|
1318
|
-
const { leader } = metadata.topics.get(topic.name).partitions[partition.partition];
|
|
1319
|
-
let leaderRequests = requestsByLeader.get(leader);
|
|
1320
|
-
if (!leaderRequests) {
|
|
1321
|
-
leaderRequests = new Map();
|
|
1322
|
-
requestsByLeader.set(leader, leaderRequests);
|
|
1323
|
-
}
|
|
1324
|
-
let topicRequest = leaderRequests.get(topic.name);
|
|
1325
|
-
if (!topicRequest) {
|
|
1326
|
-
topicRequest = { name: topic.name, partitions: [] };
|
|
1327
|
-
leaderRequests.set(topic.name, topicRequest);
|
|
1328
|
-
}
|
|
1329
|
-
topicRequest.partitions.push({
|
|
1330
|
-
partitionIndex: partition.partition,
|
|
1331
|
-
offset: partition.offset
|
|
1332
|
-
});
|
|
1348
|
+
this[kPerformWithRetry]('deleteRecords', retryCallback => {
|
|
1349
|
+
this[kMetadata]({ topics: options.topics.map(topic => topic.name), forceUpdate: true }, (error, metadata) => {
|
|
1350
|
+
if (error) {
|
|
1351
|
+
// Metadata request already retried some times so no retry again
|
|
1352
|
+
callback(error);
|
|
1353
|
+
return;
|
|
1333
1354
|
}
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1355
|
+
const requests = new Map();
|
|
1356
|
+
for (const topic of options.topics) {
|
|
1357
|
+
for (const partition of topic.partitions) {
|
|
1358
|
+
// metadata!.topics.get(topic.name) must be defined as the metadata request was successful
|
|
1359
|
+
const topicData = metadata.topics.get(topic.name);
|
|
1360
|
+
const targetPartitionData = topicData.partitions[partition.partition];
|
|
1361
|
+
/* c8 ignore next 4 - Hard to test */
|
|
1362
|
+
if (!targetPartitionData) {
|
|
1363
|
+
retryCallback(new UserError('Unknown partition.'));
|
|
1364
|
+
return;
|
|
1365
|
+
}
|
|
1366
|
+
const broker = metadata.brokers.get(targetPartitionData.leader);
|
|
1367
|
+
let leaderRequests = requests.get(broker);
|
|
1368
|
+
if (!leaderRequests) {
|
|
1369
|
+
leaderRequests = [];
|
|
1370
|
+
requests.set(broker, leaderRequests);
|
|
1371
|
+
}
|
|
1372
|
+
let topicRequest = leaderRequests.find(tr => tr.name === topic.name);
|
|
1373
|
+
if (!topicRequest) {
|
|
1374
|
+
topicRequest = { name: topic.name, partitions: [] };
|
|
1375
|
+
leaderRequests.push(topicRequest);
|
|
1376
|
+
}
|
|
1377
|
+
topicRequest.partitions.push({
|
|
1378
|
+
partitionIndex: partition.partition,
|
|
1379
|
+
offset: partition.offset
|
|
1380
|
+
});
|
|
1344
1381
|
}
|
|
1345
|
-
|
|
1346
|
-
|
|
1382
|
+
}
|
|
1383
|
+
runConcurrentCallbacks('Deleting records failed.', requests, ([leader, requests], concurrentCallback) => {
|
|
1384
|
+
this[kPerformWithRetry]('deleteRecordsOnLeader', retryCallback => {
|
|
1385
|
+
this[kGetConnection](leader, (error, connection) => {
|
|
1347
1386
|
if (error) {
|
|
1348
1387
|
retryCallback(error);
|
|
1349
1388
|
return;
|
|
1350
1389
|
}
|
|
1351
|
-
|
|
1390
|
+
this[kGetApi]('DeleteRecords', (error, api) => {
|
|
1391
|
+
if (error) {
|
|
1392
|
+
retryCallback(error);
|
|
1393
|
+
return;
|
|
1394
|
+
}
|
|
1395
|
+
api(connection, requests, this[kOptions].timeout, retryCallback);
|
|
1396
|
+
});
|
|
1352
1397
|
});
|
|
1353
1398
|
}, concurrentCallback, 0);
|
|
1399
|
+
}, (error, responses) => {
|
|
1400
|
+
if (error) {
|
|
1401
|
+
// Do not retry failed deletion requests
|
|
1402
|
+
callback(error);
|
|
1403
|
+
return;
|
|
1404
|
+
}
|
|
1405
|
+
const deletedRecordsByTopic = new Map();
|
|
1406
|
+
for (const response of responses) {
|
|
1407
|
+
for (const topic of response.topics) {
|
|
1408
|
+
let topicDeletedRecords = deletedRecordsByTopic.get(topic.name);
|
|
1409
|
+
if (!topicDeletedRecords) {
|
|
1410
|
+
topicDeletedRecords = { name: topic.name, partitions: [] };
|
|
1411
|
+
deletedRecordsByTopic.set(topic.name, topicDeletedRecords);
|
|
1412
|
+
}
|
|
1413
|
+
for (const partition of topic.partitions) {
|
|
1414
|
+
topicDeletedRecords.partitions.push({
|
|
1415
|
+
partition: partition.partitionIndex,
|
|
1416
|
+
lowWatermark: partition.lowWatermark
|
|
1417
|
+
});
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
}
|
|
1421
|
+
retryCallback(null, Array.from(deletedRecordsByTopic.values()));
|
|
1354
1422
|
});
|
|
1355
|
-
}
|
|
1423
|
+
});
|
|
1424
|
+
}, callback, 0);
|
|
1425
|
+
}
|
|
1426
|
+
#listOffsets(options, callback) {
|
|
1427
|
+
this[kPerformWithRetry]('listOffsets', retryCallback => {
|
|
1428
|
+
this[kMetadata]({ topics: options.topics.map(topic => topic.name), forceUpdate: true }, (error, metadata) => {
|
|
1356
1429
|
if (error) {
|
|
1430
|
+
// Metadata request already retried some times so no retry again
|
|
1357
1431
|
callback(error);
|
|
1358
1432
|
return;
|
|
1359
1433
|
}
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1434
|
+
// metadata must be defined at this point
|
|
1435
|
+
const { topics, brokers } = metadata;
|
|
1436
|
+
const requests = new Map();
|
|
1437
|
+
for (const topic of options.topics) {
|
|
1438
|
+
for (const partition of topic.partitions) {
|
|
1439
|
+
// topics.get(topic.name) must be defined as the metadata request was successful
|
|
1440
|
+
const topicData = topics.get(topic.name);
|
|
1441
|
+
const targetPartitionData = topicData.partitions[partition.partitionIndex];
|
|
1442
|
+
/* c8 ignore next 4 - Hard to test */
|
|
1443
|
+
if (!targetPartitionData) {
|
|
1444
|
+
retryCallback(new UserError('Unknown partition.'));
|
|
1445
|
+
return;
|
|
1367
1446
|
}
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1447
|
+
const broker = brokers.get(targetPartitionData.leader);
|
|
1448
|
+
let leaderRequests = requests.get(broker);
|
|
1449
|
+
if (!leaderRequests) {
|
|
1450
|
+
leaderRequests = [];
|
|
1451
|
+
requests.set(broker, leaderRequests);
|
|
1373
1452
|
}
|
|
1453
|
+
let topicRequest = leaderRequests.find(t => t.name === topic.name);
|
|
1454
|
+
if (!topicRequest) {
|
|
1455
|
+
topicRequest = { name: topic.name, partitions: [] };
|
|
1456
|
+
leaderRequests.push(topicRequest);
|
|
1457
|
+
}
|
|
1458
|
+
topicRequest.partitions.push({
|
|
1459
|
+
partitionIndex: partition.partitionIndex,
|
|
1460
|
+
currentLeaderEpoch: targetPartitionData.leaderEpoch,
|
|
1461
|
+
/* c8 ignore next - Hard to test */
|
|
1462
|
+
timestamp: partition.timestamp ?? -1n
|
|
1463
|
+
});
|
|
1374
1464
|
}
|
|
1375
1465
|
}
|
|
1376
|
-
|
|
1377
|
-
});
|
|
1378
|
-
});
|
|
1379
|
-
}
|
|
1380
|
-
#listOffsets(options, callback) {
|
|
1381
|
-
this[kMetadata]({ topics: options.topics.map(topic => topic.name) }, (error, metadata) => {
|
|
1382
|
-
if (error) {
|
|
1383
|
-
callback(error);
|
|
1384
|
-
return;
|
|
1385
|
-
}
|
|
1386
|
-
// metadata must be defined at this point
|
|
1387
|
-
const { topics, brokers } = metadata;
|
|
1388
|
-
const requests = new Map();
|
|
1389
|
-
for (const topic of options.topics) {
|
|
1390
|
-
for (const partition of topic.partitions) {
|
|
1391
|
-
// topics.get(topic.name) must be defined as the metadata request was successful
|
|
1392
|
-
const topicData = topics.get(topic.name);
|
|
1393
|
-
const targetPartitionData = topicData.partitions[partition.partitionIndex];
|
|
1394
|
-
/* c8 ignore next 4 - Hard to test */
|
|
1395
|
-
if (!targetPartitionData) {
|
|
1396
|
-
callback(new UserError(`Unknown partition ${partition.partitionIndex} for topic ${topic.name}.`));
|
|
1397
|
-
return;
|
|
1398
|
-
}
|
|
1399
|
-
let leaderRequests = requests.get(targetPartitionData.leader);
|
|
1400
|
-
if (!leaderRequests) {
|
|
1401
|
-
leaderRequests = [];
|
|
1402
|
-
requests.set(targetPartitionData.leader, leaderRequests);
|
|
1403
|
-
}
|
|
1404
|
-
let topicRequest = leaderRequests.find(t => t.name === topic.name);
|
|
1405
|
-
if (!topicRequest) {
|
|
1406
|
-
topicRequest = { name: topic.name, partitions: [] };
|
|
1407
|
-
leaderRequests.push(topicRequest);
|
|
1408
|
-
}
|
|
1409
|
-
topicRequest.partitions.push({
|
|
1410
|
-
partitionIndex: partition.partitionIndex,
|
|
1411
|
-
currentLeaderEpoch: targetPartitionData.leaderEpoch,
|
|
1412
|
-
/* c8 ignore next - Hard to test */
|
|
1413
|
-
timestamp: partition.timestamp ?? -1n
|
|
1414
|
-
});
|
|
1415
|
-
}
|
|
1416
|
-
}
|
|
1417
|
-
runConcurrentCallbacks('Listing offsets failed.', requests, ([leader, requests], concurrentCallback) => {
|
|
1418
|
-
this[kGetConnection](brokers.get(leader), (error, connection) => {
|
|
1419
|
-
if (error) {
|
|
1420
|
-
concurrentCallback(error);
|
|
1421
|
-
return;
|
|
1422
|
-
}
|
|
1466
|
+
runConcurrentCallbacks('Listing offsets failed.', requests, ([leader, requests], concurrentCallback) => {
|
|
1423
1467
|
this[kPerformWithRetry]('listOffsets', retryCallback => {
|
|
1424
|
-
this[
|
|
1468
|
+
this[kGetConnection](leader, (error, connection) => {
|
|
1425
1469
|
if (error) {
|
|
1426
1470
|
retryCallback(error);
|
|
1427
1471
|
return;
|
|
1428
1472
|
}
|
|
1429
|
-
|
|
1473
|
+
this[kGetApi]('ListOffsets', (error, api) => {
|
|
1474
|
+
if (error) {
|
|
1475
|
+
retryCallback(error);
|
|
1476
|
+
return;
|
|
1477
|
+
}
|
|
1478
|
+
api(connection, -1, options.isolationLevel ?? FetchIsolationLevels.READ_UNCOMMITTED, requests, retryCallback);
|
|
1479
|
+
});
|
|
1430
1480
|
});
|
|
1431
1481
|
}, concurrentCallback, 0);
|
|
1432
|
-
})
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
}
|
|
1482
|
+
}, (error, responses) => {
|
|
1483
|
+
if (error) {
|
|
1484
|
+
retryCallback(error);
|
|
1485
|
+
return;
|
|
1486
|
+
}
|
|
1487
|
+
const ret = [];
|
|
1488
|
+
for (const response of responses) {
|
|
1489
|
+
for (const topic of response.topics) {
|
|
1490
|
+
let topicOffsets = ret.find(t => t.name === topic.name);
|
|
1491
|
+
if (!topicOffsets) {
|
|
1492
|
+
topicOffsets = { name: topic.name, partitions: [] };
|
|
1493
|
+
ret.push(topicOffsets);
|
|
1494
|
+
}
|
|
1495
|
+
for (const partition of topic.partitions) {
|
|
1496
|
+
topicOffsets.partitions.push({
|
|
1497
|
+
offset: partition.offset,
|
|
1498
|
+
timestamp: partition.timestamp,
|
|
1499
|
+
partitionIndex: partition.partitionIndex,
|
|
1500
|
+
leaderEpoch: partition.leaderEpoch
|
|
1501
|
+
});
|
|
1502
|
+
}
|
|
1453
1503
|
}
|
|
1454
1504
|
}
|
|
1455
|
-
|
|
1456
|
-
|
|
1505
|
+
retryCallback(null, ret);
|
|
1506
|
+
});
|
|
1457
1507
|
});
|
|
1458
|
-
});
|
|
1508
|
+
}, callback, 0);
|
|
1459
1509
|
}
|
|
1460
1510
|
}
|