Files
hetty/pkg/api/schema.graphql
2020-12-22 12:35:14 +01:00

109 lines
1.6 KiB
GraphQL

type HttpRequestLog {
id: ID!
url: String!
method: HttpMethod!
proto: String!
headers: [HttpHeader!]!
body: String
timestamp: Time!
response: HttpResponseLog
}
type HttpResponseLog {
requestId: ID!
proto: String!
statusCode: Int!
statusReason: String!
body: String
headers: [HttpHeader!]!
}
type HttpHeader {
key: String!
value: String!
}
type Project {
name: String!
isActive: Boolean!
}
type ScopeRule {
url: Regexp
header: ScopeHeader
body: Regexp
}
input ScopeRuleInput {
url: Regexp
header: ScopeHeaderInput
body: Regexp
}
type ScopeHeader {
key: Regexp
value: Regexp
}
input ScopeHeaderInput {
key: Regexp
value: Regexp
}
type CloseProjectResult {
success: Boolean!
}
type DeleteProjectResult {
success: Boolean!
}
type ClearHTTPRequestLogResult {
success: Boolean!
}
input HttpRequestLogFilterInput {
onlyInScope: Boolean
searchExpression: String
}
type HttpRequestLogFilter {
onlyInScope: Boolean!
searchExpression: String
}
type Query {
httpRequestLog(id: ID!): HttpRequestLog
httpRequestLogs: [HttpRequestLog!]!
httpRequestLogFilter: HttpRequestLogFilter
activeProject: Project
projects: [Project!]!
scope: [ScopeRule!]!
}
type Mutation {
openProject(name: String!): Project
closeProject: CloseProjectResult!
deleteProject(name: String!): DeleteProjectResult!
clearHTTPRequestLog: ClearHTTPRequestLogResult!
setScope(scope: [ScopeRuleInput!]!): [ScopeRule!]!
setHttpRequestLogFilter(
filter: HttpRequestLogFilterInput
): HttpRequestLogFilter
}
enum HttpMethod {
GET
HEAD
POST
PUT
DELETE
CONNECT
OPTIONS
TRACE
PATCH
}
scalar Time
scalar Regexp