-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancement/event based form integration #251
Merged
Merged
Changes from 29 commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
f1cbf1a
feat: add voting options in event based vote function
JosephRana11 88639a0
chore: add event type options to voting cron params meta
JosephRana11 dee4c69
chore: update form validation function
JosephRana11 22ff4c8
chore: remove log function
JosephRana11 4e677a5
Merge remote-tracking branch 'origin/dev' into enhancment/event-votin…
JosephRana11 09dd9dc
Add vote options in agent-node
Sital999 2394685
fix: Support voting option for all trigger types
Sital999 79e01dc
Add EventTriggerHandler class
Sital999 22535ab
Add util fn for bech32 conversion
Sital999 0873f3f
Add util fn for eventHandler
Sital999 19b154d
Support advance event trigger filter
mesudip c3738c4
Update operation for buffer type to support any type
Sital999 f1a136c
chore : add event trigger interface
JosephRana11 ebbce27
feat: add event trigger tab
JosephRana11 3f4a15f
chore: reorganize function form components
JosephRana11 3913aee
chore: fix build issues / lint
JosephRana11 1e2ac33
chore: handle event trigger post req
JosephRana11 67a4966
chore: persist event trigger config between trigger toggle
JosephRana11 b22b19c
feat: add event trigger edit function
JosephRana11 dd4adf1
chore: handle event trigger post req
JosephRana11 e599e6f
feat: handle event trigger edit for agent function content
JosephRana11 834c977
feat: add custom editor
JosephRana11 30a63c6
feat: add new event trigger model
JosephRana11 ff6b504
Make eventTriggerDto optional
Sital999 5c57ec2
Enhancement: Add support for output property as event filter
Sital999 25fa716
enhancement: Add support for libcardano txSchema for filterType
Sital999 d837a50
enhancement: Add customCombox for search field
Sital999 751b043
Enhancement: Add Switch btn for different UI to display event-filter
4806764
fix: Add support for deleting eventFilter
ec2f921
enhacement: Add support for contains operator
d981cc0
enhacement: Refactor EventTab component
ce95299
enhacement:Add event context for each event-based fn invocation
86a47ee
fix: Add proper err Msg and add debounce in input field
5745a4f
enhancement: Add support for 'exists' operator
Sital999 0222fd8
feat: Add support for auto fill of params for event-filter
Sital999 cc44d92
feat: Add kafka health check in manager
Sital999 34cdd46
feat: Add health endpoint for different services
Sital999 c5ae5a3
fix: Update prettier.json and fix PR changes
Sital999 a3725a0
fix: Add support for `Address` and `Value`
Sital999 ebe865c
fix: Resolve merge conflict
Sital999 04945b9
fix: Add index of filtered proposals for voting
Sital999 df61228
fix: Update libcardano library
Sital999 d651a8c
fix: Add voting options
Sital999 c54c14c
fix: Support voting options for event type
Sital999 0fde493
fix: Add latest libcardano version in node to support filter type
Sital999 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Router, Request, Response } from 'express' | ||
import { handlerWrapper } from '../utils/asyncWrapper' | ||
import { checkKafkaStatus } from '../service/healthCheck/kafka' | ||
|
||
const router = Router() | ||
|
||
function healthCheck(req: Request, res: Response) { | ||
checkKafkaStatus() | ||
.then((a) => console.log('Success : ', a)) | ||
.catch((err) => console.log('Error: ', err)) | ||
return res.status(200).send({ Msg: 'OK ' }) | ||
} | ||
|
||
router.get('/', handlerWrapper(healthCheck)) | ||
|
||
export default router |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { kafka, topicList } from '../Listeners/KafkaMessageConsumer' | ||
|
||
export async function checkKafkaStatus() { | ||
const admin = kafka.admin() | ||
try { | ||
// Connect to Kafka | ||
await admin.connect() | ||
|
||
// Fetch metadata | ||
const metadata = await admin.fetchTopicMetadata({ topics: [] }) | ||
console.log('Metadata:', metadata) | ||
|
||
const clusterInfo = await admin.describeCluster() | ||
console.log('ClusterInfo : ', clusterInfo) | ||
|
||
// Optionally check for specific topics | ||
const missingTopics = topicList.filter((topic) => !metadata.topics.find((t: any) => t.name === topic)) | ||
|
||
if (missingTopics.length > 0) { | ||
console.error('Missing topics:', missingTopics) | ||
return { status: 'error', message: `Missing topics: ${missingTopics.join(', ')}` } | ||
} | ||
|
||
return { status: 'ok', message: 'Kafka is in sync and working.' } | ||
} catch (error: any) { | ||
console.error('Error connecting to Kafka:', error) | ||
return { status: 'error', message: `Error: ${error.message}` } | ||
} finally { | ||
await admin.disconnect() | ||
} | ||
} | ||
|
||
// Example usage | ||
checkKafkaStatus().then((status) => console.log('Kafka Status:', status)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import {NextFunction, Request, Response} from "express"; | ||
|
||
export const handlerWrapper = (fn: any) => (req: Request, res: Response, next: NextFunction) => { | ||
try { | ||
const result = fn(req, res, next) | ||
if (result instanceof Promise) { | ||
result.catch((e) => { | ||
next(e) | ||
}) | ||
} | ||
} catch (error) { | ||
// Handle sync errors | ||
next(error) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2684,10 +2684,10 @@ levn@^0.4.1: | |
prelude-ls "^1.2.1" | ||
type-check "~0.4.0" | ||
|
||
[email protected].3: | ||
version "1.4.3" | ||
resolved "https://registry.yarnpkg.com/libcardano/-/libcardano-1.4.3.tgz#a3dc20452e1520b65fa32621337de62413a3cd5c" | ||
integrity sha512-5R5aE+WHwC1wxFLH4fVjXeQh0WbOLCBZKcFmbVYvGwWy2TMaqspncy8QMclqD03x8GtdK7yWEFTp9buGP9/eTw== | ||
[email protected].11: | ||
version "1.4.11" | ||
resolved "https://registry.yarnpkg.com/libcardano/-/libcardano-1.4.11.tgz#ffe0f1f63a4a9bb940e87a5b5b68284cbbbaa1a7" | ||
integrity sha512-rl/okJH27NBGwOx7VTgBkOJe4q6vBbBE4FbPrXXDhgLgI55004K0ODK0R4+3HCHAL8TtnXPqPRJXE5vvO++lIQ== | ||
dependencies: | ||
"@cardano-sdk/crypto" "^0.1.30" | ||
"@emurgo/cardano-serialization-lib-nodejs" "^11.5.0" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,5 @@ export default async function handler( | |
throw err | ||
}) | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log error with warning so that it can be debugged later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log added