mirror of
https://github.com/dstotijn/hetty
synced 2024-11-10 06:04:19 +00:00
252 lines
4.4 KiB
GraphQL
252 lines
4.4 KiB
GraphQL
type HttpRequestLog {
|
|
id: ID!
|
|
url: String!
|
|
method: HttpMethod!
|
|
proto: String!
|
|
headers: [HttpHeader!]!
|
|
body: String
|
|
timestamp: Time!
|
|
response: HttpResponseLog
|
|
}
|
|
|
|
type HttpResponseLog {
|
|
"""
|
|
Will be the same ID as its related request ID.
|
|
"""
|
|
id: ID!
|
|
proto: HttpProtocol!
|
|
statusCode: Int!
|
|
statusReason: String!
|
|
body: String
|
|
headers: [HttpHeader!]!
|
|
}
|
|
|
|
type HttpHeader {
|
|
key: String!
|
|
value: String!
|
|
}
|
|
|
|
type Project {
|
|
id: ID!
|
|
name: String!
|
|
isActive: Boolean!
|
|
settings: ProjectSettings!
|
|
}
|
|
|
|
type ProjectSettings {
|
|
intercept: InterceptSettings!
|
|
}
|
|
|
|
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!
|
|
}
|
|
|
|
type DeleteSenderRequestsResult {
|
|
success: Boolean!
|
|
}
|
|
|
|
input HttpRequestLogFilterInput {
|
|
onlyInScope: Boolean
|
|
searchExpression: String
|
|
}
|
|
|
|
type HttpRequestLogFilter {
|
|
onlyInScope: Boolean!
|
|
searchExpression: String
|
|
}
|
|
|
|
input SenderRequestInput {
|
|
id: ID
|
|
url: URL!
|
|
method: HttpMethod
|
|
proto: HttpProtocol
|
|
headers: [HttpHeaderInput!]
|
|
body: String
|
|
}
|
|
|
|
input HttpHeaderInput {
|
|
key: String!
|
|
value: String!
|
|
}
|
|
|
|
type SenderRequest {
|
|
id: ID!
|
|
sourceRequestLogID: ID
|
|
url: URL!
|
|
method: HttpMethod!
|
|
proto: HttpProtocol!
|
|
headers: [HttpHeader!]
|
|
body: String
|
|
timestamp: Time!
|
|
response: HttpResponseLog
|
|
}
|
|
|
|
input SenderRequestFilterInput {
|
|
onlyInScope: Boolean
|
|
searchExpression: String
|
|
}
|
|
|
|
type SenderRequestFilter {
|
|
onlyInScope: Boolean!
|
|
searchExpression: String
|
|
}
|
|
|
|
type HttpRequest {
|
|
id: ID!
|
|
url: URL!
|
|
method: HttpMethod!
|
|
proto: HttpProtocol!
|
|
headers: [HttpHeader!]!
|
|
body: String
|
|
response: HttpResponse
|
|
}
|
|
|
|
type HttpResponse {
|
|
"""
|
|
Will be the same ID as its related request ID.
|
|
"""
|
|
id: ID!
|
|
proto: HttpProtocol!
|
|
statusCode: Int!
|
|
statusReason: String!
|
|
body: String
|
|
headers: [HttpHeader!]!
|
|
}
|
|
|
|
input ModifyRequestInput {
|
|
id: ID!
|
|
url: URL!
|
|
method: HttpMethod!
|
|
proto: HttpProtocol!
|
|
headers: [HttpHeaderInput!]
|
|
body: String
|
|
modifyResponse: Boolean
|
|
}
|
|
|
|
type ModifyRequestResult {
|
|
success: Boolean!
|
|
}
|
|
|
|
type CancelRequestResult {
|
|
success: Boolean!
|
|
}
|
|
|
|
input ModifyResponseInput {
|
|
requestID: ID!
|
|
proto: HttpProtocol!
|
|
headers: [HttpHeaderInput!]
|
|
body: String
|
|
statusCode: Int!
|
|
statusReason: String!
|
|
}
|
|
|
|
type ModifyResponseResult {
|
|
success: Boolean!
|
|
}
|
|
|
|
type CancelResponseResult {
|
|
success: Boolean!
|
|
}
|
|
|
|
input UpdateInterceptSettingsInput {
|
|
requestsEnabled: Boolean!
|
|
responsesEnabled: Boolean!
|
|
requestFilter: String
|
|
responseFilter: String
|
|
}
|
|
|
|
type InterceptSettings {
|
|
requestsEnabled: Boolean!
|
|
responsesEnabled: Boolean!
|
|
requestFilter: String
|
|
responseFilter: String
|
|
}
|
|
|
|
type Query {
|
|
httpRequestLog(id: ID!): HttpRequestLog
|
|
httpRequestLogs: [HttpRequestLog!]!
|
|
httpRequestLogFilter: HttpRequestLogFilter
|
|
activeProject: Project
|
|
projects: [Project!]!
|
|
scope: [ScopeRule!]!
|
|
senderRequest(id: ID!): SenderRequest
|
|
senderRequests: [SenderRequest!]!
|
|
interceptedRequests: [HttpRequest!]!
|
|
interceptedRequest(id: ID!): HttpRequest
|
|
}
|
|
|
|
type Mutation {
|
|
createProject(name: String!): Project
|
|
openProject(id: ID!): Project
|
|
closeProject: CloseProjectResult!
|
|
deleteProject(id: ID!): DeleteProjectResult!
|
|
clearHTTPRequestLog: ClearHTTPRequestLogResult!
|
|
setScope(scope: [ScopeRuleInput!]!): [ScopeRule!]!
|
|
setHttpRequestLogFilter(
|
|
filter: HttpRequestLogFilterInput
|
|
): HttpRequestLogFilter
|
|
setSenderRequestFilter(filter: SenderRequestFilterInput): SenderRequestFilter
|
|
createOrUpdateSenderRequest(request: SenderRequestInput!): SenderRequest!
|
|
createSenderRequestFromHttpRequestLog(id: ID!): SenderRequest!
|
|
sendRequest(id: ID!): SenderRequest!
|
|
deleteSenderRequests: DeleteSenderRequestsResult!
|
|
modifyRequest(request: ModifyRequestInput!): ModifyRequestResult!
|
|
cancelRequest(id: ID!): CancelRequestResult!
|
|
modifyResponse(response: ModifyResponseInput!): ModifyResponseResult!
|
|
cancelResponse(requestID: ID!): CancelResponseResult!
|
|
updateInterceptSettings(
|
|
input: UpdateInterceptSettingsInput!
|
|
): InterceptSettings!
|
|
}
|
|
|
|
enum HttpMethod {
|
|
GET
|
|
HEAD
|
|
POST
|
|
PUT
|
|
DELETE
|
|
CONNECT
|
|
OPTIONS
|
|
TRACE
|
|
PATCH
|
|
}
|
|
|
|
enum HttpProtocol {
|
|
HTTP10
|
|
HTTP11
|
|
HTTP20
|
|
}
|
|
|
|
scalar Time
|
|
scalar Regexp
|
|
scalar URL
|