-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Json schema for the webapi trigger #14627
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1abfce9
Json schema for the webapi trigger
nolag 5a38033
fix go mod
nolag b958ce5
update common to try to fix the lint not finding a struct...?
nolag 0a83cf2
Merge branch 'develop' into rtinianov_webabischema
DavidOrchard d75884e
latest chainlink-common
DavidOrchard 323969c
backout chainlink-common updates:
DavidOrchard 9783412
Merge branch 'develop' into rtinianov_webabischema
DavidOrchard 6f8628a
PR review, combine 2 requires in integration-test/load/go.mod
DavidOrchard 3ffa4dc
make gomodtidy
DavidOrchard 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
89 changes: 89 additions & 0 deletions
89
core/capabilities/webapi/webapicap/event_trigger-schema.json
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,89 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "https://github.com/smartcontractkit/chainlink/v2/core/capabilities/webapi/webapicap/web-trigger@1.0.0", | ||
"$defs": { | ||
"TriggerConfig": { | ||
"type": "object", | ||
"properties": { | ||
"allowedSenders": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"allowedTopics": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"rateLimiter": { | ||
"$ref": "#/$defs/RateLimiterConfig" | ||
}, | ||
"requiredParams": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"required": ["allowedSenders", "allowedTopics", "rateLimiter", "requiredParams"], | ||
"additionalProperties": false | ||
}, | ||
"RateLimiterConfig": { | ||
"type": "object", | ||
"properties": { | ||
"globalRPS": { | ||
"type": "number" | ||
}, | ||
"globalBurst": { | ||
"type": "integer" | ||
}, | ||
"perSenderRPS": { | ||
"type": "number" | ||
}, | ||
"perSenderBurst": { | ||
"type": "integer" | ||
} | ||
}, | ||
"required": ["globalRPS", "globalBurst", "perSenderRPS", "perSenderBurst"], | ||
"additionalProperties": false | ||
}, | ||
"TriggerRequestPayload": { | ||
"type": "object", | ||
"properties": { | ||
"trigger_id": { | ||
"type": "string" | ||
}, | ||
"trigger_event_id": { | ||
"type": "string" | ||
}, | ||
"timestamp": { | ||
"type": "integer", | ||
"format": "int64" | ||
}, | ||
"topics": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"params": { | ||
"type": "object", | ||
"additionalProperties": true | ||
} | ||
}, | ||
"required": ["trigger_id", "trigger_event_id", "timestamp", "topics", "params"], | ||
"additionalProperties": false | ||
} | ||
}, | ||
"type": "object", | ||
"properties": { | ||
"Config": { | ||
"$ref": "#/$defs/TriggerConfig" | ||
}, | ||
"Outputs": { | ||
"$ref": "#/$defs/TriggerRequestPayload" | ||
} | ||
} | ||
} |
147 changes: 147 additions & 0 deletions
147
core/capabilities/webapi/webapicap/event_trigger_generated.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,5 @@ | ||
package webapicap | ||
|
||
import _ "github.com/smartcontractkit/chainlink-common/pkg/capabilities/cli/cmd" // Required so that the tool is available to be run in go generate below. | ||
|
||
//go:generate go run github.com/smartcontractkit/chainlink-common/pkg/capabilities/cli/cmd/generate-types --dir $GOFILE |
Oops, something went wrong.
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.
should this be the package for all the webapi capabilities, notably the trigger and the target? We seem to have 3 different package names in the handler now.
webapicap
trigger
target
And also webapicapabilities in gateway.
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.
I don't know who uses webapicapabilities, but if it's only for these capabilities, it should have the duplicated types removed in favour of these ones.
webapicap should hold the wasm builders for both the trigger and the target IMO.
The trigger and target can either be in the webapi folder, or subfolders called trigger and target. I'm less opinonated about that one. @DeividasK has probably put more thought into it.