Skip to content
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

Shorten instance/<instanceID>/events/:name endpoint response #987

Merged
merged 5 commits into from
Nov 27, 2023

Conversation

piotrek6641
Copy link
Contributor

@piotrek6641 piotrek6641 commented Nov 13, 2023

Make events data more readable with removal of redundant data in output
http://0.0.0.0:8000/api/v1/instance/{instanceId}/events/{eventName}

before:

{ "eventName": "msg", "message": { "a": 1 } }
{ "eventName": "msg", "message": { "a": 2 } }
{ "eventName": "msg", "message": { "a": 3 } }

now returns:

{ "a": 1 }
{ "a": 2 }
{ "a": 3 }

without message used to return:

{ "eventName": "msg"  }
{ "eventName": "msg"  }
{ "eventName": "msg"  }

now returns

 {}
 {}
 {}

Screenshots

events with no message:
image

events with object as a message:
image

events with string as a message:
image

Clickup Task:
https://app.clickup.com/t/24308805/VDM-1283
Issue:
#328

@piotrek6641 piotrek6641 changed the title enable formating event structure using query Shorten instance/<instanceID>/events/:name endpoint response Nov 14, 2023
@a-tylenda
Copy link
Contributor

a-tylenda commented Nov 27, 2023

I verified and endpoint /api/v1/instance/{instanceId}/events/{eventName} works as described in PR description, but...
there is a discrepancy between API and CLI. This is because under CLI command si inst event on <id> there is getEvent() method this.router.get not this.router.upstream edited by @piotrek6641

image

@patuwwy patuwwy force-pushed the feat/events-stream-format branch 2 times, most recently from 531c6c5 to db13776 Compare November 27, 2023 13:23
@patuwwy patuwwy merged commit 6e9b5b1 into devel Nov 27, 2023
19 checks passed
@patuwwy patuwwy deleted the feat/events-stream-format branch November 27, 2023 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants