mirror of
https://github.com/harness/drone.git
synced 2025-05-05 03:41:45 +08:00
[Webhook] Add Swagger (#145)
This change adds webhook APIs to swagger and regenerates the web service clients based on the latest swagger.
This commit is contained in:
parent
44ec7ceb07
commit
1337f729e7
@ -20,6 +20,14 @@ func ptrptr(i interface{}) *interface{} {
|
|||||||
return &i
|
return &i
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func toInterfaceSlice[T interface{}](vals []T) []interface{} {
|
||||||
|
res := make([]interface{}, len(vals))
|
||||||
|
for i := range vals {
|
||||||
|
res[i] = vals[i]
|
||||||
|
}
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
|
||||||
var queryParameterPage = openapi3.ParameterOrRef{
|
var queryParameterPage = openapi3.ParameterOrRef{
|
||||||
Parameter: &openapi3.Parameter{
|
Parameter: &openapi3.Parameter{
|
||||||
Name: request.QueryParamPage,
|
Name: request.QueryParamPage,
|
@ -48,6 +48,7 @@ func Generate() *openapi3.Spec {
|
|||||||
repoOperations(&reflector)
|
repoOperations(&reflector)
|
||||||
resourceOperations(&reflector)
|
resourceOperations(&reflector)
|
||||||
pullReqOperations(&reflector)
|
pullReqOperations(&reflector)
|
||||||
|
webhookOperations(&reflector)
|
||||||
|
|
||||||
//
|
//
|
||||||
// define security scheme
|
// define security scheme
|
||||||
|
188
internal/api/openapi/webhook.go
Normal file
188
internal/api/openapi/webhook.go
Normal file
@ -0,0 +1,188 @@
|
|||||||
|
// Copyright 2022 Harness Inc. All rights reserved.
|
||||||
|
// Use of this source code is governed by the Polyform Free Trial License
|
||||||
|
// that can be found in the LICENSE.md file for this repository.
|
||||||
|
|
||||||
|
package openapi
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/harness/gitness/internal/api/controller/webhook"
|
||||||
|
"github.com/harness/gitness/internal/api/usererror"
|
||||||
|
"github.com/harness/gitness/types"
|
||||||
|
"github.com/harness/gitness/types/enum"
|
||||||
|
|
||||||
|
"github.com/swaggest/openapi-go/openapi3"
|
||||||
|
)
|
||||||
|
|
||||||
|
// webhookTrigger is a plugin for enum.WebhookTrigger to allow using oneof.
|
||||||
|
type webhookTrigger string
|
||||||
|
|
||||||
|
func (webhookTrigger) Enum() []interface{} {
|
||||||
|
return toInterfaceSlice(enum.GetAllWebhookTriggers())
|
||||||
|
}
|
||||||
|
|
||||||
|
// webhookCreateInput is used to overshadow field Triggers of webhook.CreateInput.
|
||||||
|
type webhookCreateInput struct {
|
||||||
|
webhook.CreateInput
|
||||||
|
Triggers []webhookTrigger `json:"triggers"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// webhookParent is a plugin for enum.WebhookParent to allow using oneof.
|
||||||
|
type webhookParent string
|
||||||
|
|
||||||
|
func (webhookParent) Enum() []interface{} {
|
||||||
|
return toInterfaceSlice(enum.GetAllWebhookParents())
|
||||||
|
}
|
||||||
|
|
||||||
|
// webhookType is used to overshadow fields Parent & Triggers of types.Webhook.
|
||||||
|
type webhookType struct {
|
||||||
|
types.Webhook
|
||||||
|
ParentType webhookParent `json:"parent_type"`
|
||||||
|
Triggers []webhookTrigger `json:"triggers"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type createWebhookRequest struct {
|
||||||
|
repoRequest
|
||||||
|
webhookCreateInput
|
||||||
|
}
|
||||||
|
|
||||||
|
type listWebhooksRequest struct {
|
||||||
|
repoRequest
|
||||||
|
}
|
||||||
|
|
||||||
|
type webhookRequest struct {
|
||||||
|
repoRequest
|
||||||
|
ID int64 `path:"webhook_id"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type getWebhookRequest struct {
|
||||||
|
webhookRequest
|
||||||
|
}
|
||||||
|
|
||||||
|
type deleteWebhookRequest struct {
|
||||||
|
webhookRequest
|
||||||
|
}
|
||||||
|
|
||||||
|
// webhookUpdateInput is used to overshadow field Triggers of webhook.UpdateInput.
|
||||||
|
type webhookUpdateInput struct {
|
||||||
|
webhook.UpdateInput
|
||||||
|
Triggers []webhookTrigger `json:"triggers"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type updateWebhookRequest struct {
|
||||||
|
webhookRequest
|
||||||
|
webhookUpdateInput
|
||||||
|
}
|
||||||
|
|
||||||
|
// webhookExecutionResult is a plugin for enum.WebhookExecutionResult to allow using oneof.
|
||||||
|
type webhookExecutionResult string
|
||||||
|
|
||||||
|
func (webhookExecutionResult) Enum() []interface{} {
|
||||||
|
return toInterfaceSlice(enum.GetAllWebhookExecutionResults())
|
||||||
|
}
|
||||||
|
|
||||||
|
// webhookExecutionType is used to overshadow triggers TriggerType & Result of types.WebhookExecution.
|
||||||
|
type webhookExecutionType struct {
|
||||||
|
types.WebhookExecution
|
||||||
|
TriggerType webhookTrigger `json:"trigger_type"`
|
||||||
|
Result webhookExecutionResult `json:"result"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type listWebhookExecutionsRequest struct {
|
||||||
|
webhookRequest
|
||||||
|
}
|
||||||
|
|
||||||
|
type webhookExecutionRequest struct {
|
||||||
|
webhookRequest
|
||||||
|
ID int64 `path:"webhook_execution_id"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type getWebhookExecutionRequest struct {
|
||||||
|
webhookExecutionRequest
|
||||||
|
}
|
||||||
|
|
||||||
|
//nolint:funlen
|
||||||
|
func webhookOperations(reflector *openapi3.Reflector) {
|
||||||
|
createWebhook := openapi3.Operation{}
|
||||||
|
createWebhook.WithTags("webhook")
|
||||||
|
createWebhook.WithMapOfAnything(map[string]interface{}{"operationId": "createWebhook"})
|
||||||
|
_ = reflector.SetRequest(&createWebhook, new(createWebhookRequest), http.MethodPost)
|
||||||
|
_ = reflector.SetJSONResponse(&createWebhook, new(webhookType), http.StatusOK)
|
||||||
|
_ = reflector.SetJSONResponse(&createWebhook, new(usererror.Error), http.StatusBadRequest)
|
||||||
|
_ = reflector.SetJSONResponse(&createWebhook, new(usererror.Error), http.StatusInternalServerError)
|
||||||
|
_ = reflector.SetJSONResponse(&createWebhook, new(usererror.Error), http.StatusUnauthorized)
|
||||||
|
_ = reflector.SetJSONResponse(&createWebhook, new(usererror.Error), http.StatusForbidden)
|
||||||
|
_ = reflector.Spec.AddOperation(http.MethodPost, "/repos/{repoRef}/webhooks", createWebhook)
|
||||||
|
|
||||||
|
listWebhooks := openapi3.Operation{}
|
||||||
|
listWebhooks.WithTags("webhook")
|
||||||
|
listWebhooks.WithMapOfAnything(map[string]interface{}{"operationId": "listWebhooks"})
|
||||||
|
listWebhooks.WithParameters(queryParameterPage, queryParameterPerPage)
|
||||||
|
_ = reflector.SetRequest(&listWebhooks, new(listWebhooksRequest), http.MethodGet)
|
||||||
|
_ = reflector.SetJSONResponse(&listWebhooks, new([]webhookType), http.StatusOK)
|
||||||
|
_ = reflector.SetJSONResponse(&listWebhooks, new(usererror.Error), http.StatusBadRequest)
|
||||||
|
_ = reflector.SetJSONResponse(&listWebhooks, new(usererror.Error), http.StatusInternalServerError)
|
||||||
|
_ = reflector.SetJSONResponse(&listWebhooks, new(usererror.Error), http.StatusUnauthorized)
|
||||||
|
_ = reflector.SetJSONResponse(&listWebhooks, new(usererror.Error), http.StatusForbidden)
|
||||||
|
_ = reflector.Spec.AddOperation(http.MethodGet, "/repos/{repoRef}/webhooks", listWebhooks)
|
||||||
|
|
||||||
|
getWebhook := openapi3.Operation{}
|
||||||
|
getWebhook.WithTags("webhook")
|
||||||
|
getWebhook.WithMapOfAnything(map[string]interface{}{"operationId": "getWebhook"})
|
||||||
|
_ = reflector.SetRequest(&getWebhook, new(getWebhookRequest), http.MethodGet)
|
||||||
|
_ = reflector.SetJSONResponse(&getWebhook, new(webhookType), http.StatusOK)
|
||||||
|
_ = reflector.SetJSONResponse(&getWebhook, new(usererror.Error), http.StatusBadRequest)
|
||||||
|
_ = reflector.SetJSONResponse(&getWebhook, new(usererror.Error), http.StatusInternalServerError)
|
||||||
|
_ = reflector.SetJSONResponse(&getWebhook, new(usererror.Error), http.StatusUnauthorized)
|
||||||
|
_ = reflector.SetJSONResponse(&getWebhook, new(usererror.Error), http.StatusForbidden)
|
||||||
|
_ = reflector.Spec.AddOperation(http.MethodGet, "/repos/{repoRef}/webhooks/{webhook_id}", getWebhook)
|
||||||
|
|
||||||
|
updateWebhook := openapi3.Operation{}
|
||||||
|
updateWebhook.WithTags("webhook")
|
||||||
|
updateWebhook.WithMapOfAnything(map[string]interface{}{"operationId": "updateWebhook"})
|
||||||
|
_ = reflector.SetRequest(&updateWebhook, new(updateWebhookRequest), http.MethodPut)
|
||||||
|
_ = reflector.SetJSONResponse(&updateWebhook, new(webhookType), http.StatusOK)
|
||||||
|
_ = reflector.SetJSONResponse(&updateWebhook, new(usererror.Error), http.StatusBadRequest)
|
||||||
|
_ = reflector.SetJSONResponse(&updateWebhook, new(usererror.Error), http.StatusInternalServerError)
|
||||||
|
_ = reflector.SetJSONResponse(&updateWebhook, new(usererror.Error), http.StatusUnauthorized)
|
||||||
|
_ = reflector.SetJSONResponse(&updateWebhook, new(usererror.Error), http.StatusForbidden)
|
||||||
|
_ = reflector.Spec.AddOperation(http.MethodPut, "/repos/{repoRef}/webhooks/{webhook_id}", updateWebhook)
|
||||||
|
|
||||||
|
deleteWebhook := openapi3.Operation{}
|
||||||
|
deleteWebhook.WithTags("webhook")
|
||||||
|
deleteWebhook.WithMapOfAnything(map[string]interface{}{"operationId": "deleteWebhook"})
|
||||||
|
_ = reflector.SetRequest(&deleteWebhook, new(deleteWebhookRequest), http.MethodDelete)
|
||||||
|
_ = reflector.SetJSONResponse(&deleteWebhook, nil, http.StatusNoContent)
|
||||||
|
_ = reflector.SetJSONResponse(&deleteWebhook, new(usererror.Error), http.StatusBadRequest)
|
||||||
|
_ = reflector.SetJSONResponse(&deleteWebhook, new(usererror.Error), http.StatusInternalServerError)
|
||||||
|
_ = reflector.SetJSONResponse(&deleteWebhook, new(usererror.Error), http.StatusUnauthorized)
|
||||||
|
_ = reflector.SetJSONResponse(&deleteWebhook, new(usererror.Error), http.StatusForbidden)
|
||||||
|
_ = reflector.Spec.AddOperation(http.MethodDelete, "/repos/{repoRef}/webhooks/{webhook_id}", deleteWebhook)
|
||||||
|
|
||||||
|
listWebhookExecutions := openapi3.Operation{}
|
||||||
|
listWebhookExecutions.WithTags("webhook")
|
||||||
|
listWebhookExecutions.WithMapOfAnything(map[string]interface{}{"operationId": "listWebhookExecutions"})
|
||||||
|
listWebhookExecutions.WithParameters(queryParameterPage, queryParameterPerPage)
|
||||||
|
_ = reflector.SetRequest(&listWebhookExecutions, new(listWebhookExecutionsRequest), http.MethodGet)
|
||||||
|
_ = reflector.SetJSONResponse(&listWebhookExecutions, new([]webhookExecutionType), http.StatusOK)
|
||||||
|
_ = reflector.SetJSONResponse(&listWebhookExecutions, new(usererror.Error), http.StatusBadRequest)
|
||||||
|
_ = reflector.SetJSONResponse(&listWebhookExecutions, new(usererror.Error), http.StatusInternalServerError)
|
||||||
|
_ = reflector.SetJSONResponse(&listWebhookExecutions, new(usererror.Error), http.StatusUnauthorized)
|
||||||
|
_ = reflector.SetJSONResponse(&listWebhookExecutions, new(usererror.Error), http.StatusForbidden)
|
||||||
|
_ = reflector.Spec.AddOperation(http.MethodGet,
|
||||||
|
"/repos/{repoRef}/webhooks/{webhook_id}/executions", listWebhookExecutions)
|
||||||
|
|
||||||
|
getWebhookExecution := openapi3.Operation{}
|
||||||
|
getWebhookExecution.WithTags("webhook")
|
||||||
|
getWebhookExecution.WithMapOfAnything(map[string]interface{}{"operationId": "getWebhookExecution"})
|
||||||
|
getWebhookExecution.WithParameters(queryParameterPage, queryParameterPerPage)
|
||||||
|
_ = reflector.SetRequest(&getWebhookExecution, new(getWebhookExecutionRequest), http.MethodGet)
|
||||||
|
_ = reflector.SetJSONResponse(&getWebhookExecution, new(webhookExecutionType), http.StatusOK)
|
||||||
|
_ = reflector.SetJSONResponse(&getWebhookExecution, new(usererror.Error), http.StatusBadRequest)
|
||||||
|
_ = reflector.SetJSONResponse(&getWebhookExecution, new(usererror.Error), http.StatusInternalServerError)
|
||||||
|
_ = reflector.SetJSONResponse(&getWebhookExecution, new(usererror.Error), http.StatusUnauthorized)
|
||||||
|
_ = reflector.SetJSONResponse(&getWebhookExecution, new(usererror.Error), http.StatusForbidden)
|
||||||
|
_ = reflector.Spec.AddOperation(http.MethodGet,
|
||||||
|
"/repos/{repoRef}/webhooks/{webhook_id}/executions/{webhook_execution_id}", getWebhookExecution)
|
||||||
|
}
|
@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
package enum
|
package enum
|
||||||
|
|
||||||
|
import "sort"
|
||||||
|
|
||||||
const (
|
const (
|
||||||
id = "id"
|
id = "id"
|
||||||
uid = "uid"
|
uid = "uid"
|
||||||
@ -23,3 +25,16 @@ const (
|
|||||||
comment = "comment"
|
comment = "comment"
|
||||||
code = "code"
|
code = "code"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func existsInSortedSlice(strs []string, s string) bool {
|
||||||
|
idx := sort.SearchStrings(strs, s)
|
||||||
|
return idx >= 0 && idx < len(strs) && strs[idx] == s
|
||||||
|
}
|
||||||
|
|
||||||
|
func enumToStringSlice[T ~string](vals []T) []string {
|
||||||
|
res := make([]string, len(vals))
|
||||||
|
for i := range vals {
|
||||||
|
res[i] = string(vals[i])
|
||||||
|
}
|
||||||
|
return res
|
||||||
|
}
|
@ -73,19 +73,23 @@ const (
|
|||||||
PullReqActivityTypeTitleChange PullReqActivityType = "title-change"
|
PullReqActivityTypeTitleChange PullReqActivityType = "title-change"
|
||||||
)
|
)
|
||||||
|
|
||||||
var pullReqActivityTypes = []string{
|
func GetAllPullReqActivityTypes() []PullReqActivityType {
|
||||||
string(PullReqActivityTypeComment),
|
return []PullReqActivityType{
|
||||||
string(PullReqActivityTypeCodeComment),
|
PullReqActivityTypeComment,
|
||||||
string(PullReqActivityTypeTitleChange),
|
PullReqActivityTypeCodeComment,
|
||||||
|
PullReqActivityTypeTitleChange,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var rawPullReqActivityTypes = enumToStringSlice(GetAllPullReqActivityTypes())
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
sort.Strings(pullReqActivityTypes)
|
sort.Strings(rawPullReqActivityTypes)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ParsePullReqActivityType parses the pull request activity type.
|
// ParsePullReqActivityType parses the pull request activity type.
|
||||||
func ParsePullReqActivityType(s string) (PullReqActivityType, bool) {
|
func ParsePullReqActivityType(s string) (PullReqActivityType, bool) {
|
||||||
if existsInSortedSlice(pullReqActivityTypes, s) {
|
if existsInSortedSlice(rawPullReqActivityTypes, s) {
|
||||||
return PullReqActivityType(s), true
|
return PullReqActivityType(s), true
|
||||||
}
|
}
|
||||||
return "", false
|
return "", false
|
||||||
@ -103,25 +107,24 @@ const (
|
|||||||
PullReqActivityKindCodeComment PullReqActivityKind = "code"
|
PullReqActivityKindCodeComment PullReqActivityKind = "code"
|
||||||
)
|
)
|
||||||
|
|
||||||
var pullReqActivityKinds = []string{
|
func GetAllPullReqActivityKinds() []PullReqActivityKind {
|
||||||
string(PullReqActivityKindSystem),
|
return []PullReqActivityKind{
|
||||||
string(PullReqActivityKindComment),
|
PullReqActivityKindSystem,
|
||||||
string(PullReqActivityTypeCodeComment),
|
PullReqActivityKindComment,
|
||||||
|
PullReqActivityKindCodeComment,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var rawPullReqActivityKinds = enumToStringSlice(GetAllPullReqActivityKinds())
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
sort.Strings(pullReqActivityKinds)
|
sort.Strings(rawPullReqActivityKinds)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ParsePullReqActivityKind parses the pull request activity type.
|
// ParsePullReqActivityKind parses the pull request activity type.
|
||||||
func ParsePullReqActivityKind(s string) (PullReqActivityKind, bool) {
|
func ParsePullReqActivityKind(s string) (PullReqActivityKind, bool) {
|
||||||
if existsInSortedSlice(pullReqActivityKinds, s) {
|
if existsInSortedSlice(rawPullReqActivityKinds, s) {
|
||||||
return PullReqActivityKind(s), true
|
return PullReqActivityKind(s), true
|
||||||
}
|
}
|
||||||
return "", false
|
return "", false
|
||||||
}
|
}
|
||||||
|
|
||||||
func existsInSortedSlice(strs []string, s string) bool {
|
|
||||||
idx := sort.SearchStrings(strs, s)
|
|
||||||
return idx >= 0 && idx < len(strs) && strs[idx] == s
|
|
||||||
}
|
|
||||||
|
@ -10,27 +10,42 @@ import "sort"
|
|||||||
type WebhookParent string
|
type WebhookParent string
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// WebhookParentSpace describes a space as webhook owner.
|
|
||||||
WebhookParentSpace WebhookParent = "space"
|
|
||||||
|
|
||||||
// WebhookParentSpace describes a repo as webhook owner.
|
// WebhookParentSpace describes a repo as webhook owner.
|
||||||
WebhookParentRepo WebhookParent = "repo"
|
WebhookParentRepo WebhookParent = "repo"
|
||||||
|
|
||||||
|
// WebhookParentSpace describes a space as webhook owner.
|
||||||
|
WebhookParentSpace WebhookParent = "space"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func GetAllWebhookParents() []WebhookParent {
|
||||||
|
return []WebhookParent{
|
||||||
|
WebhookParentRepo,
|
||||||
|
WebhookParentSpace,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// WebhookExecutionResult defines the different results of a webhook execution.
|
// WebhookExecutionResult defines the different results of a webhook execution.
|
||||||
type WebhookExecutionResult string
|
type WebhookExecutionResult string
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// WebhookExecutionResultFatalError describes a webhook execution result that failed with an unrecoverable error.
|
// WebhookExecutionResultSuccess describes a webhook execution result that succeeded.
|
||||||
WebhookExecutionResultFatalError WebhookExecutionResult = "fatal_error"
|
WebhookExecutionResultSuccess WebhookExecutionResult = "success"
|
||||||
|
|
||||||
// WebhookExecutionResultRetriableError describes a webhook execution result that failed with a retriable error.
|
// WebhookExecutionResultRetriableError describes a webhook execution result that failed with a retriable error.
|
||||||
WebhookExecutionResultRetriableError WebhookExecutionResult = "retriable_error"
|
WebhookExecutionResultRetriableError WebhookExecutionResult = "retriable_error"
|
||||||
|
|
||||||
// WebhookExecutionResultSuccess describes a webhook execution result that succeeded.
|
// WebhookExecutionResultFatalError describes a webhook execution result that failed with an unrecoverable error.
|
||||||
WebhookExecutionResultSuccess WebhookExecutionResult = "success"
|
WebhookExecutionResultFatalError WebhookExecutionResult = "fatal_error"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func GetAllWebhookExecutionResults() []WebhookExecutionResult {
|
||||||
|
return []WebhookExecutionResult{
|
||||||
|
WebhookExecutionResultSuccess,
|
||||||
|
WebhookExecutionResultRetriableError,
|
||||||
|
WebhookExecutionResultFatalError,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// WebhookTrigger defines the different types of webhook triggers available.
|
// WebhookTrigger defines the different types of webhook triggers available.
|
||||||
// NOTE: For now we keep a small list - will be extended later on once we decided on a final set of triggers.
|
// NOTE: For now we keep a small list - will be extended later on once we decided on a final set of triggers.
|
||||||
type WebhookTrigger string
|
type WebhookTrigger string
|
||||||
@ -40,17 +55,21 @@ const (
|
|||||||
WebhookTriggerPush WebhookTrigger = "push"
|
WebhookTriggerPush WebhookTrigger = "push"
|
||||||
)
|
)
|
||||||
|
|
||||||
var webhookTriggers = []string{
|
func GetAllWebhookTriggers() []WebhookTrigger {
|
||||||
string(WebhookTriggerPush),
|
return []WebhookTrigger{
|
||||||
|
WebhookTriggerPush,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var rawWebhookTriggers = enumToStringSlice(GetAllWebhookTriggers())
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
sort.Strings(webhookTriggers)
|
sort.Strings(rawWebhookTriggers)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ParsePullReqActivityType parses the webhook trigger type.
|
// ParsePullReqActivityType parses the webhook trigger type.
|
||||||
func ParseWebhookTrigger(s string) (WebhookTrigger, bool) {
|
func ParseWebhookTrigger(s string) (WebhookTrigger, bool) {
|
||||||
if existsInSortedSlice(webhookTriggers, s) {
|
if existsInSortedSlice(rawWebhookTriggers, s) {
|
||||||
return WebhookTrigger(s), true
|
return WebhookTrigger(s), true
|
||||||
}
|
}
|
||||||
return "", false
|
return "", false
|
||||||
|
@ -11,10 +11,20 @@ export type EnumParentResourceType = string
|
|||||||
|
|
||||||
export type EnumPathTargetType = string
|
export type EnumPathTargetType = string
|
||||||
|
|
||||||
|
export type EnumPullReqActivityKind = string
|
||||||
|
|
||||||
|
export type EnumPullReqActivityType = string
|
||||||
|
|
||||||
export type EnumPullReqState = string
|
export type EnumPullReqState = string
|
||||||
|
|
||||||
export type EnumTokenType = string
|
export type EnumTokenType = string
|
||||||
|
|
||||||
|
export type EnumWebhookExecutionResult = string
|
||||||
|
|
||||||
|
export type EnumWebhookParent = string
|
||||||
|
|
||||||
|
export type EnumWebhookTrigger = string
|
||||||
|
|
||||||
export interface FormDataOpenapiLoginRequest {
|
export interface FormDataOpenapiLoginRequest {
|
||||||
password?: string
|
password?: string
|
||||||
username?: string
|
username?: string
|
||||||
@ -32,6 +42,15 @@ export interface OpenapiCalculateCommitDivergenceRequest {
|
|||||||
requests?: RepoCommitDivergenceRequest[] | null
|
requests?: RepoCommitDivergenceRequest[] | null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface OpenapiCommentCreatePullReqRequest {
|
||||||
|
parent_id?: number
|
||||||
|
text?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface OpenapiCommentUpdatePullReqRequest {
|
||||||
|
text?: string
|
||||||
|
}
|
||||||
|
|
||||||
export interface OpenapiCommitFilesRequest {
|
export interface OpenapiCommitFilesRequest {
|
||||||
actions?: RepoCommitFileAction[] | null
|
actions?: RepoCommitFileAction[] | null
|
||||||
branch?: string
|
branch?: string
|
||||||
@ -92,6 +111,14 @@ export interface OpenapiCreateSpaceRequest {
|
|||||||
uid?: string
|
uid?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface OpenapiCreateWebhookRequest {
|
||||||
|
enabled?: boolean
|
||||||
|
insecure?: boolean
|
||||||
|
secret?: string
|
||||||
|
triggers?: OpenapiWebhookTrigger[] | null
|
||||||
|
url?: string
|
||||||
|
}
|
||||||
|
|
||||||
export interface OpenapiCurrentUserResponse {
|
export interface OpenapiCurrentUserResponse {
|
||||||
data?: TypesUser
|
data?: TypesUser
|
||||||
status?: 'SUCCESS' | 'FAILURE' | 'ERROR'
|
status?: 'SUCCESS' | 'FAILURE' | 'ERROR'
|
||||||
@ -137,6 +164,48 @@ export interface OpenapiUpdateSpaceRequest {
|
|||||||
isPublic?: boolean | null
|
isPublic?: boolean | null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface OpenapiUpdateWebhookRequest {
|
||||||
|
enabled?: boolean | null
|
||||||
|
insecure?: boolean | null
|
||||||
|
secret?: string | null
|
||||||
|
triggers?: OpenapiWebhookTrigger[] | null
|
||||||
|
url?: string | null
|
||||||
|
}
|
||||||
|
|
||||||
|
export type OpenapiWebhookExecutionResult = 'success' | 'retriable_error' | 'fatal_error'
|
||||||
|
|
||||||
|
export interface OpenapiWebhookExecutionType {
|
||||||
|
created?: number
|
||||||
|
duration?: number
|
||||||
|
error?: string
|
||||||
|
id?: number
|
||||||
|
request?: TypesWebhookExecutionRequest
|
||||||
|
response?: TypesWebhookExecutionResponse
|
||||||
|
result?: OpenapiWebhookExecutionResult
|
||||||
|
retrigger_of?: number | null
|
||||||
|
retriggerable?: boolean
|
||||||
|
trigger_type?: OpenapiWebhookTrigger
|
||||||
|
webhook_id?: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export type OpenapiWebhookParent = 'repo' | 'space'
|
||||||
|
|
||||||
|
export type OpenapiWebhookTrigger = 'push'
|
||||||
|
|
||||||
|
export interface OpenapiWebhookType {
|
||||||
|
created?: number
|
||||||
|
created_by?: number
|
||||||
|
enabled?: boolean
|
||||||
|
id?: number
|
||||||
|
insecure?: boolean
|
||||||
|
parent_id?: number
|
||||||
|
parent_type?: OpenapiWebhookParent
|
||||||
|
triggers?: OpenapiWebhookTrigger[] | null
|
||||||
|
updated?: number
|
||||||
|
url?: string
|
||||||
|
version?: number
|
||||||
|
}
|
||||||
|
|
||||||
export interface RepoBranch {
|
export interface RepoBranch {
|
||||||
commit?: RepoCommit
|
commit?: RepoCommit
|
||||||
name?: string
|
name?: string
|
||||||
@ -262,6 +331,28 @@ export interface TypesPullReq {
|
|||||||
version?: number
|
version?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface TypesPullReqActivity {
|
||||||
|
author?: TypesPrincipalInfo
|
||||||
|
created?: number
|
||||||
|
deleted?: number | null
|
||||||
|
edited?: number
|
||||||
|
id?: number
|
||||||
|
kind?: EnumPullReqActivityKind
|
||||||
|
metadata?: { [key: string]: any } | null
|
||||||
|
order?: number
|
||||||
|
parent_id?: number | null
|
||||||
|
payload?: { [key: string]: any } | null
|
||||||
|
pullreq_id?: number
|
||||||
|
repo_id?: number
|
||||||
|
resolved?: number | null
|
||||||
|
resolver?: TypesPrincipalInfo
|
||||||
|
sub_order?: number
|
||||||
|
text?: string
|
||||||
|
type?: EnumPullReqActivityType
|
||||||
|
updated?: number
|
||||||
|
version?: number
|
||||||
|
}
|
||||||
|
|
||||||
export interface TypesRepository {
|
export interface TypesRepository {
|
||||||
created?: number
|
created?: number
|
||||||
createdBy?: number
|
createdBy?: number
|
||||||
@ -336,6 +427,19 @@ export interface TypesUserInput {
|
|||||||
password?: string | null
|
password?: string | null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface TypesWebhookExecutionRequest {
|
||||||
|
body?: string
|
||||||
|
headers?: string
|
||||||
|
url?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface TypesWebhookExecutionResponse {
|
||||||
|
body?: string
|
||||||
|
headers?: string
|
||||||
|
status?: number
|
||||||
|
status_code?: string
|
||||||
|
}
|
||||||
|
|
||||||
export interface UserUpdateInput {
|
export interface UserUpdateInput {
|
||||||
displayName?: string | null
|
displayName?: string | null
|
||||||
email?: string | null
|
email?: string | null
|
||||||
@ -1116,6 +1220,227 @@ export const useUpdatePullReq = ({ repoRef, pullreq_number, ...props }: UseUpdat
|
|||||||
{ base: getConfigNew('code'), pathParams: { repoRef, pullreq_number }, ...props }
|
{ base: getConfigNew('code'), pathParams: { repoRef, pullreq_number }, ...props }
|
||||||
)
|
)
|
||||||
|
|
||||||
|
export interface ListPullReqActivitiesQueryParams {
|
||||||
|
/**
|
||||||
|
* The kind of the pull request activity to include in the result.
|
||||||
|
*/
|
||||||
|
kind?: ('system' | 'comment' | 'code')[]
|
||||||
|
/**
|
||||||
|
* The type of the pull request activity to include in the result.
|
||||||
|
*/
|
||||||
|
type?: ('comment' | 'code-comment' | 'title-change')[]
|
||||||
|
/**
|
||||||
|
* The result should contain only entries created at and after this timestamp (unix millis).
|
||||||
|
*/
|
||||||
|
since?: number
|
||||||
|
/**
|
||||||
|
* The result should contain only entries created before this timestamp (unix millis).
|
||||||
|
*/
|
||||||
|
until?: number
|
||||||
|
/**
|
||||||
|
* The maximum number of results to return.
|
||||||
|
*/
|
||||||
|
limit?: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ListPullReqActivitiesPathParams {
|
||||||
|
repoRef: string
|
||||||
|
pullreq_number: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ListPullReqActivitiesProps = Omit<
|
||||||
|
GetProps<TypesPullReqActivity[], UsererrorError, ListPullReqActivitiesQueryParams, ListPullReqActivitiesPathParams>,
|
||||||
|
'path'
|
||||||
|
> &
|
||||||
|
ListPullReqActivitiesPathParams
|
||||||
|
|
||||||
|
export const ListPullReqActivities = ({ repoRef, pullreq_number, ...props }: ListPullReqActivitiesProps) => (
|
||||||
|
<Get<TypesPullReqActivity[], UsererrorError, ListPullReqActivitiesQueryParams, ListPullReqActivitiesPathParams>
|
||||||
|
path={`/repos/${repoRef}/pullreq/${pullreq_number}/activities`}
|
||||||
|
base={getConfigNew('code')}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
|
||||||
|
export type UseListPullReqActivitiesProps = Omit<
|
||||||
|
UseGetProps<
|
||||||
|
TypesPullReqActivity[],
|
||||||
|
UsererrorError,
|
||||||
|
ListPullReqActivitiesQueryParams,
|
||||||
|
ListPullReqActivitiesPathParams
|
||||||
|
>,
|
||||||
|
'path'
|
||||||
|
> &
|
||||||
|
ListPullReqActivitiesPathParams
|
||||||
|
|
||||||
|
export const useListPullReqActivities = ({ repoRef, pullreq_number, ...props }: UseListPullReqActivitiesProps) =>
|
||||||
|
useGet<TypesPullReqActivity[], UsererrorError, ListPullReqActivitiesQueryParams, ListPullReqActivitiesPathParams>(
|
||||||
|
(paramsInPath: ListPullReqActivitiesPathParams) =>
|
||||||
|
`/repos/${paramsInPath.repoRef}/pullreq/${paramsInPath.pullreq_number}/activities`,
|
||||||
|
{ base: getConfigNew('code'), pathParams: { repoRef, pullreq_number }, ...props }
|
||||||
|
)
|
||||||
|
|
||||||
|
export interface CommentCreatePullReqPathParams {
|
||||||
|
repoRef: string
|
||||||
|
pullreq_number: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export type CommentCreatePullReqProps = Omit<
|
||||||
|
MutateProps<
|
||||||
|
TypesPullReqActivity,
|
||||||
|
UsererrorError,
|
||||||
|
void,
|
||||||
|
OpenapiCommentCreatePullReqRequest,
|
||||||
|
CommentCreatePullReqPathParams
|
||||||
|
>,
|
||||||
|
'path' | 'verb'
|
||||||
|
> &
|
||||||
|
CommentCreatePullReqPathParams
|
||||||
|
|
||||||
|
export const CommentCreatePullReq = ({ repoRef, pullreq_number, ...props }: CommentCreatePullReqProps) => (
|
||||||
|
<Mutate<
|
||||||
|
TypesPullReqActivity,
|
||||||
|
UsererrorError,
|
||||||
|
void,
|
||||||
|
OpenapiCommentCreatePullReqRequest,
|
||||||
|
CommentCreatePullReqPathParams
|
||||||
|
>
|
||||||
|
verb="POST"
|
||||||
|
path={`/repos/${repoRef}/pullreq/${pullreq_number}/comments`}
|
||||||
|
base={getConfigNew('code')}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
|
||||||
|
export type UseCommentCreatePullReqProps = Omit<
|
||||||
|
UseMutateProps<
|
||||||
|
TypesPullReqActivity,
|
||||||
|
UsererrorError,
|
||||||
|
void,
|
||||||
|
OpenapiCommentCreatePullReqRequest,
|
||||||
|
CommentCreatePullReqPathParams
|
||||||
|
>,
|
||||||
|
'path' | 'verb'
|
||||||
|
> &
|
||||||
|
CommentCreatePullReqPathParams
|
||||||
|
|
||||||
|
export const useCommentCreatePullReq = ({ repoRef, pullreq_number, ...props }: UseCommentCreatePullReqProps) =>
|
||||||
|
useMutate<
|
||||||
|
TypesPullReqActivity,
|
||||||
|
UsererrorError,
|
||||||
|
void,
|
||||||
|
OpenapiCommentCreatePullReqRequest,
|
||||||
|
CommentCreatePullReqPathParams
|
||||||
|
>(
|
||||||
|
'POST',
|
||||||
|
(paramsInPath: CommentCreatePullReqPathParams) =>
|
||||||
|
`/repos/${paramsInPath.repoRef}/pullreq/${paramsInPath.pullreq_number}/comments`,
|
||||||
|
{ base: getConfigNew('code'), pathParams: { repoRef, pullreq_number }, ...props }
|
||||||
|
)
|
||||||
|
|
||||||
|
export interface CommentDeletePullReqPathParams {
|
||||||
|
repoRef: string
|
||||||
|
pullreq_number: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export type CommentDeletePullReqProps = Omit<
|
||||||
|
MutateProps<void, UsererrorError, void, number, CommentDeletePullReqPathParams>,
|
||||||
|
'path' | 'verb'
|
||||||
|
> &
|
||||||
|
CommentDeletePullReqPathParams
|
||||||
|
|
||||||
|
export const CommentDeletePullReq = ({ repoRef, pullreq_number, ...props }: CommentDeletePullReqProps) => (
|
||||||
|
<Mutate<void, UsererrorError, void, number, CommentDeletePullReqPathParams>
|
||||||
|
verb="DELETE"
|
||||||
|
path={`/repos/${repoRef}/pullreq/${pullreq_number}/comments`}
|
||||||
|
base={getConfigNew('code')}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
|
||||||
|
export type UseCommentDeletePullReqProps = Omit<
|
||||||
|
UseMutateProps<void, UsererrorError, void, number, CommentDeletePullReqPathParams>,
|
||||||
|
'path' | 'verb'
|
||||||
|
> &
|
||||||
|
CommentDeletePullReqPathParams
|
||||||
|
|
||||||
|
export const useCommentDeletePullReq = ({ repoRef, pullreq_number, ...props }: UseCommentDeletePullReqProps) =>
|
||||||
|
useMutate<void, UsererrorError, void, number, CommentDeletePullReqPathParams>(
|
||||||
|
'DELETE',
|
||||||
|
(paramsInPath: CommentDeletePullReqPathParams) =>
|
||||||
|
`/repos/${paramsInPath.repoRef}/pullreq/${paramsInPath.pullreq_number}/comments`,
|
||||||
|
{ base: getConfigNew('code'), pathParams: { repoRef, pullreq_number }, ...props }
|
||||||
|
)
|
||||||
|
|
||||||
|
export interface CommentUpdatePullReqPathParams {
|
||||||
|
repoRef: string
|
||||||
|
pullreq_number: number
|
||||||
|
pullreq_comment_id: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export type CommentUpdatePullReqProps = Omit<
|
||||||
|
MutateProps<
|
||||||
|
TypesPullReqActivity,
|
||||||
|
UsererrorError,
|
||||||
|
void,
|
||||||
|
OpenapiCommentUpdatePullReqRequest,
|
||||||
|
CommentUpdatePullReqPathParams
|
||||||
|
>,
|
||||||
|
'path' | 'verb'
|
||||||
|
> &
|
||||||
|
CommentUpdatePullReqPathParams
|
||||||
|
|
||||||
|
export const CommentUpdatePullReq = ({
|
||||||
|
repoRef,
|
||||||
|
pullreq_number,
|
||||||
|
pullreq_comment_id,
|
||||||
|
...props
|
||||||
|
}: CommentUpdatePullReqProps) => (
|
||||||
|
<Mutate<
|
||||||
|
TypesPullReqActivity,
|
||||||
|
UsererrorError,
|
||||||
|
void,
|
||||||
|
OpenapiCommentUpdatePullReqRequest,
|
||||||
|
CommentUpdatePullReqPathParams
|
||||||
|
>
|
||||||
|
verb="PUT"
|
||||||
|
path={`/repos/${repoRef}/pullreq/${pullreq_number}/comments/${pullreq_comment_id}`}
|
||||||
|
base={getConfigNew('code')}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
|
||||||
|
export type UseCommentUpdatePullReqProps = Omit<
|
||||||
|
UseMutateProps<
|
||||||
|
TypesPullReqActivity,
|
||||||
|
UsererrorError,
|
||||||
|
void,
|
||||||
|
OpenapiCommentUpdatePullReqRequest,
|
||||||
|
CommentUpdatePullReqPathParams
|
||||||
|
>,
|
||||||
|
'path' | 'verb'
|
||||||
|
> &
|
||||||
|
CommentUpdatePullReqPathParams
|
||||||
|
|
||||||
|
export const useCommentUpdatePullReq = ({
|
||||||
|
repoRef,
|
||||||
|
pullreq_number,
|
||||||
|
pullreq_comment_id,
|
||||||
|
...props
|
||||||
|
}: UseCommentUpdatePullReqProps) =>
|
||||||
|
useMutate<
|
||||||
|
TypesPullReqActivity,
|
||||||
|
UsererrorError,
|
||||||
|
void,
|
||||||
|
OpenapiCommentUpdatePullReqRequest,
|
||||||
|
CommentUpdatePullReqPathParams
|
||||||
|
>(
|
||||||
|
'PUT',
|
||||||
|
(paramsInPath: CommentUpdatePullReqPathParams) =>
|
||||||
|
`/repos/${paramsInPath.repoRef}/pullreq/${paramsInPath.pullreq_number}/comments/${paramsInPath.pullreq_comment_id}`,
|
||||||
|
{ base: getConfigNew('code'), pathParams: { repoRef, pullreq_number, pullreq_comment_id }, ...props }
|
||||||
|
)
|
||||||
|
|
||||||
export interface ListRepositoryServiceAccountsPathParams {
|
export interface ListRepositoryServiceAccountsPathParams {
|
||||||
repoRef: string
|
repoRef: string
|
||||||
}
|
}
|
||||||
@ -1203,6 +1528,289 @@ export const useListTags = ({ repoRef, ...props }: UseListTagsProps) =>
|
|||||||
{ base: getConfigNew('code'), pathParams: { repoRef }, ...props }
|
{ base: getConfigNew('code'), pathParams: { repoRef }, ...props }
|
||||||
)
|
)
|
||||||
|
|
||||||
|
export interface ListWebhooksQueryParams {
|
||||||
|
/**
|
||||||
|
* The page to return.
|
||||||
|
*/
|
||||||
|
page?: number
|
||||||
|
/**
|
||||||
|
* The number of entries returned per page.
|
||||||
|
*/
|
||||||
|
per_page?: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ListWebhooksPathParams {
|
||||||
|
repoRef: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ListWebhooksProps = Omit<
|
||||||
|
GetProps<OpenapiWebhookType[], UsererrorError, ListWebhooksQueryParams, ListWebhooksPathParams>,
|
||||||
|
'path'
|
||||||
|
> &
|
||||||
|
ListWebhooksPathParams
|
||||||
|
|
||||||
|
export const ListWebhooks = ({ repoRef, ...props }: ListWebhooksProps) => (
|
||||||
|
<Get<OpenapiWebhookType[], UsererrorError, ListWebhooksQueryParams, ListWebhooksPathParams>
|
||||||
|
path={`/repos/${repoRef}/webhooks`}
|
||||||
|
base={getConfigNew('code')}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
|
||||||
|
export type UseListWebhooksProps = Omit<
|
||||||
|
UseGetProps<OpenapiWebhookType[], UsererrorError, ListWebhooksQueryParams, ListWebhooksPathParams>,
|
||||||
|
'path'
|
||||||
|
> &
|
||||||
|
ListWebhooksPathParams
|
||||||
|
|
||||||
|
export const useListWebhooks = ({ repoRef, ...props }: UseListWebhooksProps) =>
|
||||||
|
useGet<OpenapiWebhookType[], UsererrorError, ListWebhooksQueryParams, ListWebhooksPathParams>(
|
||||||
|
(paramsInPath: ListWebhooksPathParams) => `/repos/${paramsInPath.repoRef}/webhooks`,
|
||||||
|
{ base: getConfigNew('code'), pathParams: { repoRef }, ...props }
|
||||||
|
)
|
||||||
|
|
||||||
|
export interface CreateWebhookPathParams {
|
||||||
|
repoRef: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export type CreateWebhookProps = Omit<
|
||||||
|
MutateProps<OpenapiWebhookType, UsererrorError, void, OpenapiCreateWebhookRequest, CreateWebhookPathParams>,
|
||||||
|
'path' | 'verb'
|
||||||
|
> &
|
||||||
|
CreateWebhookPathParams
|
||||||
|
|
||||||
|
export const CreateWebhook = ({ repoRef, ...props }: CreateWebhookProps) => (
|
||||||
|
<Mutate<OpenapiWebhookType, UsererrorError, void, OpenapiCreateWebhookRequest, CreateWebhookPathParams>
|
||||||
|
verb="POST"
|
||||||
|
path={`/repos/${repoRef}/webhooks`}
|
||||||
|
base={getConfigNew('code')}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
|
||||||
|
export type UseCreateWebhookProps = Omit<
|
||||||
|
UseMutateProps<OpenapiWebhookType, UsererrorError, void, OpenapiCreateWebhookRequest, CreateWebhookPathParams>,
|
||||||
|
'path' | 'verb'
|
||||||
|
> &
|
||||||
|
CreateWebhookPathParams
|
||||||
|
|
||||||
|
export const useCreateWebhook = ({ repoRef, ...props }: UseCreateWebhookProps) =>
|
||||||
|
useMutate<OpenapiWebhookType, UsererrorError, void, OpenapiCreateWebhookRequest, CreateWebhookPathParams>(
|
||||||
|
'POST',
|
||||||
|
(paramsInPath: CreateWebhookPathParams) => `/repos/${paramsInPath.repoRef}/webhooks`,
|
||||||
|
{ base: getConfigNew('code'), pathParams: { repoRef }, ...props }
|
||||||
|
)
|
||||||
|
|
||||||
|
export interface DeleteWebhookPathParams {
|
||||||
|
repoRef: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export type DeleteWebhookProps = Omit<
|
||||||
|
MutateProps<void, UsererrorError, void, number, DeleteWebhookPathParams>,
|
||||||
|
'path' | 'verb'
|
||||||
|
> &
|
||||||
|
DeleteWebhookPathParams
|
||||||
|
|
||||||
|
export const DeleteWebhook = ({ repoRef, ...props }: DeleteWebhookProps) => (
|
||||||
|
<Mutate<void, UsererrorError, void, number, DeleteWebhookPathParams>
|
||||||
|
verb="DELETE"
|
||||||
|
path={`/repos/${repoRef}/webhooks`}
|
||||||
|
base={getConfigNew('code')}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
|
||||||
|
export type UseDeleteWebhookProps = Omit<
|
||||||
|
UseMutateProps<void, UsererrorError, void, number, DeleteWebhookPathParams>,
|
||||||
|
'path' | 'verb'
|
||||||
|
> &
|
||||||
|
DeleteWebhookPathParams
|
||||||
|
|
||||||
|
export const useDeleteWebhook = ({ repoRef, ...props }: UseDeleteWebhookProps) =>
|
||||||
|
useMutate<void, UsererrorError, void, number, DeleteWebhookPathParams>(
|
||||||
|
'DELETE',
|
||||||
|
(paramsInPath: DeleteWebhookPathParams) => `/repos/${paramsInPath.repoRef}/webhooks`,
|
||||||
|
{ base: getConfigNew('code'), pathParams: { repoRef }, ...props }
|
||||||
|
)
|
||||||
|
|
||||||
|
export interface GetWebhookPathParams {
|
||||||
|
repoRef: string
|
||||||
|
webhook_id: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export type GetWebhookProps = Omit<GetProps<OpenapiWebhookType, UsererrorError, void, GetWebhookPathParams>, 'path'> &
|
||||||
|
GetWebhookPathParams
|
||||||
|
|
||||||
|
export const GetWebhook = ({ repoRef, webhook_id, ...props }: GetWebhookProps) => (
|
||||||
|
<Get<OpenapiWebhookType, UsererrorError, void, GetWebhookPathParams>
|
||||||
|
path={`/repos/${repoRef}/webhooks/${webhook_id}`}
|
||||||
|
base={getConfigNew('code')}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
|
||||||
|
export type UseGetWebhookProps = Omit<
|
||||||
|
UseGetProps<OpenapiWebhookType, UsererrorError, void, GetWebhookPathParams>,
|
||||||
|
'path'
|
||||||
|
> &
|
||||||
|
GetWebhookPathParams
|
||||||
|
|
||||||
|
export const useGetWebhook = ({ repoRef, webhook_id, ...props }: UseGetWebhookProps) =>
|
||||||
|
useGet<OpenapiWebhookType, UsererrorError, void, GetWebhookPathParams>(
|
||||||
|
(paramsInPath: GetWebhookPathParams) => `/repos/${paramsInPath.repoRef}/webhooks/${paramsInPath.webhook_id}`,
|
||||||
|
{ base: getConfigNew('code'), pathParams: { repoRef, webhook_id }, ...props }
|
||||||
|
)
|
||||||
|
|
||||||
|
export interface UpdateWebhookPathParams {
|
||||||
|
repoRef: string
|
||||||
|
webhook_id: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export type UpdateWebhookProps = Omit<
|
||||||
|
MutateProps<OpenapiWebhookType, UsererrorError, void, OpenapiUpdateWebhookRequest, UpdateWebhookPathParams>,
|
||||||
|
'path' | 'verb'
|
||||||
|
> &
|
||||||
|
UpdateWebhookPathParams
|
||||||
|
|
||||||
|
export const UpdateWebhook = ({ repoRef, webhook_id, ...props }: UpdateWebhookProps) => (
|
||||||
|
<Mutate<OpenapiWebhookType, UsererrorError, void, OpenapiUpdateWebhookRequest, UpdateWebhookPathParams>
|
||||||
|
verb="PUT"
|
||||||
|
path={`/repos/${repoRef}/webhooks/${webhook_id}`}
|
||||||
|
base={getConfigNew('code')}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
|
||||||
|
export type UseUpdateWebhookProps = Omit<
|
||||||
|
UseMutateProps<OpenapiWebhookType, UsererrorError, void, OpenapiUpdateWebhookRequest, UpdateWebhookPathParams>,
|
||||||
|
'path' | 'verb'
|
||||||
|
> &
|
||||||
|
UpdateWebhookPathParams
|
||||||
|
|
||||||
|
export const useUpdateWebhook = ({ repoRef, webhook_id, ...props }: UseUpdateWebhookProps) =>
|
||||||
|
useMutate<OpenapiWebhookType, UsererrorError, void, OpenapiUpdateWebhookRequest, UpdateWebhookPathParams>(
|
||||||
|
'PUT',
|
||||||
|
(paramsInPath: UpdateWebhookPathParams) => `/repos/${paramsInPath.repoRef}/webhooks/${paramsInPath.webhook_id}`,
|
||||||
|
{ base: getConfigNew('code'), pathParams: { repoRef, webhook_id }, ...props }
|
||||||
|
)
|
||||||
|
|
||||||
|
export interface ListWebhookExecutionsQueryParams {
|
||||||
|
/**
|
||||||
|
* The page to return.
|
||||||
|
*/
|
||||||
|
page?: number
|
||||||
|
/**
|
||||||
|
* The number of entries returned per page.
|
||||||
|
*/
|
||||||
|
per_page?: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ListWebhookExecutionsPathParams {
|
||||||
|
repoRef: string
|
||||||
|
webhook_id: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ListWebhookExecutionsProps = Omit<
|
||||||
|
GetProps<
|
||||||
|
OpenapiWebhookExecutionType[],
|
||||||
|
UsererrorError,
|
||||||
|
ListWebhookExecutionsQueryParams,
|
||||||
|
ListWebhookExecutionsPathParams
|
||||||
|
>,
|
||||||
|
'path'
|
||||||
|
> &
|
||||||
|
ListWebhookExecutionsPathParams
|
||||||
|
|
||||||
|
export const ListWebhookExecutions = ({ repoRef, webhook_id, ...props }: ListWebhookExecutionsProps) => (
|
||||||
|
<Get<OpenapiWebhookExecutionType[], UsererrorError, ListWebhookExecutionsQueryParams, ListWebhookExecutionsPathParams>
|
||||||
|
path={`/repos/${repoRef}/webhooks/${webhook_id}/executions`}
|
||||||
|
base={getConfigNew('code')}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
|
||||||
|
export type UseListWebhookExecutionsProps = Omit<
|
||||||
|
UseGetProps<
|
||||||
|
OpenapiWebhookExecutionType[],
|
||||||
|
UsererrorError,
|
||||||
|
ListWebhookExecutionsQueryParams,
|
||||||
|
ListWebhookExecutionsPathParams
|
||||||
|
>,
|
||||||
|
'path'
|
||||||
|
> &
|
||||||
|
ListWebhookExecutionsPathParams
|
||||||
|
|
||||||
|
export const useListWebhookExecutions = ({ repoRef, webhook_id, ...props }: UseListWebhookExecutionsProps) =>
|
||||||
|
useGet<
|
||||||
|
OpenapiWebhookExecutionType[],
|
||||||
|
UsererrorError,
|
||||||
|
ListWebhookExecutionsQueryParams,
|
||||||
|
ListWebhookExecutionsPathParams
|
||||||
|
>(
|
||||||
|
(paramsInPath: ListWebhookExecutionsPathParams) =>
|
||||||
|
`/repos/${paramsInPath.repoRef}/webhooks/${paramsInPath.webhook_id}/executions`,
|
||||||
|
{ base: getConfigNew('code'), pathParams: { repoRef, webhook_id }, ...props }
|
||||||
|
)
|
||||||
|
|
||||||
|
export interface GetWebhookExecutionQueryParams {
|
||||||
|
/**
|
||||||
|
* The page to return.
|
||||||
|
*/
|
||||||
|
page?: number
|
||||||
|
/**
|
||||||
|
* The number of entries returned per page.
|
||||||
|
*/
|
||||||
|
per_page?: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface GetWebhookExecutionPathParams {
|
||||||
|
repoRef: string
|
||||||
|
webhook_id: number
|
||||||
|
webhook_execution_id: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export type GetWebhookExecutionProps = Omit<
|
||||||
|
GetProps<OpenapiWebhookExecutionType, UsererrorError, GetWebhookExecutionQueryParams, GetWebhookExecutionPathParams>,
|
||||||
|
'path'
|
||||||
|
> &
|
||||||
|
GetWebhookExecutionPathParams
|
||||||
|
|
||||||
|
export const GetWebhookExecution = ({
|
||||||
|
repoRef,
|
||||||
|
webhook_id,
|
||||||
|
webhook_execution_id,
|
||||||
|
...props
|
||||||
|
}: GetWebhookExecutionProps) => (
|
||||||
|
<Get<OpenapiWebhookExecutionType, UsererrorError, GetWebhookExecutionQueryParams, GetWebhookExecutionPathParams>
|
||||||
|
path={`/repos/${repoRef}/webhooks/${webhook_id}/executions/${webhook_execution_id}`}
|
||||||
|
base={getConfigNew('code')}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
|
||||||
|
export type UseGetWebhookExecutionProps = Omit<
|
||||||
|
UseGetProps<
|
||||||
|
OpenapiWebhookExecutionType,
|
||||||
|
UsererrorError,
|
||||||
|
GetWebhookExecutionQueryParams,
|
||||||
|
GetWebhookExecutionPathParams
|
||||||
|
>,
|
||||||
|
'path'
|
||||||
|
> &
|
||||||
|
GetWebhookExecutionPathParams
|
||||||
|
|
||||||
|
export const useGetWebhookExecution = ({
|
||||||
|
repoRef,
|
||||||
|
webhook_id,
|
||||||
|
webhook_execution_id,
|
||||||
|
...props
|
||||||
|
}: UseGetWebhookExecutionProps) =>
|
||||||
|
useGet<OpenapiWebhookExecutionType, UsererrorError, GetWebhookExecutionQueryParams, GetWebhookExecutionPathParams>(
|
||||||
|
(paramsInPath: GetWebhookExecutionPathParams) =>
|
||||||
|
`/repos/${paramsInPath.repoRef}/webhooks/${paramsInPath.webhook_id}/executions/${paramsInPath.webhook_execution_id}`,
|
||||||
|
{ base: getConfigNew('code'), pathParams: { repoRef, webhook_id, webhook_execution_id }, ...props }
|
||||||
|
)
|
||||||
|
|
||||||
export type ListGitignoreProps = Omit<GetProps<string[], UsererrorError, void, void>, 'path'>
|
export type ListGitignoreProps = Omit<GetProps<string[], UsererrorError, void, void>, 'path'>
|
||||||
|
|
||||||
export const ListGitignore = (props: ListGitignoreProps) => (
|
export const ListGitignore = (props: ListGitignoreProps) => (
|
||||||
|
@ -1155,6 +1155,258 @@ paths:
|
|||||||
description: Internal Server Error
|
description: Internal Server Error
|
||||||
tags:
|
tags:
|
||||||
- pullreq
|
- pullreq
|
||||||
|
/repos/{repoRef}/pullreq/{pullreq_number}/activities:
|
||||||
|
get:
|
||||||
|
operationId: listPullReqActivities
|
||||||
|
parameters:
|
||||||
|
- description: The kind of the pull request activity to include in the result.
|
||||||
|
in: query
|
||||||
|
name: kind
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
items:
|
||||||
|
enum:
|
||||||
|
- system
|
||||||
|
- comment
|
||||||
|
- code
|
||||||
|
type: string
|
||||||
|
type: array
|
||||||
|
- description: The type of the pull request activity to include in the result.
|
||||||
|
in: query
|
||||||
|
name: type
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
items:
|
||||||
|
enum:
|
||||||
|
- comment
|
||||||
|
- code-comment
|
||||||
|
- title-change
|
||||||
|
type: string
|
||||||
|
type: array
|
||||||
|
- description: The result should contain only entries created at and after this
|
||||||
|
timestamp (unix millis).
|
||||||
|
in: query
|
||||||
|
name: since
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
minimum: 0
|
||||||
|
type: integer
|
||||||
|
- description: The result should contain only entries created before this timestamp
|
||||||
|
(unix millis).
|
||||||
|
in: query
|
||||||
|
name: until
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
minimum: 0
|
||||||
|
type: integer
|
||||||
|
- description: The maximum number of results to return.
|
||||||
|
in: query
|
||||||
|
name: limit
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
minimum: 1
|
||||||
|
type: integer
|
||||||
|
- in: path
|
||||||
|
name: repoRef
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
- in: path
|
||||||
|
name: pullreq_number
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/TypesPullReqActivity'
|
||||||
|
type: array
|
||||||
|
description: OK
|
||||||
|
"400":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Bad Request
|
||||||
|
"401":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Unauthorized
|
||||||
|
"403":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Forbidden
|
||||||
|
"500":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Internal Server Error
|
||||||
|
tags:
|
||||||
|
- pullreq
|
||||||
|
/repos/{repoRef}/pullreq/{pullreq_number}/comments:
|
||||||
|
post:
|
||||||
|
operationId: commentCreatePullReq
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: repoRef
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
- in: path
|
||||||
|
name: pullreq_number
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/OpenapiCommentCreatePullReqRequest'
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/TypesPullReqActivity'
|
||||||
|
description: OK
|
||||||
|
"400":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Bad Request
|
||||||
|
"401":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Unauthorized
|
||||||
|
"403":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Forbidden
|
||||||
|
"500":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Internal Server Error
|
||||||
|
tags:
|
||||||
|
- pullreq
|
||||||
|
/repos/{repoRef}/pullreq/{pullreq_number}/comments/{pullreq_comment_id}:
|
||||||
|
delete:
|
||||||
|
operationId: commentDeletePullReq
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: repoRef
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
- in: path
|
||||||
|
name: pullreq_number
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
- in: path
|
||||||
|
name: pullreq_comment_id
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
responses:
|
||||||
|
"204":
|
||||||
|
description: No Content
|
||||||
|
"400":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Bad Request
|
||||||
|
"401":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Unauthorized
|
||||||
|
"403":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Forbidden
|
||||||
|
"500":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Internal Server Error
|
||||||
|
tags:
|
||||||
|
- pullreq
|
||||||
|
put:
|
||||||
|
operationId: commentUpdatePullReq
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: repoRef
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
- in: path
|
||||||
|
name: pullreq_number
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
- in: path
|
||||||
|
name: pullreq_comment_id
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/OpenapiCommentUpdatePullReqRequest'
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/TypesPullReqActivity'
|
||||||
|
description: OK
|
||||||
|
"400":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Bad Request
|
||||||
|
"401":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Unauthorized
|
||||||
|
"403":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Forbidden
|
||||||
|
"500":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Internal Server Error
|
||||||
|
tags:
|
||||||
|
- pullreq
|
||||||
/repos/{repoRef}/service_accounts:
|
/repos/{repoRef}/service_accounts:
|
||||||
get:
|
get:
|
||||||
operationId: listRepositoryServiceAccounts
|
operationId: listRepositoryServiceAccounts
|
||||||
@ -1294,6 +1546,388 @@ paths:
|
|||||||
description: Internal Server Error
|
description: Internal Server Error
|
||||||
tags:
|
tags:
|
||||||
- repository
|
- repository
|
||||||
|
/repos/{repoRef}/webhooks:
|
||||||
|
get:
|
||||||
|
operationId: listWebhooks
|
||||||
|
parameters:
|
||||||
|
- description: The page to return.
|
||||||
|
in: query
|
||||||
|
name: page
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
default: 1
|
||||||
|
minimum: 1
|
||||||
|
type: integer
|
||||||
|
- description: The number of entries returned per page.
|
||||||
|
in: query
|
||||||
|
name: per_page
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
default: 50
|
||||||
|
maximum: 100
|
||||||
|
minimum: 1
|
||||||
|
type: integer
|
||||||
|
- in: path
|
||||||
|
name: repoRef
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/OpenapiWebhookType'
|
||||||
|
type: array
|
||||||
|
description: OK
|
||||||
|
"400":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Bad Request
|
||||||
|
"401":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Unauthorized
|
||||||
|
"403":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Forbidden
|
||||||
|
"500":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Internal Server Error
|
||||||
|
tags:
|
||||||
|
- webhook
|
||||||
|
post:
|
||||||
|
operationId: createWebhook
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: repoRef
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/OpenapiCreateWebhookRequest'
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/OpenapiWebhookType'
|
||||||
|
description: OK
|
||||||
|
"400":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Bad Request
|
||||||
|
"401":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Unauthorized
|
||||||
|
"403":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Forbidden
|
||||||
|
"500":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Internal Server Error
|
||||||
|
tags:
|
||||||
|
- webhook
|
||||||
|
/repos/{repoRef}/webhooks/{webhook_id}:
|
||||||
|
delete:
|
||||||
|
operationId: deleteWebhook
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: repoRef
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
- in: path
|
||||||
|
name: webhook_id
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
responses:
|
||||||
|
"204":
|
||||||
|
description: No Content
|
||||||
|
"400":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Bad Request
|
||||||
|
"401":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Unauthorized
|
||||||
|
"403":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Forbidden
|
||||||
|
"500":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Internal Server Error
|
||||||
|
tags:
|
||||||
|
- webhook
|
||||||
|
get:
|
||||||
|
operationId: getWebhook
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: repoRef
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
- in: path
|
||||||
|
name: webhook_id
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/OpenapiWebhookType'
|
||||||
|
description: OK
|
||||||
|
"400":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Bad Request
|
||||||
|
"401":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Unauthorized
|
||||||
|
"403":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Forbidden
|
||||||
|
"500":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Internal Server Error
|
||||||
|
tags:
|
||||||
|
- webhook
|
||||||
|
put:
|
||||||
|
operationId: updateWebhook
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: repoRef
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
- in: path
|
||||||
|
name: webhook_id
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/OpenapiUpdateWebhookRequest'
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/OpenapiWebhookType'
|
||||||
|
description: OK
|
||||||
|
"400":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Bad Request
|
||||||
|
"401":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Unauthorized
|
||||||
|
"403":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Forbidden
|
||||||
|
"500":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Internal Server Error
|
||||||
|
tags:
|
||||||
|
- webhook
|
||||||
|
/repos/{repoRef}/webhooks/{webhook_id}/executions:
|
||||||
|
get:
|
||||||
|
operationId: listWebhookExecutions
|
||||||
|
parameters:
|
||||||
|
- description: The page to return.
|
||||||
|
in: query
|
||||||
|
name: page
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
default: 1
|
||||||
|
minimum: 1
|
||||||
|
type: integer
|
||||||
|
- description: The number of entries returned per page.
|
||||||
|
in: query
|
||||||
|
name: per_page
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
default: 50
|
||||||
|
maximum: 100
|
||||||
|
minimum: 1
|
||||||
|
type: integer
|
||||||
|
- in: path
|
||||||
|
name: repoRef
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
- in: path
|
||||||
|
name: webhook_id
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/OpenapiWebhookExecutionType'
|
||||||
|
type: array
|
||||||
|
description: OK
|
||||||
|
"400":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Bad Request
|
||||||
|
"401":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Unauthorized
|
||||||
|
"403":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Forbidden
|
||||||
|
"500":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Internal Server Error
|
||||||
|
tags:
|
||||||
|
- webhook
|
||||||
|
/repos/{repoRef}/webhooks/{webhook_id}/executions/{webhook_execution_id}:
|
||||||
|
get:
|
||||||
|
operationId: getWebhookExecution
|
||||||
|
parameters:
|
||||||
|
- description: The page to return.
|
||||||
|
in: query
|
||||||
|
name: page
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
default: 1
|
||||||
|
minimum: 1
|
||||||
|
type: integer
|
||||||
|
- description: The number of entries returned per page.
|
||||||
|
in: query
|
||||||
|
name: per_page
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
default: 50
|
||||||
|
maximum: 100
|
||||||
|
minimum: 1
|
||||||
|
type: integer
|
||||||
|
- in: path
|
||||||
|
name: repoRef
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
- in: path
|
||||||
|
name: webhook_id
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
- in: path
|
||||||
|
name: webhook_execution_id
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/OpenapiWebhookExecutionType'
|
||||||
|
description: OK
|
||||||
|
"400":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Bad Request
|
||||||
|
"401":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Unauthorized
|
||||||
|
"403":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Forbidden
|
||||||
|
"500":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/UsererrorError'
|
||||||
|
description: Internal Server Error
|
||||||
|
tags:
|
||||||
|
- webhook
|
||||||
/resources/gitignore:
|
/resources/gitignore:
|
||||||
get:
|
get:
|
||||||
operationId: listGitignore
|
operationId: listGitignore
|
||||||
@ -2181,10 +2815,20 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
EnumPathTargetType:
|
EnumPathTargetType:
|
||||||
type: string
|
type: string
|
||||||
|
EnumPullReqActivityKind:
|
||||||
|
type: string
|
||||||
|
EnumPullReqActivityType:
|
||||||
|
type: string
|
||||||
EnumPullReqState:
|
EnumPullReqState:
|
||||||
type: string
|
type: string
|
||||||
EnumTokenType:
|
EnumTokenType:
|
||||||
type: string
|
type: string
|
||||||
|
EnumWebhookExecutionResult:
|
||||||
|
type: string
|
||||||
|
EnumWebhookParent:
|
||||||
|
type: string
|
||||||
|
EnumWebhookTrigger:
|
||||||
|
type: string
|
||||||
FormDataOpenapiLoginRequest:
|
FormDataOpenapiLoginRequest:
|
||||||
properties:
|
properties:
|
||||||
password:
|
password:
|
||||||
@ -2216,6 +2860,18 @@ components:
|
|||||||
nullable: true
|
nullable: true
|
||||||
type: array
|
type: array
|
||||||
type: object
|
type: object
|
||||||
|
OpenapiCommentCreatePullReqRequest:
|
||||||
|
properties:
|
||||||
|
parent_id:
|
||||||
|
type: integer
|
||||||
|
text:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
OpenapiCommentUpdatePullReqRequest:
|
||||||
|
properties:
|
||||||
|
text:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
OpenapiCommitFilesRequest:
|
OpenapiCommitFilesRequest:
|
||||||
properties:
|
properties:
|
||||||
actions:
|
actions:
|
||||||
@ -2322,6 +2978,22 @@ components:
|
|||||||
uid:
|
uid:
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
|
OpenapiCreateWebhookRequest:
|
||||||
|
properties:
|
||||||
|
enabled:
|
||||||
|
type: boolean
|
||||||
|
insecure:
|
||||||
|
type: boolean
|
||||||
|
secret:
|
||||||
|
type: string
|
||||||
|
triggers:
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/OpenapiWebhookTrigger'
|
||||||
|
nullable: true
|
||||||
|
type: array
|
||||||
|
url:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
OpenapiCurrentUserResponse:
|
OpenapiCurrentUserResponse:
|
||||||
properties:
|
properties:
|
||||||
data:
|
data:
|
||||||
@ -2403,6 +3075,95 @@ components:
|
|||||||
nullable: true
|
nullable: true
|
||||||
type: boolean
|
type: boolean
|
||||||
type: object
|
type: object
|
||||||
|
OpenapiUpdateWebhookRequest:
|
||||||
|
properties:
|
||||||
|
enabled:
|
||||||
|
nullable: true
|
||||||
|
type: boolean
|
||||||
|
insecure:
|
||||||
|
nullable: true
|
||||||
|
type: boolean
|
||||||
|
secret:
|
||||||
|
nullable: true
|
||||||
|
type: string
|
||||||
|
triggers:
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/OpenapiWebhookTrigger'
|
||||||
|
nullable: true
|
||||||
|
type: array
|
||||||
|
url:
|
||||||
|
nullable: true
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
OpenapiWebhookExecutionResult:
|
||||||
|
enum:
|
||||||
|
- success
|
||||||
|
- retriable_error
|
||||||
|
- fatal_error
|
||||||
|
type: string
|
||||||
|
OpenapiWebhookExecutionType:
|
||||||
|
properties:
|
||||||
|
created:
|
||||||
|
type: integer
|
||||||
|
duration:
|
||||||
|
type: integer
|
||||||
|
error:
|
||||||
|
type: string
|
||||||
|
id:
|
||||||
|
type: integer
|
||||||
|
request:
|
||||||
|
$ref: '#/components/schemas/TypesWebhookExecutionRequest'
|
||||||
|
response:
|
||||||
|
$ref: '#/components/schemas/TypesWebhookExecutionResponse'
|
||||||
|
result:
|
||||||
|
$ref: '#/components/schemas/OpenapiWebhookExecutionResult'
|
||||||
|
retrigger_of:
|
||||||
|
nullable: true
|
||||||
|
type: integer
|
||||||
|
retriggerable:
|
||||||
|
type: boolean
|
||||||
|
trigger_type:
|
||||||
|
$ref: '#/components/schemas/OpenapiWebhookTrigger'
|
||||||
|
webhook_id:
|
||||||
|
type: integer
|
||||||
|
type: object
|
||||||
|
OpenapiWebhookParent:
|
||||||
|
enum:
|
||||||
|
- repo
|
||||||
|
- space
|
||||||
|
type: string
|
||||||
|
OpenapiWebhookTrigger:
|
||||||
|
enum:
|
||||||
|
- push
|
||||||
|
type: string
|
||||||
|
OpenapiWebhookType:
|
||||||
|
properties:
|
||||||
|
created:
|
||||||
|
type: integer
|
||||||
|
created_by:
|
||||||
|
type: integer
|
||||||
|
enabled:
|
||||||
|
type: boolean
|
||||||
|
id:
|
||||||
|
type: integer
|
||||||
|
insecure:
|
||||||
|
type: boolean
|
||||||
|
parent_id:
|
||||||
|
type: integer
|
||||||
|
parent_type:
|
||||||
|
$ref: '#/components/schemas/OpenapiWebhookParent'
|
||||||
|
triggers:
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/OpenapiWebhookTrigger'
|
||||||
|
nullable: true
|
||||||
|
type: array
|
||||||
|
updated:
|
||||||
|
type: integer
|
||||||
|
url:
|
||||||
|
type: string
|
||||||
|
version:
|
||||||
|
type: integer
|
||||||
|
type: object
|
||||||
RepoBranch:
|
RepoBranch:
|
||||||
properties:
|
properties:
|
||||||
commit:
|
commit:
|
||||||
@ -2600,6 +3361,54 @@ components:
|
|||||||
version:
|
version:
|
||||||
type: integer
|
type: integer
|
||||||
type: object
|
type: object
|
||||||
|
TypesPullReqActivity:
|
||||||
|
properties:
|
||||||
|
author:
|
||||||
|
$ref: '#/components/schemas/TypesPrincipalInfo'
|
||||||
|
created:
|
||||||
|
type: integer
|
||||||
|
deleted:
|
||||||
|
nullable: true
|
||||||
|
type: integer
|
||||||
|
edited:
|
||||||
|
type: integer
|
||||||
|
id:
|
||||||
|
type: integer
|
||||||
|
kind:
|
||||||
|
$ref: '#/components/schemas/EnumPullReqActivityKind'
|
||||||
|
metadata:
|
||||||
|
additionalProperties: {}
|
||||||
|
nullable: true
|
||||||
|
type: object
|
||||||
|
order:
|
||||||
|
type: integer
|
||||||
|
parent_id:
|
||||||
|
nullable: true
|
||||||
|
type: integer
|
||||||
|
payload:
|
||||||
|
additionalProperties: {}
|
||||||
|
nullable: true
|
||||||
|
type: object
|
||||||
|
pullreq_id:
|
||||||
|
type: integer
|
||||||
|
repo_id:
|
||||||
|
type: integer
|
||||||
|
resolved:
|
||||||
|
nullable: true
|
||||||
|
type: integer
|
||||||
|
resolver:
|
||||||
|
$ref: '#/components/schemas/TypesPrincipalInfo'
|
||||||
|
sub_order:
|
||||||
|
type: integer
|
||||||
|
text:
|
||||||
|
type: string
|
||||||
|
type:
|
||||||
|
$ref: '#/components/schemas/EnumPullReqActivityType'
|
||||||
|
updated:
|
||||||
|
type: integer
|
||||||
|
version:
|
||||||
|
type: integer
|
||||||
|
type: object
|
||||||
TypesRepository:
|
TypesRepository:
|
||||||
properties:
|
properties:
|
||||||
created:
|
created:
|
||||||
@ -2731,6 +3540,26 @@ components:
|
|||||||
nullable: true
|
nullable: true
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
|
TypesWebhookExecutionRequest:
|
||||||
|
properties:
|
||||||
|
body:
|
||||||
|
type: string
|
||||||
|
headers:
|
||||||
|
type: string
|
||||||
|
url:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
TypesWebhookExecutionResponse:
|
||||||
|
properties:
|
||||||
|
body:
|
||||||
|
type: string
|
||||||
|
headers:
|
||||||
|
type: string
|
||||||
|
status:
|
||||||
|
type: integer
|
||||||
|
status_code:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
UserUpdateInput:
|
UserUpdateInput:
|
||||||
properties:
|
properties:
|
||||||
displayName:
|
displayName:
|
||||||
|
Loading…
Reference in New Issue
Block a user