-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Json schema for the webapi trigger (#14627)
* Json schema for the webapi trigger * fix go mod * update common to try to fix the lint not finding a struct...? * latest chainlink-common * backout chainlink-common updates: * PR review, combine 2 requires in integration-test/load/go.mod * make gomodtidy --------- Co-authored-by: David Orchard <[email protected]>
- Loading branch information
1 parent
0dba7fb
commit fdbd9da
Showing
12 changed files
with
518 additions
and
14 deletions.
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/[email protected]", | ||
"$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.