From 704021d5f29e4c99532090e53d45d2d0d502a53f Mon Sep 17 00:00:00 2001 From: Daniel Dias Date: Fri, 5 Jul 2024 15:53:29 -0300 Subject: [PATCH] wip --- .github/workflows/deploy-main.yml | 4 +- .github/workflows/pull-request.yaml | 2 +- .github/workflows/release-candidate.yml | 2 +- .github/workflows/release-version.yml | 2 +- Makefile | 2 +- api/users.yaml | 36 + server/openapi/api.go | 66 +- server/openapi/api_api.go | 685 +++++++- server/openapi/api_resource_api.go | 238 +++ server/openapi/api_resource_api_service.go | 156 ++ server/openapi/model_alert.go | 40 + server/openapi/model_alert_result.go | 40 + server/openapi/model_environment.go | 56 + server/openapi/model_environment_resource.go | 36 + server/openapi/model_environment_resources.go | 38 + .../model_get_monitor_runs_200_response.go | 38 + server/openapi/model_invite.go | 67 + server/openapi/model_invite_environment.go | 48 + server/openapi/model_invite_resource.go | 36 + server/openapi/model_invite_resources.go | 38 + server/openapi/model_monitor.go | 90 ++ server/openapi/model_monitor_resource.go | 39 + server/openapi/model_monitor_resource_list.go | 38 + server/openapi/model_monitor_run.go | 85 + .../model_playwright_engine_request.go | 35 + .../model_playwright_engine_response.go | 31 + .../model_polling_profile_spec_periodic.go | 2 + server/openapi/model_role.go | 40 + server/openapi/model_run_group_run.go | 73 - .../openapi/model_run_monitor_information.go | 42 + server/openapi/model_schedule.go | 33 + server/openapi/model_summary.go | 39 + server/openapi/model_test_.go | 2 +- server/openapi/model_token.go | 64 + server/openapi/model_tokens.go | 38 + server/openapi/model_trigger.go | 5 + .../model_trigger_result_trigger_result.go | 5 + server/openapi/model_variable_set_value.go | 2 + server/openapi/model_webhook.go | 44 + server/openapi/model_webhook_result.go | 39 + .../openapi/model_webhook_result_request.go | 42 + .../openapi/model_webhook_result_response.go | 44 + web/src/types/Generated.types.ts | 1439 +++++++++++++++-- 43 files changed, 3631 insertions(+), 270 deletions(-) create mode 100644 api/users.yaml create mode 100644 server/openapi/model_alert.go create mode 100644 server/openapi/model_alert_result.go create mode 100644 server/openapi/model_environment.go create mode 100644 server/openapi/model_environment_resource.go create mode 100644 server/openapi/model_environment_resources.go create mode 100644 server/openapi/model_get_monitor_runs_200_response.go create mode 100644 server/openapi/model_invite.go create mode 100644 server/openapi/model_invite_environment.go create mode 100644 server/openapi/model_invite_resource.go create mode 100644 server/openapi/model_invite_resources.go create mode 100644 server/openapi/model_monitor.go create mode 100644 server/openapi/model_monitor_resource.go create mode 100644 server/openapi/model_monitor_resource_list.go create mode 100644 server/openapi/model_monitor_run.go create mode 100644 server/openapi/model_playwright_engine_request.go create mode 100644 server/openapi/model_playwright_engine_response.go create mode 100644 server/openapi/model_role.go delete mode 100644 server/openapi/model_run_group_run.go create mode 100644 server/openapi/model_run_monitor_information.go create mode 100644 server/openapi/model_schedule.go create mode 100644 server/openapi/model_summary.go create mode 100644 server/openapi/model_token.go create mode 100644 server/openapi/model_tokens.go create mode 100644 server/openapi/model_webhook.go create mode 100644 server/openapi/model_webhook_result.go create mode 100644 server/openapi/model_webhook_result_request.go create mode 100644 server/openapi/model_webhook_result_response.go diff --git a/.github/workflows/deploy-main.yml b/.github/workflows/deploy-main.yml index 33d7a1e43d..af81921ded 100644 --- a/.github/workflows/deploy-main.yml +++ b/.github/workflows/deploy-main.yml @@ -87,7 +87,7 @@ jobs: if: steps.cache.outputs.cache-hit != 'true' with: distribution: goreleaser-pro - version: v1.23.0 + version: v2.0.1 args: release --clean --split --nightly env: GOOS: ${{ matrix.GOOS }} @@ -153,7 +153,7 @@ jobs: if: steps.cache.outputs.cache-hit != 'true' with: distribution: goreleaser-pro - version: v1.23.0 + version: v2.0.1 args: continue --merge env: VERSION: sha-${{ env.sha_short }} diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index 16b0ab464f..5a00716d4f 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -172,7 +172,7 @@ jobs: uses: goreleaser/goreleaser-action@v4 with: distribution: goreleaser-pro - version: v1.23.0 + version: v2.0.1 args: release --skip=announce --snapshot -f .goreleaser.dev.yaml - name: Move binaries to known location diff --git a/.github/workflows/release-candidate.yml b/.github/workflows/release-candidate.yml index 45c2dd6b89..2d8f1be2d9 100644 --- a/.github/workflows/release-candidate.yml +++ b/.github/workflows/release-candidate.yml @@ -82,7 +82,7 @@ jobs: if: steps.cache.outputs.cache-hit != 'true' with: distribution: goreleaser-pro - version: v1.23.0 + version: v2.0.1 args: release --clean -f .goreleaser.rc.yaml env: VERSION: ${{ github.ref_name}} diff --git a/.github/workflows/release-version.yml b/.github/workflows/release-version.yml index e25dd5e7fd..5956c8a08d 100644 --- a/.github/workflows/release-version.yml +++ b/.github/workflows/release-version.yml @@ -93,7 +93,7 @@ jobs: if: steps.cache.outputs.cache-hit != 'true' with: distribution: goreleaser-pro - version: v1.23.0 + version: v2.0.1 args: release --clean env: VERSION: ${{ github.ref_name}} diff --git a/Makefile b/Makefile index 809fc06971..f55350736e 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ export VERSION?=dev export TRACETEST_DEFAULT_CLOUD_ENDPOINT=https://app.tracetest.io TAG?=$(VERSION) -GORELEASER_VERSION=1.23.0-pro +GORELEASER_VERSION=2.0.1-pro PROJECT_ROOT=${PWD} diff --git a/api/users.yaml b/api/users.yaml new file mode 100644 index 0000000000..fc5e0eb390 --- /dev/null +++ b/api/users.yaml @@ -0,0 +1,36 @@ +openapi: 3.0.1 + +components: + requestBodies: + AfterLogin: + description: After login request + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/AfterLogin" + schemas: + AfterLogin: + type: object + properties: + userId: + type: string + email: + type: string + name: + type: string + User: + required: + - id + - name + - emails + type: object + properties: + id: + type: string + name: + type: string + emails: + type: array + items: + type: string diff --git a/server/openapi/api.go b/server/openapi/api.go index 5a588652b0..96257a0423 100644 --- a/server/openapi/api.go +++ b/server/openapi/api.go @@ -18,18 +18,29 @@ import ( // The ApiApiRouter implementation should parse necessary information from the http request, // pass the data to a ApiApiServicer to perform the required actions, then write the service results to the http response. type ApiApiRouter interface { + CreateEnvironment(http.ResponseWriter, *http.Request) + CreateInvite(http.ResponseWriter, *http.Request) CreateRunGroup(http.ResponseWriter, *http.Request) + CreateToken(http.ResponseWriter, *http.Request) + DeleteEnvironment(http.ResponseWriter, *http.Request) + DeleteInvite(http.ResponseWriter, *http.Request) + DeleteMonitorRun(http.ResponseWriter, *http.Request) DeleteTestRun(http.ResponseWriter, *http.Request) DeleteTestSuiteRun(http.ResponseWriter, *http.Request) + DeleteToken(http.ResponseWriter, *http.Request) DryRunAssertion(http.ResponseWriter, *http.Request) ExportTestRun(http.ResponseWriter, *http.Request) ExpressionResolve(http.ResponseWriter, *http.Request) + GetEnvironment(http.ResponseWriter, *http.Request) + GetInvite(http.ResponseWriter, *http.Request) + GetMonitorRun(http.ResponseWriter, *http.Request) + GetMonitorRuns(http.ResponseWriter, *http.Request) + GetMonitorVersion(http.ResponseWriter, *http.Request) GetOTLPConnectionInformation(http.ResponseWriter, *http.Request) GetResources(http.ResponseWriter, *http.Request) GetRunGroup(http.ResponseWriter, *http.Request) GetRunGroups(http.ResponseWriter, *http.Request) GetRunResultJUnit(http.ResponseWriter, *http.Request) - GetRunsFromRunGroup(http.ResponseWriter, *http.Request) GetTestResultSelectedSpans(http.ResponseWriter, *http.Request) GetTestRun(http.ResponseWriter, *http.Request) GetTestRunEvents(http.ResponseWriter, *http.Request) @@ -42,16 +53,27 @@ type ApiApiRouter interface { GetVersion(http.ResponseWriter, *http.Request) GetWizard(http.ResponseWriter, *http.Request) ImportTestRun(http.ResponseWriter, *http.Request) + ListEnvironments(http.ResponseWriter, *http.Request) + ListInvites(http.ResponseWriter, *http.Request) + ListTokens(http.ResponseWriter, *http.Request) RerunTestRun(http.ResponseWriter, *http.Request) ResetOTLPConnectionInformation(http.ResponseWriter, *http.Request) + RunMonitor(http.ResponseWriter, *http.Request) RunTest(http.ResponseWriter, *http.Request) RunTestSuite(http.ResponseWriter, *http.Request) SearchSpans(http.ResponseWriter, *http.Request) SkipTraceCollection(http.ResponseWriter, *http.Request) StopTestRun(http.ResponseWriter, *http.Request) + TestAlert(http.ResponseWriter, *http.Request) TestConnection(http.ResponseWriter, *http.Request) + UpdateEnvironment(http.ResponseWriter, *http.Request) + UpdateInvite(http.ResponseWriter, *http.Request) UpdateTestRun(http.ResponseWriter, *http.Request) + UpdateToken(http.ResponseWriter, *http.Request) UpdateWizard(http.ResponseWriter, *http.Request) + UpsertEnvironment(http.ResponseWriter, *http.Request) + UpsertInvite(http.ResponseWriter, *http.Request) + UpsertToken(http.ResponseWriter, *http.Request) } // ResourceApiApiRouter defines the required methods for binding the api requests to a responses for the ResourceApiApi @@ -60,11 +82,15 @@ type ApiApiRouter interface { type ResourceApiApiRouter interface { CreateDemo(http.ResponseWriter, *http.Request) CreateLinter(http.ResponseWriter, *http.Request) + CreatePollingProfile(http.ResponseWriter, *http.Request) CreateTest(http.ResponseWriter, *http.Request) CreateTestSuite(http.ResponseWriter, *http.Request) CreateVariableSet(http.ResponseWriter, *http.Request) + CreteMonitor(http.ResponseWriter, *http.Request) DeleteDemo(http.ResponseWriter, *http.Request) DeleteLinter(http.ResponseWriter, *http.Request) + DeleteMonitor(http.ResponseWriter, *http.Request) + DeletePollingProfile(http.ResponseWriter, *http.Request) DeleteTest(http.ResponseWriter, *http.Request) DeleteTestSuite(http.ResponseWriter, *http.Request) DeleteVariableSet(http.ResponseWriter, *http.Request) @@ -72,6 +98,7 @@ type ResourceApiApiRouter interface { GetDataStore(http.ResponseWriter, *http.Request) GetDemo(http.ResponseWriter, *http.Request) GetLinter(http.ResponseWriter, *http.Request) + GetMonitor(http.ResponseWriter, *http.Request) GetPollingProfile(http.ResponseWriter, *http.Request) GetTest(http.ResponseWriter, *http.Request) GetTestSuite(http.ResponseWriter, *http.Request) @@ -82,16 +109,20 @@ type ResourceApiApiRouter interface { ListDataStore(http.ResponseWriter, *http.Request) ListDemos(http.ResponseWriter, *http.Request) ListLinters(http.ResponseWriter, *http.Request) + ListMonitors(http.ResponseWriter, *http.Request) ListPollingProfile(http.ResponseWriter, *http.Request) ListVariableSets(http.ResponseWriter, *http.Request) UpdateConfiguration(http.ResponseWriter, *http.Request) UpdateDataStore(http.ResponseWriter, *http.Request) UpdateDemo(http.ResponseWriter, *http.Request) UpdateLinter(http.ResponseWriter, *http.Request) + UpdateMonitor(http.ResponseWriter, *http.Request) UpdatePollingProfile(http.ResponseWriter, *http.Request) UpdateTest(http.ResponseWriter, *http.Request) UpdateTestSuite(http.ResponseWriter, *http.Request) UpdateVariableSet(http.ResponseWriter, *http.Request) + UpsertMonitor(http.ResponseWriter, *http.Request) + UpsertPollingProfile(http.ResponseWriter, *http.Request) UpsertTest(http.ResponseWriter, *http.Request) } @@ -100,18 +131,29 @@ type ResourceApiApiRouter interface { // while the service implementation can be ignored with the .openapi-generator-ignore file // and updated with the logic required for the API. type ApiApiServicer interface { + CreateEnvironment(context.Context, EnvironmentResource) (ImplResponse, error) + CreateInvite(context.Context, InviteResource) (ImplResponse, error) CreateRunGroup(context.Context, RunGroup) (ImplResponse, error) + CreateToken(context.Context, Token) (ImplResponse, error) + DeleteEnvironment(context.Context, string) (ImplResponse, error) + DeleteInvite(context.Context, string) (ImplResponse, error) + DeleteMonitorRun(context.Context, string, int32) (ImplResponse, error) DeleteTestRun(context.Context, string, int32) (ImplResponse, error) DeleteTestSuiteRun(context.Context, string, int32) (ImplResponse, error) + DeleteToken(context.Context, string) (ImplResponse, error) DryRunAssertion(context.Context, string, int32, TestSpecs) (ImplResponse, error) ExportTestRun(context.Context, string, int32) (ImplResponse, error) ExpressionResolve(context.Context, ResolveRequestInfo) (ImplResponse, error) + GetEnvironment(context.Context, string) (ImplResponse, error) + GetInvite(context.Context, string) (ImplResponse, error) + GetMonitorRun(context.Context, string, int32) (ImplResponse, error) + GetMonitorRuns(context.Context, string, int32, int32) (ImplResponse, error) + GetMonitorVersion(context.Context, string, int32) (ImplResponse, error) GetOTLPConnectionInformation(context.Context) (ImplResponse, error) GetResources(context.Context, int32, int32, string, string, string) (ImplResponse, error) GetRunGroup(context.Context, string) (ImplResponse, error) GetRunGroups(context.Context, int32, int32, string, string, string) (ImplResponse, error) GetRunResultJUnit(context.Context, string, int32) (ImplResponse, error) - GetRunsFromRunGroup(context.Context, int32, int32, string) (ImplResponse, error) GetTestResultSelectedSpans(context.Context, string, int32, string) (ImplResponse, error) GetTestRun(context.Context, string, int32) (ImplResponse, error) GetTestRunEvents(context.Context, string, int32) (ImplResponse, error) @@ -124,16 +166,27 @@ type ApiApiServicer interface { GetVersion(context.Context, string) (ImplResponse, error) GetWizard(context.Context) (ImplResponse, error) ImportTestRun(context.Context, ExportedTestInformation) (ImplResponse, error) + ListEnvironments(context.Context, int32, int32, string, string) (ImplResponse, error) + ListInvites(context.Context, int32, int32, string, string) (ImplResponse, error) + ListTokens(context.Context, int32, int32, string, string) (ImplResponse, error) RerunTestRun(context.Context, string, int32) (ImplResponse, error) ResetOTLPConnectionInformation(context.Context) (ImplResponse, error) + RunMonitor(context.Context, string, RunMonitorInformation) (ImplResponse, error) RunTest(context.Context, string, RunInformation) (ImplResponse, error) RunTestSuite(context.Context, string, RunInformation) (ImplResponse, error) SearchSpans(context.Context, string, int32, SearchSpansRequest) (ImplResponse, error) SkipTraceCollection(context.Context, string, int32) (ImplResponse, error) StopTestRun(context.Context, string, int32) (ImplResponse, error) + TestAlert(context.Context, Alert) (ImplResponse, error) TestConnection(context.Context, DataStore) (ImplResponse, error) + UpdateEnvironment(context.Context, string, EnvironmentResource) (ImplResponse, error) + UpdateInvite(context.Context, string, InviteResource) (ImplResponse, error) UpdateTestRun(context.Context, string, int32, TestRun) (ImplResponse, error) + UpdateToken(context.Context, string) (ImplResponse, error) UpdateWizard(context.Context, Wizard) (ImplResponse, error) + UpsertEnvironment(context.Context, EnvironmentResource) (ImplResponse, error) + UpsertInvite(context.Context, InviteResource) (ImplResponse, error) + UpsertToken(context.Context, Token) (ImplResponse, error) } // ResourceApiApiServicer defines the api actions for the ResourceApiApi service @@ -143,11 +196,15 @@ type ApiApiServicer interface { type ResourceApiApiServicer interface { CreateDemo(context.Context, Demo) (ImplResponse, error) CreateLinter(context.Context, LinterResource) (ImplResponse, error) + CreatePollingProfile(context.Context, PollingProfile) (ImplResponse, error) CreateTest(context.Context, TestResource) (ImplResponse, error) CreateTestSuite(context.Context, TestSuiteResource) (ImplResponse, error) CreateVariableSet(context.Context, VariableSetResource) (ImplResponse, error) + CreteMonitor(context.Context, MonitorResource) (ImplResponse, error) DeleteDemo(context.Context, string) (ImplResponse, error) DeleteLinter(context.Context, string) (ImplResponse, error) + DeleteMonitor(context.Context, string) (ImplResponse, error) + DeletePollingProfile(context.Context, string) (ImplResponse, error) DeleteTest(context.Context, string) (ImplResponse, error) DeleteTestSuite(context.Context, string) (ImplResponse, error) DeleteVariableSet(context.Context, string) (ImplResponse, error) @@ -155,6 +212,7 @@ type ResourceApiApiServicer interface { GetDataStore(context.Context, string) (ImplResponse, error) GetDemo(context.Context, string) (ImplResponse, error) GetLinter(context.Context, string) (ImplResponse, error) + GetMonitor(context.Context, string) (ImplResponse, error) GetPollingProfile(context.Context, string) (ImplResponse, error) GetTest(context.Context, string) (ImplResponse, error) GetTestSuite(context.Context, string) (ImplResponse, error) @@ -165,15 +223,19 @@ type ResourceApiApiServicer interface { ListDataStore(context.Context, int32, int32, string, string) (ImplResponse, error) ListDemos(context.Context, int32, int32, string, string) (ImplResponse, error) ListLinters(context.Context, int32, int32, string, string) (ImplResponse, error) + ListMonitors(context.Context) (ImplResponse, error) ListPollingProfile(context.Context, int32, int32, string, string) (ImplResponse, error) ListVariableSets(context.Context, int32, int32, string, string) (ImplResponse, error) UpdateConfiguration(context.Context, string, ConfigurationResource) (ImplResponse, error) UpdateDataStore(context.Context, string, DataStore) (ImplResponse, error) UpdateDemo(context.Context, string, Demo) (ImplResponse, error) UpdateLinter(context.Context, string, LinterResource) (ImplResponse, error) + UpdateMonitor(context.Context, string, MonitorResource) (ImplResponse, error) UpdatePollingProfile(context.Context, string, PollingProfile) (ImplResponse, error) UpdateTest(context.Context, string, TestResource) (ImplResponse, error) UpdateTestSuite(context.Context, string, TestSuiteResource) (ImplResponse, error) UpdateVariableSet(context.Context, string, VariableSetResource) (ImplResponse, error) + UpsertMonitor(context.Context, MonitorResource) (ImplResponse, error) + UpsertPollingProfile(context.Context, PollingProfile) (ImplResponse, error) UpsertTest(context.Context, TestResource) (ImplResponse, error) } diff --git a/server/openapi/api_api.go b/server/openapi/api_api.go index af4d82a72d..f399757707 100644 --- a/server/openapi/api_api.go +++ b/server/openapi/api_api.go @@ -50,12 +50,48 @@ func NewApiApiController(s ApiApiServicer, opts ...ApiApiOption) Router { // Routes returns all the api routes for the ApiApiController func (c *ApiApiController) Routes() Routes { return Routes{ + { + "CreateEnvironment", + strings.ToUpper("Post"), + "/api/environments", + c.CreateEnvironment, + }, + { + "CreateInvite", + strings.ToUpper("Post"), + "/api/invites", + c.CreateInvite, + }, { "CreateRunGroup", strings.ToUpper("Post"), "/api/rungroups", c.CreateRunGroup, }, + { + "CreateToken", + strings.ToUpper("Post"), + "/api/tokens", + c.CreateToken, + }, + { + "DeleteEnvironment", + strings.ToUpper("Delete"), + "/api/environments/{environmentID}", + c.DeleteEnvironment, + }, + { + "DeleteInvite", + strings.ToUpper("Delete"), + "/api/invites/{inviteID}", + c.DeleteInvite, + }, + { + "DeleteMonitorRun", + strings.ToUpper("Delete"), + "/api/monitors/{monitorId}/run/{runId}", + c.DeleteMonitorRun, + }, { "DeleteTestRun", strings.ToUpper("Delete"), @@ -68,6 +104,12 @@ func (c *ApiApiController) Routes() Routes { "/api/testsuites/{testSuiteId}/run/{runId}", c.DeleteTestSuiteRun, }, + { + "DeleteToken", + strings.ToUpper("Delete"), + "/api/tokens/{tokenID}", + c.DeleteToken, + }, { "DryRunAssertion", strings.ToUpper("Put"), @@ -86,6 +128,36 @@ func (c *ApiApiController) Routes() Routes { "/api/expressions/resolve", c.ExpressionResolve, }, + { + "GetEnvironment", + strings.ToUpper("Get"), + "/api/environments/{environmentID}", + c.GetEnvironment, + }, + { + "GetInvite", + strings.ToUpper("Get"), + "/api/invites/{inviteID}", + c.GetInvite, + }, + { + "GetMonitorRun", + strings.ToUpper("Get"), + "/api/monitors/{monitorId}/run/{runId}", + c.GetMonitorRun, + }, + { + "GetMonitorRuns", + strings.ToUpper("Get"), + "/api/monitors/{monitorId}/run", + c.GetMonitorRuns, + }, + { + "GetMonitorVersion", + strings.ToUpper("Get"), + "/api/monitors/{monitorId}/version/{version}", + c.GetMonitorVersion, + }, { "GetOTLPConnectionInformation", strings.ToUpper("Get"), @@ -116,12 +188,6 @@ func (c *ApiApiController) Routes() Routes { "/api/tests/{testId}/run/{runId}/junit.xml", c.GetRunResultJUnit, }, - { - "GetRunsFromRunGroup", - strings.ToUpper("Get"), - "/api/runs", - c.GetRunsFromRunGroup, - }, { "GetTestResultSelectedSpans", strings.ToUpper("Get"), @@ -194,6 +260,24 @@ func (c *ApiApiController) Routes() Routes { "/api/tests/import", c.ImportTestRun, }, + { + "ListEnvironments", + strings.ToUpper("Get"), + "/api/environments", + c.ListEnvironments, + }, + { + "ListInvites", + strings.ToUpper("Get"), + "/api/invites", + c.ListInvites, + }, + { + "ListTokens", + strings.ToUpper("Get"), + "/api/tokens", + c.ListTokens, + }, { "RerunTestRun", strings.ToUpper("Post"), @@ -206,6 +290,12 @@ func (c *ApiApiController) Routes() Routes { "/api/config/connection/otlp/reset", c.ResetOTLPConnectionInformation, }, + { + "RunMonitor", + strings.ToUpper("Post"), + "/api/monitors/{monitorId}/run", + c.RunMonitor, + }, { "RunTest", strings.ToUpper("Post"), @@ -236,25 +326,115 @@ func (c *ApiApiController) Routes() Routes { "/api/tests/{testId}/run/{runId}/stop", c.StopTestRun, }, + { + "TestAlert", + strings.ToUpper("Post"), + "/api/monitors/alerts", + c.TestAlert, + }, { "TestConnection", strings.ToUpper("Post"), "/api/config/connection", c.TestConnection, }, + { + "UpdateEnvironment", + strings.ToUpper("Put"), + "/api/environments/{environmentID}", + c.UpdateEnvironment, + }, + { + "UpdateInvite", + strings.ToUpper("Put"), + "/api/invites/{inviteID}", + c.UpdateInvite, + }, { "UpdateTestRun", strings.ToUpper("Patch"), "/api/tests/{testId}/run/{runId}", c.UpdateTestRun, }, + { + "UpdateToken", + strings.ToUpper("Put"), + "/api/tokens/{tokenID}", + c.UpdateToken, + }, { "UpdateWizard", strings.ToUpper("Put"), "/api/wizard", c.UpdateWizard, }, + { + "UpsertEnvironment", + strings.ToUpper("Put"), + "/api/environments", + c.UpsertEnvironment, + }, + { + "UpsertInvite", + strings.ToUpper("Put"), + "/api/invites", + c.UpsertInvite, + }, + { + "UpsertToken", + strings.ToUpper("Put"), + "/api/tokens", + c.UpsertToken, + }, + } +} + +// CreateEnvironment - Create new environment +func (c *ApiApiController) CreateEnvironment(w http.ResponseWriter, r *http.Request) { + environmentResourceParam := EnvironmentResource{} + d := json.NewDecoder(r.Body) + d.DisallowUnknownFields() + if err := d.Decode(&environmentResourceParam); err != nil { + c.errorHandler(w, r, &ParsingError{Err: err}, nil) + return + } + if err := AssertEnvironmentResourceRequired(environmentResourceParam); err != nil { + c.errorHandler(w, r, err, nil) + return + } + result, err := c.service.CreateEnvironment(r.Context(), environmentResourceParam) + // If an error occurred, encode the error with the status code + if err != nil { + c.errorHandler(w, r, err, &result) + return + } + // If no error, encode the body and the result code + EncodeJSONResponse(result.Body, &result.Code, w) + +} + +// CreateInvite - Creates a pending invite +func (c *ApiApiController) CreateInvite(w http.ResponseWriter, r *http.Request) { + inviteResourceParam := InviteResource{} + d := json.NewDecoder(r.Body) + d.DisallowUnknownFields() + if err := d.Decode(&inviteResourceParam); err != nil { + c.errorHandler(w, r, &ParsingError{Err: err}, nil) + return + } + if err := AssertInviteResourceRequired(inviteResourceParam); err != nil { + c.errorHandler(w, r, err, nil) + return + } + result, err := c.service.CreateInvite(r.Context(), inviteResourceParam) + // If an error occurred, encode the error with the status code + if err != nil { + c.errorHandler(w, r, err, &result) + return } + // If no error, encode the body and the result code + EncodeJSONResponse(result.Body, &result.Code, w) + } // CreateRunGroup - Create a RunGroup @@ -281,6 +461,84 @@ func (c *ApiApiController) CreateRunGroup(w http.ResponseWriter, r *http.Request } +// CreateToken - Creates a new token +func (c *ApiApiController) CreateToken(w http.ResponseWriter, r *http.Request) { + tokenParam := Token{} + d := json.NewDecoder(r.Body) + d.DisallowUnknownFields() + if err := d.Decode(&tokenParam); err != nil { + c.errorHandler(w, r, &ParsingError{Err: err}, nil) + return + } + if err := AssertTokenRequired(tokenParam); err != nil { + c.errorHandler(w, r, err, nil) + return + } + result, err := c.service.CreateToken(r.Context(), tokenParam) + // If an error occurred, encode the error with the status code + if err != nil { + c.errorHandler(w, r, err, &result) + return + } + // If no error, encode the body and the result code + EncodeJSONResponse(result.Body, &result.Code, w) + +} + +// DeleteEnvironment - Delete test environment +func (c *ApiApiController) DeleteEnvironment(w http.ResponseWriter, r *http.Request) { + params := mux.Vars(r) + environmentIDParam := params["environmentID"] + + result, err := c.service.DeleteEnvironment(r.Context(), environmentIDParam) + // If an error occurred, encode the error with the status code + if err != nil { + c.errorHandler(w, r, err, &result) + return + } + // If no error, encode the body and the result code + EncodeJSONResponse(result.Body, &result.Code, w) + +} + +// DeleteInvite - Delete pending invite +func (c *ApiApiController) DeleteInvite(w http.ResponseWriter, r *http.Request) { + params := mux.Vars(r) + inviteIDParam := params["inviteID"] + + result, err := c.service.DeleteInvite(r.Context(), inviteIDParam) + // If an error occurred, encode the error with the status code + if err != nil { + c.errorHandler(w, r, err, &result) + return + } + // If no error, encode the body and the result code + EncodeJSONResponse(result.Body, &result.Code, w) + +} + +// DeleteMonitorRun - Delete a Monitor +func (c *ApiApiController) DeleteMonitorRun(w http.ResponseWriter, r *http.Request) { + params := mux.Vars(r) + monitorIdParam := params["monitorId"] + + runIdParam, err := parseInt32Parameter(params["runId"], true) + if err != nil { + c.errorHandler(w, r, &ParsingError{Err: err}, nil) + return + } + + result, err := c.service.DeleteMonitorRun(r.Context(), monitorIdParam, runIdParam) + // If an error occurred, encode the error with the status code + if err != nil { + c.errorHandler(w, r, err, &result) + return + } + // If no error, encode the body and the result code + EncodeJSONResponse(result.Body, &result.Code, w) + +} + // DeleteTestRun - delete a test run func (c *ApiApiController) DeleteTestRun(w http.ResponseWriter, r *http.Request) { params := mux.Vars(r) @@ -325,6 +583,22 @@ func (c *ApiApiController) DeleteTestSuiteRun(w http.ResponseWriter, r *http.Req } +// DeleteToken - Delete token for environment +func (c *ApiApiController) DeleteToken(w http.ResponseWriter, r *http.Request) { + params := mux.Vars(r) + tokenIDParam := params["tokenID"] + + result, err := c.service.DeleteToken(r.Context(), tokenIDParam) + // If an error occurred, encode the error with the status code + if err != nil { + c.errorHandler(w, r, err, &result) + return + } + // If no error, encode the body and the result code + EncodeJSONResponse(result.Body, &result.Code, w) + +} + // DryRunAssertion - run given assertions against the traces from the given run without persisting anything func (c *ApiApiController) DryRunAssertion(w http.ResponseWriter, r *http.Request) { params := mux.Vars(r) @@ -404,6 +678,109 @@ func (c *ApiApiController) ExpressionResolve(w http.ResponseWriter, r *http.Requ } +// GetEnvironment - Get environment by ID +func (c *ApiApiController) GetEnvironment(w http.ResponseWriter, r *http.Request) { + params := mux.Vars(r) + environmentIDParam := params["environmentID"] + + result, err := c.service.GetEnvironment(r.Context(), environmentIDParam) + // If an error occurred, encode the error with the status code + if err != nil { + c.errorHandler(w, r, err, &result) + return + } + // If no error, encode the body and the result code + EncodeJSONResponse(result.Body, &result.Code, w) + +} + +// GetInvite - Get invite +func (c *ApiApiController) GetInvite(w http.ResponseWriter, r *http.Request) { + params := mux.Vars(r) + inviteIDParam := params["inviteID"] + + result, err := c.service.GetInvite(r.Context(), inviteIDParam) + // If an error occurred, encode the error with the status code + if err != nil { + c.errorHandler(w, r, err, &result) + return + } + // If no error, encode the body and the result code + EncodeJSONResponse(result.Body, &result.Code, w) + +} + +// GetMonitorRun - Get a specific run from a particular Monitor +func (c *ApiApiController) GetMonitorRun(w http.ResponseWriter, r *http.Request) { + params := mux.Vars(r) + monitorIdParam := params["monitorId"] + + runIdParam, err := parseInt32Parameter(params["runId"], true) + if err != nil { + c.errorHandler(w, r, &ParsingError{Err: err}, nil) + return + } + + result, err := c.service.GetMonitorRun(r.Context(), monitorIdParam, runIdParam) + // If an error occurred, encode the error with the status code + if err != nil { + c.errorHandler(w, r, err, &result) + return + } + // If no error, encode the body and the result code + EncodeJSONResponse(result.Body, &result.Code, w) + +} + +// GetMonitorRuns - Get a Monitor runs +func (c *ApiApiController) GetMonitorRuns(w http.ResponseWriter, r *http.Request) { + params := mux.Vars(r) + query := r.URL.Query() + monitorIdParam := params["monitorId"] + + takeParam, err := parseInt32Parameter(query.Get("take"), false) + if err != nil { + c.errorHandler(w, r, &ParsingError{Err: err}, nil) + return + } + skipParam, err := parseInt32Parameter(query.Get("skip"), false) + if err != nil { + c.errorHandler(w, r, &ParsingError{Err: err}, nil) + return + } + result, err := c.service.GetMonitorRuns(r.Context(), monitorIdParam, takeParam, skipParam) + // If an error occurred, encode the error with the status code + if err != nil { + c.errorHandler(w, r, err, &result) + return + } + // If no error, encode the body and the result code + EncodeJSONResponse(result.Body, &result.Code, w) + +} + +// GetMonitorVersion - Get a Monitor with Version +func (c *ApiApiController) GetMonitorVersion(w http.ResponseWriter, r *http.Request) { + params := mux.Vars(r) + monitorIdParam := params["monitorId"] + + versionParam, err := parseInt32Parameter(params["version"], true) + if err != nil { + c.errorHandler(w, r, &ParsingError{Err: err}, nil) + return + } + + result, err := c.service.GetMonitorVersion(r.Context(), monitorIdParam, versionParam) + // If an error occurred, encode the error with the status code + if err != nil { + c.errorHandler(w, r, err, &result) + return + } + // If no error, encode the body and the result code + EncodeJSONResponse(result.Body, &result.Code, w) + +} + // GetOTLPConnectionInformation - get information about the OTLP connection func (c *ApiApiController) GetOTLPConnectionInformation(w http.ResponseWriter, r *http.Request) { result, err := c.service.GetOTLPConnectionInformation(r.Context()) @@ -509,31 +886,6 @@ func (c *ApiApiController) GetRunResultJUnit(w http.ResponseWriter, r *http.Requ } -// GetRunsFromRunGroup - Get all runs from a run group -func (c *ApiApiController) GetRunsFromRunGroup(w http.ResponseWriter, r *http.Request) { - query := r.URL.Query() - takeParam, err := parseInt32Parameter(query.Get("take"), false) - if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) - return - } - skipParam, err := parseInt32Parameter(query.Get("skip"), false) - if err != nil { - c.errorHandler(w, r, &ParsingError{Err: err}, nil) - return - } - runGroupIdsParam := query.Get("runGroupIds") - result, err := c.service.GetRunsFromRunGroup(r.Context(), takeParam, skipParam, runGroupIdsParam) - // If an error occurred, encode the error with the status code - if err != nil { - c.errorHandler(w, r, err, &result) - return - } - // If no error, encode the body and the result code - EncodeJSONResponse(result.Body, &result.Code, w) - -} - // GetTestResultSelectedSpans - retrieve spans that will be selected by selector func (c *ApiApiController) GetTestResultSelectedSpans(w http.ResponseWriter, r *http.Request) { params := mux.Vars(r) @@ -791,6 +1143,84 @@ func (c *ApiApiController) ImportTestRun(w http.ResponseWriter, r *http.Request) } +// ListEnvironments - List environments +func (c *ApiApiController) ListEnvironments(w http.ResponseWriter, r *http.Request) { + query := r.URL.Query() + takeParam, err := parseInt32Parameter(query.Get("take"), false) + if err != nil { + c.errorHandler(w, r, &ParsingError{Err: err}, nil) + return + } + skipParam, err := parseInt32Parameter(query.Get("skip"), false) + if err != nil { + c.errorHandler(w, r, &ParsingError{Err: err}, nil) + return + } + queryParam := query.Get("query") + sortDirectionParam := query.Get("sortDirection") + result, err := c.service.ListEnvironments(r.Context(), takeParam, skipParam, queryParam, sortDirectionParam) + // If an error occurred, encode the error with the status code + if err != nil { + c.errorHandler(w, r, err, &result) + return + } + // If no error, encode the body and the result code + EncodeJSONResponse(result.Body, &result.Code, w) + +} + +// ListInvites - Lists all invites +func (c *ApiApiController) ListInvites(w http.ResponseWriter, r *http.Request) { + query := r.URL.Query() + takeParam, err := parseInt32Parameter(query.Get("take"), false) + if err != nil { + c.errorHandler(w, r, &ParsingError{Err: err}, nil) + return + } + skipParam, err := parseInt32Parameter(query.Get("skip"), false) + if err != nil { + c.errorHandler(w, r, &ParsingError{Err: err}, nil) + return + } + queryParam := query.Get("query") + sortDirectionParam := query.Get("sortDirection") + result, err := c.service.ListInvites(r.Context(), takeParam, skipParam, queryParam, sortDirectionParam) + // If an error occurred, encode the error with the status code + if err != nil { + c.errorHandler(w, r, err, &result) + return + } + // If no error, encode the body and the result code + EncodeJSONResponse(result.Body, &result.Code, w) + +} + +// ListTokens - Lists all tokens +func (c *ApiApiController) ListTokens(w http.ResponseWriter, r *http.Request) { + query := r.URL.Query() + takeParam, err := parseInt32Parameter(query.Get("take"), false) + if err != nil { + c.errorHandler(w, r, &ParsingError{Err: err}, nil) + return + } + skipParam, err := parseInt32Parameter(query.Get("skip"), false) + if err != nil { + c.errorHandler(w, r, &ParsingError{Err: err}, nil) + return + } + queryParam := query.Get("query") + sortDirectionParam := query.Get("sortDirection") + result, err := c.service.ListTokens(r.Context(), takeParam, skipParam, queryParam, sortDirectionParam) + // If an error occurred, encode the error with the status code + if err != nil { + c.errorHandler(w, r, err, &result) + return + } + // If no error, encode the body and the result code + EncodeJSONResponse(result.Body, &result.Code, w) + +} + // RerunTestRun - rerun a test run func (c *ApiApiController) RerunTestRun(w http.ResponseWriter, r *http.Request) { params := mux.Vars(r) @@ -826,6 +1256,33 @@ func (c *ApiApiController) ResetOTLPConnectionInformation(w http.ResponseWriter, } +// RunMonitor - run Monitor +func (c *ApiApiController) RunMonitor(w http.ResponseWriter, r *http.Request) { + params := mux.Vars(r) + monitorIdParam := params["monitorId"] + + runMonitorInformationParam := RunMonitorInformation{} + d := json.NewDecoder(r.Body) + d.DisallowUnknownFields() + if err := d.Decode(&runMonitorInformationParam); err != nil { + c.errorHandler(w, r, &ParsingError{Err: err}, nil) + return + } + if err := AssertRunMonitorInformationRequired(runMonitorInformationParam); err != nil { + c.errorHandler(w, r, err, nil) + return + } + result, err := c.service.RunMonitor(r.Context(), monitorIdParam, runMonitorInformationParam) + // If an error occurred, encode the error with the status code + if err != nil { + c.errorHandler(w, r, err, &result) + return + } + // If no error, encode the body and the result code + EncodeJSONResponse(result.Body, &result.Code, w) + +} + // RunTest - run test func (c *ApiApiController) RunTest(w http.ResponseWriter, r *http.Request) { params := mux.Vars(r) @@ -957,6 +1414,30 @@ func (c *ApiApiController) StopTestRun(w http.ResponseWriter, r *http.Request) { } +// TestAlert - Tests the alert trigger +func (c *ApiApiController) TestAlert(w http.ResponseWriter, r *http.Request) { + alertParam := Alert{} + d := json.NewDecoder(r.Body) + d.DisallowUnknownFields() + if err := d.Decode(&alertParam); err != nil { + c.errorHandler(w, r, &ParsingError{Err: err}, nil) + return + } + if err := AssertAlertRequired(alertParam); err != nil { + c.errorHandler(w, r, err, nil) + return + } + result, err := c.service.TestAlert(r.Context(), alertParam) + // If an error occurred, encode the error with the status code + if err != nil { + c.errorHandler(w, r, err, &result) + return + } + // If no error, encode the body and the result code + EncodeJSONResponse(result.Body, &result.Code, w) + +} + // TestConnection - Tests the config data store/exporter connection func (c *ApiApiController) TestConnection(w http.ResponseWriter, r *http.Request) { dataStoreParam := DataStore{} @@ -981,6 +1462,60 @@ func (c *ApiApiController) TestConnection(w http.ResponseWriter, r *http.Request } +// UpdateEnvironment - Update environment +func (c *ApiApiController) UpdateEnvironment(w http.ResponseWriter, r *http.Request) { + params := mux.Vars(r) + environmentIDParam := params["environmentID"] + + environmentResourceParam := EnvironmentResource{} + d := json.NewDecoder(r.Body) + d.DisallowUnknownFields() + if err := d.Decode(&environmentResourceParam); err != nil { + c.errorHandler(w, r, &ParsingError{Err: err}, nil) + return + } + if err := AssertEnvironmentResourceRequired(environmentResourceParam); err != nil { + c.errorHandler(w, r, err, nil) + return + } + result, err := c.service.UpdateEnvironment(r.Context(), environmentIDParam, environmentResourceParam) + // If an error occurred, encode the error with the status code + if err != nil { + c.errorHandler(w, r, err, &result) + return + } + // If no error, encode the body and the result code + EncodeJSONResponse(result.Body, &result.Code, w) + +} + +// UpdateInvite - Updates a pending invite +func (c *ApiApiController) UpdateInvite(w http.ResponseWriter, r *http.Request) { + params := mux.Vars(r) + inviteIDParam := params["inviteID"] + + inviteResourceParam := InviteResource{} + d := json.NewDecoder(r.Body) + d.DisallowUnknownFields() + if err := d.Decode(&inviteResourceParam); err != nil { + c.errorHandler(w, r, &ParsingError{Err: err}, nil) + return + } + if err := AssertInviteResourceRequired(inviteResourceParam); err != nil { + c.errorHandler(w, r, err, nil) + return + } + result, err := c.service.UpdateInvite(r.Context(), inviteIDParam, inviteResourceParam) + // If an error occurred, encode the error with the status code + if err != nil { + c.errorHandler(w, r, err, &result) + return + } + // If no error, encode the body and the result code + EncodeJSONResponse(result.Body, &result.Code, w) + +} + // UpdateTestRun - update a test run func (c *ApiApiController) UpdateTestRun(w http.ResponseWriter, r *http.Request) { params := mux.Vars(r) @@ -1014,6 +1549,22 @@ func (c *ApiApiController) UpdateTestRun(w http.ResponseWriter, r *http.Request) } +// UpdateToken - Update token for environment +func (c *ApiApiController) UpdateToken(w http.ResponseWriter, r *http.Request) { + params := mux.Vars(r) + tokenIDParam := params["tokenID"] + + result, err := c.service.UpdateToken(r.Context(), tokenIDParam) + // If an error occurred, encode the error with the status code + if err != nil { + c.errorHandler(w, r, err, &result) + return + } + // If no error, encode the body and the result code + EncodeJSONResponse(result.Body, &result.Code, w) + +} + // UpdateWizard - Update a Wizard func (c *ApiApiController) UpdateWizard(w http.ResponseWriter, r *http.Request) { wizardParam := Wizard{} @@ -1037,3 +1588,75 @@ func (c *ApiApiController) UpdateWizard(w http.ResponseWriter, r *http.Request) EncodeJSONResponse(result.Body, &result.Code, w) } + +// UpsertEnvironment - Upsert new environment +func (c *ApiApiController) UpsertEnvironment(w http.ResponseWriter, r *http.Request) { + environmentResourceParam := EnvironmentResource{} + d := json.NewDecoder(r.Body) + d.DisallowUnknownFields() + if err := d.Decode(&environmentResourceParam); err != nil { + c.errorHandler(w, r, &ParsingError{Err: err}, nil) + return + } + if err := AssertEnvironmentResourceRequired(environmentResourceParam); err != nil { + c.errorHandler(w, r, err, nil) + return + } + result, err := c.service.UpsertEnvironment(r.Context(), environmentResourceParam) + // If an error occurred, encode the error with the status code + if err != nil { + c.errorHandler(w, r, err, &result) + return + } + // If no error, encode the body and the result code + EncodeJSONResponse(result.Body, &result.Code, w) + +} + +// UpsertInvite - Upserts a pending invite +func (c *ApiApiController) UpsertInvite(w http.ResponseWriter, r *http.Request) { + inviteResourceParam := InviteResource{} + d := json.NewDecoder(r.Body) + d.DisallowUnknownFields() + if err := d.Decode(&inviteResourceParam); err != nil { + c.errorHandler(w, r, &ParsingError{Err: err}, nil) + return + } + if err := AssertInviteResourceRequired(inviteResourceParam); err != nil { + c.errorHandler(w, r, err, nil) + return + } + result, err := c.service.UpsertInvite(r.Context(), inviteResourceParam) + // If an error occurred, encode the error with the status code + if err != nil { + c.errorHandler(w, r, err, &result) + return + } + // If no error, encode the body and the result code + EncodeJSONResponse(result.Body, &result.Code, w) + +} + +// UpsertToken - Upserts a new token +func (c *ApiApiController) UpsertToken(w http.ResponseWriter, r *http.Request) { + tokenParam := Token{} + d := json.NewDecoder(r.Body) + d.DisallowUnknownFields() + if err := d.Decode(&tokenParam); err != nil { + c.errorHandler(w, r, &ParsingError{Err: err}, nil) + return + } + if err := AssertTokenRequired(tokenParam); err != nil { + c.errorHandler(w, r, err, nil) + return + } + result, err := c.service.UpsertToken(r.Context(), tokenParam) + // If an error occurred, encode the error with the status code + if err != nil { + c.errorHandler(w, r, err, &result) + return + } + // If no error, encode the body and the result code + EncodeJSONResponse(result.Body, &result.Code, w) + +} diff --git a/server/openapi/api_resource_api.go b/server/openapi/api_resource_api.go index 8f522e394d..3f3fd64292 100644 --- a/server/openapi/api_resource_api.go +++ b/server/openapi/api_resource_api.go @@ -62,6 +62,12 @@ func (c *ResourceApiApiController) Routes() Routes { "/api/linters", c.CreateLinter, }, + { + "CreatePollingProfile", + strings.ToUpper("Post"), + "/api/pollingprofiles", + c.CreatePollingProfile, + }, { "CreateTest", strings.ToUpper("Post"), @@ -80,6 +86,12 @@ func (c *ResourceApiApiController) Routes() Routes { "/api/variableSets", c.CreateVariableSet, }, + { + "CreteMonitor", + strings.ToUpper("Post"), + "/api/monitors", + c.CreteMonitor, + }, { "DeleteDemo", strings.ToUpper("Delete"), @@ -92,6 +104,18 @@ func (c *ResourceApiApiController) Routes() Routes { "/api/linters/{linterId}", c.DeleteLinter, }, + { + "DeleteMonitor", + strings.ToUpper("Delete"), + "/api/monitors/{monitorId}", + c.DeleteMonitor, + }, + { + "DeletePollingProfile", + strings.ToUpper("Delete"), + "/api/pollingprofiles/{pollingProfileId}", + c.DeletePollingProfile, + }, { "DeleteTest", strings.ToUpper("Delete"), @@ -134,6 +158,12 @@ func (c *ResourceApiApiController) Routes() Routes { "/api/linters/{linterId}", c.GetLinter, }, + { + "GetMonitor", + strings.ToUpper("Get"), + "/api/monitors/{monitorId}", + c.GetMonitor, + }, { "GetPollingProfile", strings.ToUpper("Get"), @@ -194,6 +224,12 @@ func (c *ResourceApiApiController) Routes() Routes { "/api/linters", c.ListLinters, }, + { + "ListMonitors", + strings.ToUpper("Get"), + "/api/monitors", + c.ListMonitors, + }, { "ListPollingProfile", strings.ToUpper("Get"), @@ -230,6 +266,12 @@ func (c *ResourceApiApiController) Routes() Routes { "/api/linters/{linterId}", c.UpdateLinter, }, + { + "UpdateMonitor", + strings.ToUpper("Put"), + "/api/monitors/{monitorId}", + c.UpdateMonitor, + }, { "UpdatePollingProfile", strings.ToUpper("Put"), @@ -254,6 +296,18 @@ func (c *ResourceApiApiController) Routes() Routes { "/api/variableSets/{variableSetId}", c.UpdateVariableSet, }, + { + "UpsertMonitor", + strings.ToUpper("Put"), + "/api/monitors", + c.UpsertMonitor, + }, + { + "UpsertPollingProfile", + strings.ToUpper("Put"), + "/api/pollingprofiles", + c.UpsertPollingProfile, + }, { "UpsertTest", strings.ToUpper("Put"), @@ -311,6 +365,30 @@ func (c *ResourceApiApiController) CreateLinter(w http.ResponseWriter, r *http.R } +// CreatePollingProfile - Create Polling Profile +func (c *ResourceApiApiController) CreatePollingProfile(w http.ResponseWriter, r *http.Request) { + pollingProfileParam := PollingProfile{} + d := json.NewDecoder(r.Body) + d.DisallowUnknownFields() + if err := d.Decode(&pollingProfileParam); err != nil { + c.errorHandler(w, r, &ParsingError{Err: err}, nil) + return + } + if err := AssertPollingProfileRequired(pollingProfileParam); err != nil { + c.errorHandler(w, r, err, nil) + return + } + result, err := c.service.CreatePollingProfile(r.Context(), pollingProfileParam) + // If an error occurred, encode the error with the status code + if err != nil { + c.errorHandler(w, r, err, &result) + return + } + // If no error, encode the body and the result code + EncodeJSONResponse(result.Body, &result.Code, w) + +} + // CreateTest - Create new test func (c *ResourceApiApiController) CreateTest(w http.ResponseWriter, r *http.Request) { testResourceParam := TestResource{} @@ -383,6 +461,30 @@ func (c *ResourceApiApiController) CreateVariableSet(w http.ResponseWriter, r *h } +// CreteMonitor - Create a Monitor +func (c *ResourceApiApiController) CreteMonitor(w http.ResponseWriter, r *http.Request) { + monitorResourceParam := MonitorResource{} + d := json.NewDecoder(r.Body) + d.DisallowUnknownFields() + if err := d.Decode(&monitorResourceParam); err != nil { + c.errorHandler(w, r, &ParsingError{Err: err}, nil) + return + } + if err := AssertMonitorResourceRequired(monitorResourceParam); err != nil { + c.errorHandler(w, r, err, nil) + return + } + result, err := c.service.CreteMonitor(r.Context(), monitorResourceParam) + // If an error occurred, encode the error with the status code + if err != nil { + c.errorHandler(w, r, err, &result) + return + } + // If no error, encode the body and the result code + EncodeJSONResponse(result.Body, &result.Code, w) + +} + // DeleteDemo - Delete a Demonstration setting func (c *ResourceApiApiController) DeleteDemo(w http.ResponseWriter, r *http.Request) { params := mux.Vars(r) @@ -415,6 +517,38 @@ func (c *ResourceApiApiController) DeleteLinter(w http.ResponseWriter, r *http.R } +// DeleteMonitor - Delete a Monitor +func (c *ResourceApiApiController) DeleteMonitor(w http.ResponseWriter, r *http.Request) { + params := mux.Vars(r) + monitorIdParam := params["monitorId"] + + result, err := c.service.DeleteMonitor(r.Context(), monitorIdParam) + // If an error occurred, encode the error with the status code + if err != nil { + c.errorHandler(w, r, err, &result) + return + } + // If no error, encode the body and the result code + EncodeJSONResponse(result.Body, &result.Code, w) + +} + +// DeletePollingProfile - Delete Polling Profile +func (c *ResourceApiApiController) DeletePollingProfile(w http.ResponseWriter, r *http.Request) { + params := mux.Vars(r) + pollingProfileIdParam := params["pollingProfileId"] + + result, err := c.service.DeletePollingProfile(r.Context(), pollingProfileIdParam) + // If an error occurred, encode the error with the status code + if err != nil { + c.errorHandler(w, r, err, &result) + return + } + // If no error, encode the body and the result code + EncodeJSONResponse(result.Body, &result.Code, w) + +} + // DeleteTest - delete a test func (c *ResourceApiApiController) DeleteTest(w http.ResponseWriter, r *http.Request) { params := mux.Vars(r) @@ -527,6 +661,22 @@ func (c *ResourceApiApiController) GetLinter(w http.ResponseWriter, r *http.Requ } +// GetMonitor - Get a Monitor +func (c *ResourceApiApiController) GetMonitor(w http.ResponseWriter, r *http.Request) { + params := mux.Vars(r) + monitorIdParam := params["monitorId"] + + result, err := c.service.GetMonitor(r.Context(), monitorIdParam) + // If an error occurred, encode the error with the status code + if err != nil { + c.errorHandler(w, r, err, &result) + return + } + // If no error, encode the body and the result code + EncodeJSONResponse(result.Body, &result.Code, w) + +} + // GetPollingProfile - Get Polling Profile func (c *ResourceApiApiController) GetPollingProfile(w http.ResponseWriter, r *http.Request) { params := mux.Vars(r) @@ -749,6 +899,19 @@ func (c *ResourceApiApiController) ListLinters(w http.ResponseWriter, r *http.Re } +// ListMonitors - List monitors +func (c *ResourceApiApiController) ListMonitors(w http.ResponseWriter, r *http.Request) { + result, err := c.service.ListMonitors(r.Context()) + // If an error occurred, encode the error with the status code + if err != nil { + c.errorHandler(w, r, err, &result) + return + } + // If no error, encode the body and the result code + EncodeJSONResponse(result.Body, &result.Code, w) + +} + // ListPollingProfile - List Polling Profile Configuration func (c *ResourceApiApiController) ListPollingProfile(w http.ResponseWriter, r *http.Request) { query := r.URL.Query() @@ -909,6 +1072,33 @@ func (c *ResourceApiApiController) UpdateLinter(w http.ResponseWriter, r *http.R } +// UpdateMonitor - Update a Monitor +func (c *ResourceApiApiController) UpdateMonitor(w http.ResponseWriter, r *http.Request) { + params := mux.Vars(r) + monitorIdParam := params["monitorId"] + + monitorResourceParam := MonitorResource{} + d := json.NewDecoder(r.Body) + d.DisallowUnknownFields() + if err := d.Decode(&monitorResourceParam); err != nil { + c.errorHandler(w, r, &ParsingError{Err: err}, nil) + return + } + if err := AssertMonitorResourceRequired(monitorResourceParam); err != nil { + c.errorHandler(w, r, err, nil) + return + } + result, err := c.service.UpdateMonitor(r.Context(), monitorIdParam, monitorResourceParam) + // If an error occurred, encode the error with the status code + if err != nil { + c.errorHandler(w, r, err, &result) + return + } + // If no error, encode the body and the result code + EncodeJSONResponse(result.Body, &result.Code, w) + +} + // UpdatePollingProfile - Update a Polling Profile func (c *ResourceApiApiController) UpdatePollingProfile(w http.ResponseWriter, r *http.Request) { params := mux.Vars(r) @@ -1017,6 +1207,54 @@ func (c *ResourceApiApiController) UpdateVariableSet(w http.ResponseWriter, r *h } +// UpsertMonitor - Upsert a Monitor +func (c *ResourceApiApiController) UpsertMonitor(w http.ResponseWriter, r *http.Request) { + monitorResourceParam := MonitorResource{} + d := json.NewDecoder(r.Body) + d.DisallowUnknownFields() + if err := d.Decode(&monitorResourceParam); err != nil { + c.errorHandler(w, r, &ParsingError{Err: err}, nil) + return + } + if err := AssertMonitorResourceRequired(monitorResourceParam); err != nil { + c.errorHandler(w, r, err, nil) + return + } + result, err := c.service.UpsertMonitor(r.Context(), monitorResourceParam) + // If an error occurred, encode the error with the status code + if err != nil { + c.errorHandler(w, r, err, &result) + return + } + // If no error, encode the body and the result code + EncodeJSONResponse(result.Body, &result.Code, w) + +} + +// UpsertPollingProfile - Upsert new polling profile +func (c *ResourceApiApiController) UpsertPollingProfile(w http.ResponseWriter, r *http.Request) { + pollingProfileParam := PollingProfile{} + d := json.NewDecoder(r.Body) + d.DisallowUnknownFields() + if err := d.Decode(&pollingProfileParam); err != nil { + c.errorHandler(w, r, &ParsingError{Err: err}, nil) + return + } + if err := AssertPollingProfileRequired(pollingProfileParam); err != nil { + c.errorHandler(w, r, err, nil) + return + } + result, err := c.service.UpsertPollingProfile(r.Context(), pollingProfileParam) + // If an error occurred, encode the error with the status code + if err != nil { + c.errorHandler(w, r, err, &result) + return + } + // If no error, encode the body and the result code + EncodeJSONResponse(result.Body, &result.Code, w) + +} + // UpsertTest - Upsert new test func (c *ResourceApiApiController) UpsertTest(w http.ResponseWriter, r *http.Request) { testResourceParam := TestResource{} diff --git a/server/openapi/api_resource_api_service.go b/server/openapi/api_resource_api_service.go index 89cce1101e..ab6b7bc929 100644 --- a/server/openapi/api_resource_api_service.go +++ b/server/openapi/api_resource_api_service.go @@ -54,6 +54,20 @@ func (s *ResourceApiApiService) CreateLinter(ctx context.Context, linterResource return Response(http.StatusNotImplemented, nil), errors.New("CreateLinter method not implemented") } +// CreatePollingProfile - Create Polling Profile +func (s *ResourceApiApiService) CreatePollingProfile(ctx context.Context, pollingProfile PollingProfile) (ImplResponse, error) { + // TODO - update CreatePollingProfile with the required logic for this service method. + // Add api_resource_api_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation. + + //TODO: Uncomment the next line to return response Response(200, PollingProfile{}) or use other options such as http.Ok ... + //return Response(200, PollingProfile{}), nil + + //TODO: Uncomment the next line to return response Response(500, {}) or use other options such as http.Ok ... + //return Response(500, nil),nil + + return Response(http.StatusNotImplemented, nil), errors.New("CreatePollingProfile method not implemented") +} + // CreateTest - Create new test func (s *ResourceApiApiService) CreateTest(ctx context.Context, testResource TestResource) (ImplResponse, error) { // TODO - update CreateTest with the required logic for this service method. @@ -99,6 +113,26 @@ func (s *ResourceApiApiService) CreateVariableSet(ctx context.Context, variableS return Response(http.StatusNotImplemented, nil), errors.New("CreateVariableSet method not implemented") } +// CreteMonitor - Create a Monitor +func (s *ResourceApiApiService) CreteMonitor(ctx context.Context, monitorResource MonitorResource) (ImplResponse, error) { + // TODO - update CreteMonitor with the required logic for this service method. + // Add api_resource_api_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation. + + //TODO: Uncomment the next line to return response Response(200, MonitorResource{}) or use other options such as http.Ok ... + //return Response(200, MonitorResource{}), nil + + //TODO: Uncomment the next line to return response Response(400, {}) or use other options such as http.Ok ... + //return Response(400, nil),nil + + //TODO: Uncomment the next line to return response Response(404, {}) or use other options such as http.Ok ... + //return Response(404, nil),nil + + //TODO: Uncomment the next line to return response Response(500, {}) or use other options such as http.Ok ... + //return Response(500, nil),nil + + return Response(http.StatusNotImplemented, nil), errors.New("CreteMonitor method not implemented") +} + // DeleteDemo - Delete a Demonstration setting func (s *ResourceApiApiService) DeleteDemo(ctx context.Context, demoId string) (ImplResponse, error) { // TODO - update DeleteDemo with the required logic for this service method. @@ -139,6 +173,43 @@ func (s *ResourceApiApiService) DeleteLinter(ctx context.Context, linterId strin return Response(http.StatusNotImplemented, nil), errors.New("DeleteLinter method not implemented") } +// DeleteMonitor - Delete a Monitor +func (s *ResourceApiApiService) DeleteMonitor(ctx context.Context, monitorId string) (ImplResponse, error) { + // TODO - update DeleteMonitor with the required logic for this service method. + // Add api_resource_api_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation. + + //TODO: Uncomment the next line to return response Response(204, {}) or use other options such as http.Ok ... + //return Response(204, nil),nil + + //TODO: Uncomment the next line to return response Response(400, {}) or use other options such as http.Ok ... + //return Response(400, nil),nil + + //TODO: Uncomment the next line to return response Response(404, {}) or use other options such as http.Ok ... + //return Response(404, nil),nil + + //TODO: Uncomment the next line to return response Response(500, {}) or use other options such as http.Ok ... + //return Response(500, nil),nil + + return Response(http.StatusNotImplemented, nil), errors.New("DeleteMonitor method not implemented") +} + +// DeletePollingProfile - Delete Polling Profile +func (s *ResourceApiApiService) DeletePollingProfile(ctx context.Context, pollingProfileId string) (ImplResponse, error) { + // TODO - update DeletePollingProfile with the required logic for this service method. + // Add api_resource_api_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation. + + //TODO: Uncomment the next line to return response Response(204, {}) or use other options such as http.Ok ... + //return Response(204, nil),nil + + //TODO: Uncomment the next line to return response Response(404, {}) or use other options such as http.Ok ... + //return Response(404, nil),nil + + //TODO: Uncomment the next line to return response Response(500, {}) or use other options such as http.Ok ... + //return Response(500, nil),nil + + return Response(http.StatusNotImplemented, nil), errors.New("DeletePollingProfile method not implemented") +} + // DeleteTest - delete a test func (s *ResourceApiApiService) DeleteTest(ctx context.Context, testId string) (ImplResponse, error) { // TODO - update DeleteTest with the required logic for this service method. @@ -252,6 +323,23 @@ func (s *ResourceApiApiService) GetLinter(ctx context.Context, linterId string) return Response(http.StatusNotImplemented, nil), errors.New("GetLinter method not implemented") } +// GetMonitor - Get a Monitor +func (s *ResourceApiApiService) GetMonitor(ctx context.Context, monitorId string) (ImplResponse, error) { + // TODO - update GetMonitor with the required logic for this service method. + // Add api_resource_api_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation. + + //TODO: Uncomment the next line to return response Response(200, MonitorResource{}) or use other options such as http.Ok ... + //return Response(200, MonitorResource{}), nil + + //TODO: Uncomment the next line to return response Response(404, {}) or use other options such as http.Ok ... + //return Response(404, nil),nil + + //TODO: Uncomment the next line to return response Response(500, {}) or use other options such as http.Ok ... + //return Response(500, nil),nil + + return Response(http.StatusNotImplemented, nil), errors.New("GetMonitor method not implemented") +} + // GetPollingProfile - Get Polling Profile func (s *ResourceApiApiService) GetPollingProfile(ctx context.Context, pollingProfileId string) (ImplResponse, error) { // TODO - update GetPollingProfile with the required logic for this service method. @@ -413,6 +501,23 @@ func (s *ResourceApiApiService) ListLinters(ctx context.Context, take int32, ski return Response(http.StatusNotImplemented, nil), errors.New("ListLinters method not implemented") } +// ListMonitors - List monitors +func (s *ResourceApiApiService) ListMonitors(ctx context.Context) (ImplResponse, error) { + // TODO - update ListMonitors with the required logic for this service method. + // Add api_resource_api_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation. + + //TODO: Uncomment the next line to return response Response(200, MonitorResourceList{}) or use other options such as http.Ok ... + //return Response(200, MonitorResourceList{}), nil + + //TODO: Uncomment the next line to return response Response(404, {}) or use other options such as http.Ok ... + //return Response(404, nil),nil + + //TODO: Uncomment the next line to return response Response(500, {}) or use other options such as http.Ok ... + //return Response(500, nil),nil + + return Response(http.StatusNotImplemented, nil), errors.New("ListMonitors method not implemented") +} + // ListPollingProfile - List Polling Profile Configuration func (s *ResourceApiApiService) ListPollingProfile(ctx context.Context, take int32, skip int32, sortBy string, sortDirection string) (ImplResponse, error) { // TODO - update ListPollingProfile with the required logic for this service method. @@ -515,6 +620,26 @@ func (s *ResourceApiApiService) UpdateLinter(ctx context.Context, linterId strin return Response(http.StatusNotImplemented, nil), errors.New("UpdateLinter method not implemented") } +// UpdateMonitor - Update a Monitor +func (s *ResourceApiApiService) UpdateMonitor(ctx context.Context, monitorId string, monitorResource MonitorResource) (ImplResponse, error) { + // TODO - update UpdateMonitor with the required logic for this service method. + // Add api_resource_api_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation. + + //TODO: Uncomment the next line to return response Response(204, {}) or use other options such as http.Ok ... + //return Response(204, nil),nil + + //TODO: Uncomment the next line to return response Response(400, {}) or use other options such as http.Ok ... + //return Response(400, nil),nil + + //TODO: Uncomment the next line to return response Response(404, {}) or use other options such as http.Ok ... + //return Response(404, nil),nil + + //TODO: Uncomment the next line to return response Response(500, {}) or use other options such as http.Ok ... + //return Response(500, nil),nil + + return Response(http.StatusNotImplemented, nil), errors.New("UpdateMonitor method not implemented") +} + // UpdatePollingProfile - Update a Polling Profile func (s *ResourceApiApiService) UpdatePollingProfile(ctx context.Context, pollingProfileId string, pollingProfile PollingProfile) (ImplResponse, error) { // TODO - update UpdatePollingProfile with the required logic for this service method. @@ -589,6 +714,37 @@ func (s *ResourceApiApiService) UpdateVariableSet(ctx context.Context, variableS return Response(http.StatusNotImplemented, nil), errors.New("UpdateVariableSet method not implemented") } +// UpsertMonitor - Upsert a Monitor +func (s *ResourceApiApiService) UpsertMonitor(ctx context.Context, monitorResource MonitorResource) (ImplResponse, error) { + // TODO - update UpsertMonitor with the required logic for this service method. + // Add api_resource_api_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation. + + //TODO: Uncomment the next line to return response Response(200, MonitorResource{}) or use other options such as http.Ok ... + //return Response(200, MonitorResource{}), nil + + //TODO: Uncomment the next line to return response Response(400, {}) or use other options such as http.Ok ... + //return Response(400, nil),nil + + //TODO: Uncomment the next line to return response Response(404, {}) or use other options such as http.Ok ... + //return Response(404, nil),nil + + //TODO: Uncomment the next line to return response Response(500, {}) or use other options such as http.Ok ... + //return Response(500, nil),nil + + return Response(http.StatusNotImplemented, nil), errors.New("UpsertMonitor method not implemented") +} + +// UpsertPollingProfile - Upsert new polling profile +func (s *ResourceApiApiService) UpsertPollingProfile(ctx context.Context, pollingProfile PollingProfile) (ImplResponse, error) { + // TODO - update UpsertPollingProfile with the required logic for this service method. + // Add api_resource_api_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation. + + //TODO: Uncomment the next line to return response Response(200, PollingProfile{}) or use other options such as http.Ok ... + //return Response(200, PollingProfile{}), nil + + return Response(http.StatusNotImplemented, nil), errors.New("UpsertPollingProfile method not implemented") +} + // UpsertTest - Upsert new test func (s *ResourceApiApiService) UpsertTest(ctx context.Context, testResource TestResource) (ImplResponse, error) { // TODO - update UpsertTest with the required logic for this service method. diff --git a/server/openapi/model_alert.go b/server/openapi/model_alert.go new file mode 100644 index 0000000000..02076d2ab7 --- /dev/null +++ b/server/openapi/model_alert.go @@ -0,0 +1,40 @@ +/* + * TraceTest + * + * OpenAPI definition for TraceTest endpoint and resources + * + * API version: 0.2.1 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +type Alert struct { + Id string `json:"id,omitempty"` + + Type string `json:"type,omitempty"` + + Webhook Webhook `json:"webhook,omitempty"` + + Events []string `json:"events,omitempty"` +} + +// AssertAlertRequired checks if the required fields are not zero-ed +func AssertAlertRequired(obj Alert) error { + if err := AssertWebhookRequired(obj.Webhook); err != nil { + return err + } + return nil +} + +// AssertRecurseAlertRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of Alert (e.g. [][]Alert), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseAlertRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aAlert, ok := obj.(Alert) + if !ok { + return ErrTypeAssertionError + } + return AssertAlertRequired(aAlert) + }) +} diff --git a/server/openapi/model_alert_result.go b/server/openapi/model_alert_result.go new file mode 100644 index 0000000000..1efae67076 --- /dev/null +++ b/server/openapi/model_alert_result.go @@ -0,0 +1,40 @@ +/* + * TraceTest + * + * OpenAPI definition for TraceTest endpoint and resources + * + * API version: 0.2.1 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +type AlertResult struct { + AlertId string `json:"alertId,omitempty"` + + Id string `json:"id,omitempty"` + + Webhook WebhookResult `json:"webhook,omitempty"` + + Type string `json:"type,omitempty"` +} + +// AssertAlertResultRequired checks if the required fields are not zero-ed +func AssertAlertResultRequired(obj AlertResult) error { + if err := AssertWebhookResultRequired(obj.Webhook); err != nil { + return err + } + return nil +} + +// AssertRecurseAlertResultRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of AlertResult (e.g. [][]AlertResult), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseAlertResultRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aAlertResult, ok := obj.(AlertResult) + if !ok { + return ErrTypeAssertionError + } + return AssertAlertResultRequired(aAlertResult) + }) +} diff --git a/server/openapi/model_environment.go b/server/openapi/model_environment.go new file mode 100644 index 0000000000..22a2959086 --- /dev/null +++ b/server/openapi/model_environment.go @@ -0,0 +1,56 @@ +/* + * TraceTest + * + * OpenAPI definition for TraceTest endpoint and resources + * + * API version: 0.2.1 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +import ( + "time" +) + +type Environment struct { + Id string `json:"id,omitempty"` + + Name string `json:"name,omitempty"` + + Description string `json:"description,omitempty"` + + Labels map[string]string `json:"labels,omitempty"` + + CreatedAt time.Time `json:"createdAt,omitempty"` + + UpdatedAt time.Time `json:"updatedAt,omitempty"` + + IsLocal bool `json:"isLocal,omitempty"` + + UserID string `json:"userID,omitempty"` + + // organizationID + OrganizationID string `json:"organizationID,omitempty"` + + AgentApiKey string `json:"agentApiKey,omitempty"` + + Resources string `json:"resources,omitempty"` +} + +// AssertEnvironmentRequired checks if the required fields are not zero-ed +func AssertEnvironmentRequired(obj Environment) error { + return nil +} + +// AssertRecurseEnvironmentRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of Environment (e.g. [][]Environment), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseEnvironmentRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aEnvironment, ok := obj.(Environment) + if !ok { + return ErrTypeAssertionError + } + return AssertEnvironmentRequired(aEnvironment) + }) +} diff --git a/server/openapi/model_environment_resource.go b/server/openapi/model_environment_resource.go new file mode 100644 index 0000000000..98cd48094b --- /dev/null +++ b/server/openapi/model_environment_resource.go @@ -0,0 +1,36 @@ +/* + * TraceTest + * + * OpenAPI definition for TraceTest endpoint and resources + * + * API version: 0.2.1 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +type EnvironmentResource struct { + Type string `json:"type,omitempty"` + + Spec Environment `json:"spec,omitempty"` +} + +// AssertEnvironmentResourceRequired checks if the required fields are not zero-ed +func AssertEnvironmentResourceRequired(obj EnvironmentResource) error { + if err := AssertEnvironmentRequired(obj.Spec); err != nil { + return err + } + return nil +} + +// AssertRecurseEnvironmentResourceRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of EnvironmentResource (e.g. [][]EnvironmentResource), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseEnvironmentResourceRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aEnvironmentResource, ok := obj.(EnvironmentResource) + if !ok { + return ErrTypeAssertionError + } + return AssertEnvironmentResourceRequired(aEnvironmentResource) + }) +} diff --git a/server/openapi/model_environment_resources.go b/server/openapi/model_environment_resources.go new file mode 100644 index 0000000000..ac76dc4afe --- /dev/null +++ b/server/openapi/model_environment_resources.go @@ -0,0 +1,38 @@ +/* + * TraceTest + * + * OpenAPI definition for TraceTest endpoint and resources + * + * API version: 0.2.1 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +type EnvironmentResources struct { + Items []EnvironmentResource `json:"items,omitempty"` + + Count int32 `json:"count,omitempty"` +} + +// AssertEnvironmentResourcesRequired checks if the required fields are not zero-ed +func AssertEnvironmentResourcesRequired(obj EnvironmentResources) error { + for _, el := range obj.Items { + if err := AssertEnvironmentResourceRequired(el); err != nil { + return err + } + } + return nil +} + +// AssertRecurseEnvironmentResourcesRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of EnvironmentResources (e.g. [][]EnvironmentResources), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseEnvironmentResourcesRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aEnvironmentResources, ok := obj.(EnvironmentResources) + if !ok { + return ErrTypeAssertionError + } + return AssertEnvironmentResourcesRequired(aEnvironmentResources) + }) +} diff --git a/server/openapi/model_get_monitor_runs_200_response.go b/server/openapi/model_get_monitor_runs_200_response.go new file mode 100644 index 0000000000..aec1904d05 --- /dev/null +++ b/server/openapi/model_get_monitor_runs_200_response.go @@ -0,0 +1,38 @@ +/* + * TraceTest + * + * OpenAPI definition for TraceTest endpoint and resources + * + * API version: 0.2.1 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +type GetMonitorRuns200Response struct { + Items []MonitorRun `json:"items,omitempty"` + + Count int32 `json:"count,omitempty"` +} + +// AssertGetMonitorRuns200ResponseRequired checks if the required fields are not zero-ed +func AssertGetMonitorRuns200ResponseRequired(obj GetMonitorRuns200Response) error { + for _, el := range obj.Items { + if err := AssertMonitorRunRequired(el); err != nil { + return err + } + } + return nil +} + +// AssertRecurseGetMonitorRuns200ResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of GetMonitorRuns200Response (e.g. [][]GetMonitorRuns200Response), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseGetMonitorRuns200ResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aGetMonitorRuns200Response, ok := obj.(GetMonitorRuns200Response) + if !ok { + return ErrTypeAssertionError + } + return AssertGetMonitorRuns200ResponseRequired(aGetMonitorRuns200Response) + }) +} diff --git a/server/openapi/model_invite.go b/server/openapi/model_invite.go new file mode 100644 index 0000000000..3af53992b8 --- /dev/null +++ b/server/openapi/model_invite.go @@ -0,0 +1,67 @@ +/* + * TraceTest + * + * OpenAPI definition for TraceTest endpoint and resources + * + * API version: 0.2.1 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +import ( + "time" +) + +type Invite struct { + Id string `json:"id"` + + Role Role `json:"role"` + + To string `json:"to"` + + CreatedAt time.Time `json:"createdAt,omitempty"` + + SentAt time.Time `json:"sentAt,omitempty"` + + Type string `json:"type,omitempty"` + + Status string `json:"status,omitempty"` + + ReturnTo string `json:"returnTo,omitempty"` + + Environments []InviteEnvironment `json:"environments,omitempty"` +} + +// AssertInviteRequired checks if the required fields are not zero-ed +func AssertInviteRequired(obj Invite) error { + elements := map[string]interface{}{ + "id": obj.Id, + "role": obj.Role, + "to": obj.To, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + for _, el := range obj.Environments { + if err := AssertInviteEnvironmentRequired(el); err != nil { + return err + } + } + return nil +} + +// AssertRecurseInviteRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of Invite (e.g. [][]Invite), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseInviteRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aInvite, ok := obj.(Invite) + if !ok { + return ErrTypeAssertionError + } + return AssertInviteRequired(aInvite) + }) +} diff --git a/server/openapi/model_invite_environment.go b/server/openapi/model_invite_environment.go new file mode 100644 index 0000000000..617e48d5b0 --- /dev/null +++ b/server/openapi/model_invite_environment.go @@ -0,0 +1,48 @@ +/* + * TraceTest + * + * OpenAPI definition for TraceTest endpoint and resources + * + * API version: 0.2.1 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +type InviteEnvironment struct { + Id string `json:"id"` + + Role Role `json:"role"` + + Environment Environment `json:"environment,omitempty"` +} + +// AssertInviteEnvironmentRequired checks if the required fields are not zero-ed +func AssertInviteEnvironmentRequired(obj InviteEnvironment) error { + elements := map[string]interface{}{ + "id": obj.Id, + "role": obj.Role, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + if err := AssertEnvironmentRequired(obj.Environment); err != nil { + return err + } + return nil +} + +// AssertRecurseInviteEnvironmentRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of InviteEnvironment (e.g. [][]InviteEnvironment), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseInviteEnvironmentRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aInviteEnvironment, ok := obj.(InviteEnvironment) + if !ok { + return ErrTypeAssertionError + } + return AssertInviteEnvironmentRequired(aInviteEnvironment) + }) +} diff --git a/server/openapi/model_invite_resource.go b/server/openapi/model_invite_resource.go new file mode 100644 index 0000000000..a9d768edf6 --- /dev/null +++ b/server/openapi/model_invite_resource.go @@ -0,0 +1,36 @@ +/* + * TraceTest + * + * OpenAPI definition for TraceTest endpoint and resources + * + * API version: 0.2.1 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +type InviteResource struct { + Type string `json:"type,omitempty"` + + Spec Invite `json:"spec,omitempty"` +} + +// AssertInviteResourceRequired checks if the required fields are not zero-ed +func AssertInviteResourceRequired(obj InviteResource) error { + if err := AssertInviteRequired(obj.Spec); err != nil { + return err + } + return nil +} + +// AssertRecurseInviteResourceRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of InviteResource (e.g. [][]InviteResource), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseInviteResourceRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aInviteResource, ok := obj.(InviteResource) + if !ok { + return ErrTypeAssertionError + } + return AssertInviteResourceRequired(aInviteResource) + }) +} diff --git a/server/openapi/model_invite_resources.go b/server/openapi/model_invite_resources.go new file mode 100644 index 0000000000..ebb975d641 --- /dev/null +++ b/server/openapi/model_invite_resources.go @@ -0,0 +1,38 @@ +/* + * TraceTest + * + * OpenAPI definition for TraceTest endpoint and resources + * + * API version: 0.2.1 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +type InviteResources struct { + Items []InviteResource `json:"items,omitempty"` + + Count int32 `json:"count,omitempty"` +} + +// AssertInviteResourcesRequired checks if the required fields are not zero-ed +func AssertInviteResourcesRequired(obj InviteResources) error { + for _, el := range obj.Items { + if err := AssertInviteResourceRequired(el); err != nil { + return err + } + } + return nil +} + +// AssertRecurseInviteResourcesRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of InviteResources (e.g. [][]InviteResources), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseInviteResourcesRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aInviteResources, ok := obj.(InviteResources) + if !ok { + return ErrTypeAssertionError + } + return AssertInviteResourcesRequired(aInviteResources) + }) +} diff --git a/server/openapi/model_monitor.go b/server/openapi/model_monitor.go new file mode 100644 index 0000000000..f133f5fb61 --- /dev/null +++ b/server/openapi/model_monitor.go @@ -0,0 +1,90 @@ +/* + * TraceTest + * + * OpenAPI definition for TraceTest endpoint and resources + * + * API version: 0.2.1 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +import ( + "time" +) + +type Monitor struct { + Id string `json:"id,omitempty"` + + Version int32 `json:"version,omitempty"` + + Name string `json:"name,omitempty"` + + CreatedAt time.Time `json:"createdAt,omitempty"` + + DeletedAt time.Time `json:"deletedAt,omitempty"` + + UpdatedAt time.Time `json:"updatedAt,omitempty"` + + Enabled bool `json:"enabled,omitempty"` + + // list of steps of the Monitor containing just each test id + Tests []string `json:"tests,omitempty"` + + // list of steps of the Monitor containing just each test suite id + TestSuites []string `json:"testSuites,omitempty"` + + // list of steps of the Monitor containing the whole test object + FullTests []Test `json:"fullTests,omitempty"` + + // list of steps of the Monitor containing the whole test suite object + FullTestSuites []TestSuite `json:"fullTestSuites,omitempty"` + + VariableSetId string `json:"variableSetId,omitempty"` + + TokenId string `json:"tokenId,omitempty"` + + Schedule Schedule `json:"schedule,omitempty"` + + Alerts []Alert `json:"alerts,omitempty"` + + Summary Summary `json:"summary,omitempty"` +} + +// AssertMonitorRequired checks if the required fields are not zero-ed +func AssertMonitorRequired(obj Monitor) error { + for _, el := range obj.FullTests { + if err := AssertTestRequired(el); err != nil { + return err + } + } + for _, el := range obj.FullTestSuites { + if err := AssertTestSuiteRequired(el); err != nil { + return err + } + } + if err := AssertScheduleRequired(obj.Schedule); err != nil { + return err + } + for _, el := range obj.Alerts { + if err := AssertAlertRequired(el); err != nil { + return err + } + } + if err := AssertSummaryRequired(obj.Summary); err != nil { + return err + } + return nil +} + +// AssertRecurseMonitorRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of Monitor (e.g. [][]Monitor), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseMonitorRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aMonitor, ok := obj.(Monitor) + if !ok { + return ErrTypeAssertionError + } + return AssertMonitorRequired(aMonitor) + }) +} diff --git a/server/openapi/model_monitor_resource.go b/server/openapi/model_monitor_resource.go new file mode 100644 index 0000000000..0cc48289bf --- /dev/null +++ b/server/openapi/model_monitor_resource.go @@ -0,0 +1,39 @@ +/* + * TraceTest + * + * OpenAPI definition for TraceTest endpoint and resources + * + * API version: 0.2.1 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +// MonitorResource - Represents a Monitor structured into the Resources format. +type MonitorResource struct { + + // Represents the type of this resource. It should always be set as 'Monitor'. + Type string `json:"type,omitempty"` + + Spec Monitor `json:"spec,omitempty"` +} + +// AssertMonitorResourceRequired checks if the required fields are not zero-ed +func AssertMonitorResourceRequired(obj MonitorResource) error { + if err := AssertMonitorRequired(obj.Spec); err != nil { + return err + } + return nil +} + +// AssertRecurseMonitorResourceRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of MonitorResource (e.g. [][]MonitorResource), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseMonitorResourceRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aMonitorResource, ok := obj.(MonitorResource) + if !ok { + return ErrTypeAssertionError + } + return AssertMonitorResourceRequired(aMonitorResource) + }) +} diff --git a/server/openapi/model_monitor_resource_list.go b/server/openapi/model_monitor_resource_list.go new file mode 100644 index 0000000000..f602f5b51b --- /dev/null +++ b/server/openapi/model_monitor_resource_list.go @@ -0,0 +1,38 @@ +/* + * TraceTest + * + * OpenAPI definition for TraceTest endpoint and resources + * + * API version: 0.2.1 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +type MonitorResourceList struct { + Count int32 `json:"count,omitempty"` + + Items []MonitorResource `json:"items,omitempty"` +} + +// AssertMonitorResourceListRequired checks if the required fields are not zero-ed +func AssertMonitorResourceListRequired(obj MonitorResourceList) error { + for _, el := range obj.Items { + if err := AssertMonitorResourceRequired(el); err != nil { + return err + } + } + return nil +} + +// AssertRecurseMonitorResourceListRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of MonitorResourceList (e.g. [][]MonitorResourceList), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseMonitorResourceListRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aMonitorResourceList, ok := obj.(MonitorResourceList) + if !ok { + return ErrTypeAssertionError + } + return AssertMonitorResourceListRequired(aMonitorResourceList) + }) +} diff --git a/server/openapi/model_monitor_run.go b/server/openapi/model_monitor_run.go new file mode 100644 index 0000000000..94d3db3cd5 --- /dev/null +++ b/server/openapi/model_monitor_run.go @@ -0,0 +1,85 @@ +/* + * TraceTest + * + * OpenAPI definition for TraceTest endpoint and resources + * + * API version: 0.2.1 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +import ( + "time" +) + +type MonitorRun struct { + Id int32 `json:"id,omitempty"` + + MonitorId string `json:"monitorId,omitempty"` + + MonitorVersion int32 `json:"monitorVersion,omitempty"` + + RunGroupId string `json:"runGroupId,omitempty"` + + CreatedAt time.Time `json:"createdAt,omitempty"` + + CompletedAt time.Time `json:"completedAt,omitempty"` + + ExecutionType string `json:"executionType,omitempty"` + + LastError string `json:"lastError,omitempty"` + + State string `json:"state,omitempty"` + + VariableSet VariableSet `json:"variableSet,omitempty"` + + Metadata map[string]string `json:"metadata,omitempty"` + + TestRunsCount int32 `json:"testRunsCount,omitempty"` + + TestSuiteRunsCount int32 `json:"testSuiteRunsCount,omitempty"` + + // list of test runs of the Monitor Run + TestRuns []TestRun `json:"testRuns,omitempty"` + + // list of test suite runs of the Monitor Run + TestSuiteRuns []TestSuiteRun `json:"testSuiteRuns,omitempty"` + + Alerts []AlertResult `json:"alerts,omitempty"` +} + +// AssertMonitorRunRequired checks if the required fields are not zero-ed +func AssertMonitorRunRequired(obj MonitorRun) error { + if err := AssertVariableSetRequired(obj.VariableSet); err != nil { + return err + } + for _, el := range obj.TestRuns { + if err := AssertTestRunRequired(el); err != nil { + return err + } + } + for _, el := range obj.TestSuiteRuns { + if err := AssertTestSuiteRunRequired(el); err != nil { + return err + } + } + for _, el := range obj.Alerts { + if err := AssertAlertResultRequired(el); err != nil { + return err + } + } + return nil +} + +// AssertRecurseMonitorRunRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of MonitorRun (e.g. [][]MonitorRun), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseMonitorRunRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aMonitorRun, ok := obj.(MonitorRun) + if !ok { + return ErrTypeAssertionError + } + return AssertMonitorRunRequired(aMonitorRun) + }) +} diff --git a/server/openapi/model_playwright_engine_request.go b/server/openapi/model_playwright_engine_request.go new file mode 100644 index 0000000000..e02aef2a92 --- /dev/null +++ b/server/openapi/model_playwright_engine_request.go @@ -0,0 +1,35 @@ +/* + * TraceTest + * + * OpenAPI definition for TraceTest endpoint and resources + * + * API version: 0.2.1 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +type PlaywrightEngineRequest struct { + Target string `json:"target,omitempty"` + + Method string `json:"method,omitempty"` + + Script string `json:"script,omitempty"` +} + +// AssertPlaywrightEngineRequestRequired checks if the required fields are not zero-ed +func AssertPlaywrightEngineRequestRequired(obj PlaywrightEngineRequest) error { + return nil +} + +// AssertRecursePlaywrightEngineRequestRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of PlaywrightEngineRequest (e.g. [][]PlaywrightEngineRequest), otherwise ErrTypeAssertionError is thrown. +func AssertRecursePlaywrightEngineRequestRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aPlaywrightEngineRequest, ok := obj.(PlaywrightEngineRequest) + if !ok { + return ErrTypeAssertionError + } + return AssertPlaywrightEngineRequestRequired(aPlaywrightEngineRequest) + }) +} diff --git a/server/openapi/model_playwright_engine_response.go b/server/openapi/model_playwright_engine_response.go new file mode 100644 index 0000000000..8c2356b1aa --- /dev/null +++ b/server/openapi/model_playwright_engine_response.go @@ -0,0 +1,31 @@ +/* + * TraceTest + * + * OpenAPI definition for TraceTest endpoint and resources + * + * API version: 0.2.1 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +type PlaywrightEngineResponse struct { + Success bool `json:"success,omitempty"` +} + +// AssertPlaywrightEngineResponseRequired checks if the required fields are not zero-ed +func AssertPlaywrightEngineResponseRequired(obj PlaywrightEngineResponse) error { + return nil +} + +// AssertRecursePlaywrightEngineResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of PlaywrightEngineResponse (e.g. [][]PlaywrightEngineResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecursePlaywrightEngineResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aPlaywrightEngineResponse, ok := obj.(PlaywrightEngineResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertPlaywrightEngineResponseRequired(aPlaywrightEngineResponse) + }) +} diff --git a/server/openapi/model_polling_profile_spec_periodic.go b/server/openapi/model_polling_profile_spec_periodic.go index 06b82daaaf..f955dbccc8 100644 --- a/server/openapi/model_polling_profile_spec_periodic.go +++ b/server/openapi/model_polling_profile_spec_periodic.go @@ -17,6 +17,8 @@ type PollingProfileSpecPeriodic struct { // Total time that the poller should try to continue to fetch traces. It should be written in duration format (example: 1s, 30s, 1m). Timeout string `json:"timeout,omitempty"` + + SelectorMatchRetries float32 `json:"selectorMatchRetries,omitempty"` } // AssertPollingProfileSpecPeriodicRequired checks if the required fields are not zero-ed diff --git a/server/openapi/model_role.go b/server/openapi/model_role.go new file mode 100644 index 0000000000..5786709f4f --- /dev/null +++ b/server/openapi/model_role.go @@ -0,0 +1,40 @@ +/* + * TraceTest + * + * OpenAPI definition for TraceTest endpoint and resources + * + * API version: 0.2.1 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +type Role string + +// List of Role +const ( + OWNERS Role = "owners" + MEMBERS Role = "members" + ADMINS Role = "admins" + BILLERS Role = "billers" + ENGINEERS Role = "engineers" + RUNNERS Role = "runners" + AGENT Role = "agent" +) + +// AssertRoleRequired checks if the required fields are not zero-ed +func AssertRoleRequired(obj Role) error { + return nil +} + +// AssertRecurseRoleRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of Role (e.g. [][]Role), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseRoleRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aRole, ok := obj.(Role) + if !ok { + return ErrTypeAssertionError + } + return AssertRoleRequired(aRole) + }) +} diff --git a/server/openapi/model_run_group_run.go b/server/openapi/model_run_group_run.go deleted file mode 100644 index 7076f54bf0..0000000000 --- a/server/openapi/model_run_group_run.go +++ /dev/null @@ -1,73 +0,0 @@ -/* - * TraceTest - * - * OpenAPI definition for TraceTest endpoint and resources - * - * API version: 0.2.1 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package openapi - -import ( - "time" -) - -type RunGroupRun struct { - TestId string `json:"testId,omitempty"` - - TestVersion int32 `json:"testVersion,omitempty"` - - Name string `json:"name,omitempty"` - - CreatedAt time.Time `json:"createdAt,omitempty"` - - CompletedAt time.Time `json:"completedAt,omitempty"` - - Linter LinterResult `json:"linter,omitempty"` - - RequiredGatesResult RequiredGatesResult `json:"requiredGatesResult,omitempty"` - - Metadata map[string]string `json:"metadata,omitempty"` - - // time in seconds it took for the test to complete, either success or fail. If the test is still running, it will show the time up to the time of the request - ExecutionTime int32 `json:"executionTime,omitempty"` - - RunId int32 `json:"runId,omitempty"` - - Trigger Trigger `json:"trigger,omitempty"` - - // Current execution state - State string `json:"state,omitempty"` - - Result AssertionResults `json:"result,omitempty"` -} - -// AssertRunGroupRunRequired checks if the required fields are not zero-ed -func AssertRunGroupRunRequired(obj RunGroupRun) error { - if err := AssertLinterResultRequired(obj.Linter); err != nil { - return err - } - if err := AssertRequiredGatesResultRequired(obj.RequiredGatesResult); err != nil { - return err - } - if err := AssertTriggerRequired(obj.Trigger); err != nil { - return err - } - if err := AssertAssertionResultsRequired(obj.Result); err != nil { - return err - } - return nil -} - -// AssertRecurseRunGroupRunRequired recursively checks if required fields are not zero-ed in a nested slice. -// Accepts only nested slice of RunGroupRun (e.g. [][]RunGroupRun), otherwise ErrTypeAssertionError is thrown. -func AssertRecurseRunGroupRunRequired(objSlice interface{}) error { - return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { - aRunGroupRun, ok := obj.(RunGroupRun) - if !ok { - return ErrTypeAssertionError - } - return AssertRunGroupRunRequired(aRunGroupRun) - }) -} diff --git a/server/openapi/model_run_monitor_information.go b/server/openapi/model_run_monitor_information.go new file mode 100644 index 0000000000..884ff2a210 --- /dev/null +++ b/server/openapi/model_run_monitor_information.go @@ -0,0 +1,42 @@ +/* + * TraceTest + * + * OpenAPI definition for TraceTest endpoint and resources + * + * API version: 0.2.1 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +type RunMonitorInformation struct { + Metadata *map[string]string `json:"metadata,omitempty"` + + RunGroupId string `json:"runGroupId,omitempty"` + + RunType string `json:"runType,omitempty"` + + Variables []VariableSetValue `json:"variables,omitempty"` +} + +// AssertRunMonitorInformationRequired checks if the required fields are not zero-ed +func AssertRunMonitorInformationRequired(obj RunMonitorInformation) error { + for _, el := range obj.Variables { + if err := AssertVariableSetValueRequired(el); err != nil { + return err + } + } + return nil +} + +// AssertRecurseRunMonitorInformationRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of RunMonitorInformation (e.g. [][]RunMonitorInformation), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseRunMonitorInformationRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aRunMonitorInformation, ok := obj.(RunMonitorInformation) + if !ok { + return ErrTypeAssertionError + } + return AssertRunMonitorInformationRequired(aRunMonitorInformation) + }) +} diff --git a/server/openapi/model_schedule.go b/server/openapi/model_schedule.go new file mode 100644 index 0000000000..5f875e206c --- /dev/null +++ b/server/openapi/model_schedule.go @@ -0,0 +1,33 @@ +/* + * TraceTest + * + * OpenAPI definition for TraceTest endpoint and resources + * + * API version: 0.2.1 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +type Schedule struct { + Cron string `json:"cron,omitempty"` + + TimeZone string `json:"timeZone,omitempty"` +} + +// AssertScheduleRequired checks if the required fields are not zero-ed +func AssertScheduleRequired(obj Schedule) error { + return nil +} + +// AssertRecurseScheduleRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of Schedule (e.g. [][]Schedule), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseScheduleRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aSchedule, ok := obj.(Schedule) + if !ok { + return ErrTypeAssertionError + } + return AssertScheduleRequired(aSchedule) + }) +} diff --git a/server/openapi/model_summary.go b/server/openapi/model_summary.go new file mode 100644 index 0000000000..e4d8861a2b --- /dev/null +++ b/server/openapi/model_summary.go @@ -0,0 +1,39 @@ +/* + * TraceTest + * + * OpenAPI definition for TraceTest endpoint and resources + * + * API version: 0.2.1 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +import ( + "time" +) + +type Summary struct { + Runs int32 `json:"runs,omitempty"` + + LastState string `json:"lastState,omitempty"` + + LastRunTime time.Time `json:"lastRunTime,omitempty"` +} + +// AssertSummaryRequired checks if the required fields are not zero-ed +func AssertSummaryRequired(obj Summary) error { + return nil +} + +// AssertRecurseSummaryRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of Summary (e.g. [][]Summary), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseSummaryRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aSummary, ok := obj.(Summary) + if !ok { + return ErrTypeAssertionError + } + return AssertSummaryRequired(aSummary) + }) +} diff --git a/server/openapi/model_test_.go b/server/openapi/model_test_.go index e04ee99845..f6ac695d9c 100644 --- a/server/openapi/model_test_.go +++ b/server/openapi/model_test_.go @@ -30,7 +30,7 @@ type Test struct { // If true, the test will not collect a trace SkipTraceCollection bool `json:"skipTraceCollection,omitempty"` - // ID of the polling profile to be used for this test + // Id of the polling profile that will be used by all the runs of this test PollingProfile string `json:"pollingProfile,omitempty"` // specification of assertions that are going to be made diff --git a/server/openapi/model_token.go b/server/openapi/model_token.go new file mode 100644 index 0000000000..9d9cd48bd5 --- /dev/null +++ b/server/openapi/model_token.go @@ -0,0 +1,64 @@ +/* + * TraceTest + * + * OpenAPI definition for TraceTest endpoint and resources + * + * API version: 0.2.1 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +import ( + "time" +) + +type Token struct { + Id string `json:"id"` + + // token name + Name string `json:"name"` + + IsRevoked bool `json:"isRevoked,omitempty"` + + Role Role `json:"role"` + + UserID string `json:"userID,omitempty"` + + // token duration in minutes + Duration int32 `json:"duration,omitempty"` + + IssuedAt time.Time `json:"issuedAt,omitempty"` + + ExpiresAt time.Time `json:"expiresAt,omitempty"` + + UpdatedAt time.Time `json:"updatedAt,omitempty"` +} + +// AssertTokenRequired checks if the required fields are not zero-ed +func AssertTokenRequired(obj Token) error { + elements := map[string]interface{}{ + "id": obj.Id, + "name": obj.Name, + "role": obj.Role, + } + for name, el := range elements { + if isZero := IsZeroValue(el); isZero { + return &RequiredError{Field: name} + } + } + + return nil +} + +// AssertRecurseTokenRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of Token (e.g. [][]Token), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseTokenRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aToken, ok := obj.(Token) + if !ok { + return ErrTypeAssertionError + } + return AssertTokenRequired(aToken) + }) +} diff --git a/server/openapi/model_tokens.go b/server/openapi/model_tokens.go new file mode 100644 index 0000000000..6792bc87df --- /dev/null +++ b/server/openapi/model_tokens.go @@ -0,0 +1,38 @@ +/* + * TraceTest + * + * OpenAPI definition for TraceTest endpoint and resources + * + * API version: 0.2.1 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +type Tokens struct { + Items []Token `json:"items,omitempty"` + + Count int32 `json:"count,omitempty"` +} + +// AssertTokensRequired checks if the required fields are not zero-ed +func AssertTokensRequired(obj Tokens) error { + for _, el := range obj.Items { + if err := AssertTokenRequired(el); err != nil { + return err + } + } + return nil +} + +// AssertRecurseTokensRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of Tokens (e.g. [][]Tokens), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseTokensRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aTokens, ok := obj.(Tokens) + if !ok { + return ErrTypeAssertionError + } + return AssertTokensRequired(aTokens) + }) +} diff --git a/server/openapi/model_trigger.go b/server/openapi/model_trigger.go index 6e620afd8b..6fb47ee4b2 100644 --- a/server/openapi/model_trigger.go +++ b/server/openapi/model_trigger.go @@ -19,6 +19,8 @@ type Trigger struct { Traceid TraceidRequest `json:"traceid,omitempty"` Kafka KafkaRequest `json:"kafka,omitempty"` + + PlaywrightEngine PlaywrightEngineRequest `json:"playwrightEngine,omitempty"` } // AssertTriggerRequired checks if the required fields are not zero-ed @@ -35,6 +37,9 @@ func AssertTriggerRequired(obj Trigger) error { if err := AssertKafkaRequestRequired(obj.Kafka); err != nil { return err } + if err := AssertPlaywrightEngineRequestRequired(obj.PlaywrightEngine); err != nil { + return err + } return nil } diff --git a/server/openapi/model_trigger_result_trigger_result.go b/server/openapi/model_trigger_result_trigger_result.go index 3d3fcc5e90..683cacf8a3 100644 --- a/server/openapi/model_trigger_result_trigger_result.go +++ b/server/openapi/model_trigger_result_trigger_result.go @@ -18,6 +18,8 @@ type TriggerResultTriggerResult struct { Kafka KafkaResponse `json:"kafka,omitempty"` + PlaywrightEngine PlaywrightEngineResponse `json:"playwrightEngine,omitempty"` + Error TriggerError `json:"error,omitempty"` } @@ -35,6 +37,9 @@ func AssertTriggerResultTriggerResultRequired(obj TriggerResultTriggerResult) er if err := AssertKafkaResponseRequired(obj.Kafka); err != nil { return err } + if err := AssertPlaywrightEngineResponseRequired(obj.PlaywrightEngine); err != nil { + return err + } if err := AssertTriggerErrorRequired(obj.Error); err != nil { return err } diff --git a/server/openapi/model_variable_set_value.go b/server/openapi/model_variable_set_value.go index 68b20486dd..05b22f603e 100644 --- a/server/openapi/model_variable_set_value.go +++ b/server/openapi/model_variable_set_value.go @@ -13,6 +13,8 @@ type VariableSetValue struct { Key string `json:"key,omitempty"` Value string `json:"value,omitempty"` + + Type string `json:"type,omitempty"` } // AssertVariableSetValueRequired checks if the required fields are not zero-ed diff --git a/server/openapi/model_webhook.go b/server/openapi/model_webhook.go new file mode 100644 index 0000000000..33ad736242 --- /dev/null +++ b/server/openapi/model_webhook.go @@ -0,0 +1,44 @@ +/* + * TraceTest + * + * OpenAPI definition for TraceTest endpoint and resources + * + * API version: 0.2.1 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +type Webhook struct { + Url string `json:"url,omitempty"` + + Body string `json:"body,omitempty"` + + Method string `json:"method,omitempty"` + + Headers []HttpHeader `json:"headers,omitempty"` + + SslVerification bool `json:"sslVerification,omitempty"` +} + +// AssertWebhookRequired checks if the required fields are not zero-ed +func AssertWebhookRequired(obj Webhook) error { + for _, el := range obj.Headers { + if err := AssertHttpHeaderRequired(el); err != nil { + return err + } + } + return nil +} + +// AssertRecurseWebhookRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of Webhook (e.g. [][]Webhook), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseWebhookRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aWebhook, ok := obj.(Webhook) + if !ok { + return ErrTypeAssertionError + } + return AssertWebhookRequired(aWebhook) + }) +} diff --git a/server/openapi/model_webhook_result.go b/server/openapi/model_webhook_result.go new file mode 100644 index 0000000000..128d49fb33 --- /dev/null +++ b/server/openapi/model_webhook_result.go @@ -0,0 +1,39 @@ +/* + * TraceTest + * + * OpenAPI definition for TraceTest endpoint and resources + * + * API version: 0.2.1 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +type WebhookResult struct { + Request WebhookResultRequest `json:"request,omitempty"` + + Response WebhookResultResponse `json:"response,omitempty"` +} + +// AssertWebhookResultRequired checks if the required fields are not zero-ed +func AssertWebhookResultRequired(obj WebhookResult) error { + if err := AssertWebhookResultRequestRequired(obj.Request); err != nil { + return err + } + if err := AssertWebhookResultResponseRequired(obj.Response); err != nil { + return err + } + return nil +} + +// AssertRecurseWebhookResultRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of WebhookResult (e.g. [][]WebhookResult), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseWebhookResultRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aWebhookResult, ok := obj.(WebhookResult) + if !ok { + return ErrTypeAssertionError + } + return AssertWebhookResultRequired(aWebhookResult) + }) +} diff --git a/server/openapi/model_webhook_result_request.go b/server/openapi/model_webhook_result_request.go new file mode 100644 index 0000000000..dc2dbd19e8 --- /dev/null +++ b/server/openapi/model_webhook_result_request.go @@ -0,0 +1,42 @@ +/* + * TraceTest + * + * OpenAPI definition for TraceTest endpoint and resources + * + * API version: 0.2.1 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +type WebhookResultRequest struct { + Url string `json:"url,omitempty"` + + Headers []HttpHeader `json:"headers,omitempty"` + + Body string `json:"body,omitempty"` + + Method string `json:"method,omitempty"` +} + +// AssertWebhookResultRequestRequired checks if the required fields are not zero-ed +func AssertWebhookResultRequestRequired(obj WebhookResultRequest) error { + for _, el := range obj.Headers { + if err := AssertHttpHeaderRequired(el); err != nil { + return err + } + } + return nil +} + +// AssertRecurseWebhookResultRequestRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of WebhookResultRequest (e.g. [][]WebhookResultRequest), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseWebhookResultRequestRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aWebhookResultRequest, ok := obj.(WebhookResultRequest) + if !ok { + return ErrTypeAssertionError + } + return AssertWebhookResultRequestRequired(aWebhookResultRequest) + }) +} diff --git a/server/openapi/model_webhook_result_response.go b/server/openapi/model_webhook_result_response.go new file mode 100644 index 0000000000..b2832615b1 --- /dev/null +++ b/server/openapi/model_webhook_result_response.go @@ -0,0 +1,44 @@ +/* + * TraceTest + * + * OpenAPI definition for TraceTest endpoint and resources + * + * API version: 0.2.1 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +type WebhookResultResponse struct { + StatusCode int32 `json:"statusCode,omitempty"` + + Status string `json:"status,omitempty"` + + Body string `json:"body,omitempty"` + + Headers []HttpHeader `json:"headers,omitempty"` + + Error string `json:"error,omitempty"` +} + +// AssertWebhookResultResponseRequired checks if the required fields are not zero-ed +func AssertWebhookResultResponseRequired(obj WebhookResultResponse) error { + for _, el := range obj.Headers { + if err := AssertHttpHeaderRequired(el); err != nil { + return err + } + } + return nil +} + +// AssertRecurseWebhookResultResponseRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of WebhookResultResponse (e.g. [][]WebhookResultResponse), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseWebhookResultResponseRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aWebhookResultResponse, ok := obj.(WebhookResultResponse) + if !ok { + return ErrTypeAssertionError + } + return AssertWebhookResultResponseRequired(aWebhookResultResponse) + }) +} diff --git a/web/src/types/Generated.types.ts b/web/src/types/Generated.types.ts index 4b8a2d0709..62df249501 100644 --- a/web/src/types/Generated.types.ts +++ b/web/src/types/Generated.types.ts @@ -145,12 +145,18 @@ export interface paths { "/pollingprofiles": { /** List Polling Profile configuration */ get: operations["listPollingProfile"]; + /** Upsert new polling profile */ + put: operations["upsertPollingProfile"]; + /** Create Polling Profile configuration */ + post: operations["createPollingProfile"]; }; "/pollingprofiles/{pollingProfileId}": { /** Get a polling profile used on Tracetest to configure how to fetch traces in a test. */ get: operations["getPollingProfile"]; /** Update a polling profile used on Tracetest to configure how to fetch traces in a test. */ put: operations["updatePollingProfile"]; + /** Delete a polling profile used on Tracetest. */ + delete: operations["deletePollingProfile"]; }; "/demos": { /** List demonstrations used on Tracetest as quick start examples. */ @@ -200,7 +206,7 @@ export interface paths { /** Create an Linter that can be used by tests and Linters */ post: operations["createLinter"]; }; - "/linters/{LinterId}": { + "/linters/{linterId}": { /** Get one Linter by its id */ get: operations["getLinter"]; /** Update a Linter used on Tracetest */ @@ -214,6 +220,102 @@ export interface paths { /** Update a Wizard used on Tracetest */ put: operations["updateWizard"]; }; + "/rungroups": { + /** Get all the run groups in the system */ + get: operations["getRunGroups"]; + /** Create a RunGroup used on Tracetest */ + post: operations["createRunGroup"]; + }; + "/rungroups/{runGroupId}": { + /** Get a run groups in the system */ + get: operations["getRunGroup"]; + parameters: {}; + }; + "/monitors": { + /** List the monitors */ + get: operations["listMonitors"]; + /** Upsert a Monitor used on Tracetest */ + put: operations["upsertMonitor"]; + /** Create a Monitor used on Tracetest */ + post: operations["creteMonitor"]; + }; + "/monitors/{monitorId}": { + /** Get a Monitor */ + get: operations["getMonitor"]; + /** Update a Monitor */ + put: operations["updateMonitor"]; + /** Delete a Monitor */ + delete: operations["deleteMonitor"]; + }; + "/monitors/{monitorId}/version/{version}": { + /** Get a Monitor with Version */ + get: operations["getMonitorVersion"]; + }; + "/monitors/{monitorId}/run": { + /** Get a Monitor runs */ + get: operations["getMonitorRuns"]; + /** run a particular Monitor */ + post: operations["runMonitor"]; + }; + "/monitors/{monitorId}/run/{runId}": { + /** Get a specific run from a particular Monitor */ + get: operations["getMonitorRun"]; + /** Delete a Monitor */ + delete: operations["deleteMonitorRun"]; + }; + "/monitors/alerts": { + /** Tests the alert trigger */ + post: operations["testAlert"]; + }; + "/invites": { + /** Lists pending invites */ + get: operations["listInvites"]; + /** Upserts invite */ + put: operations["upsertInvite"]; + /** Creates pending email invite */ + post: operations["createInvite"]; + }; + "/invites/{inviteID}": { + /** get invite */ + get: operations["getInvite"]; + /** Updates pending email invite */ + put: operations["updateInvite"]; + /** delete pending invite */ + delete: operations["deleteInvite"]; + parameters: {}; + }; + "/tokens": { + /** Lists tokens */ + get: operations["listTokens"]; + /** Upserts a new token */ + put: operations["upsertToken"]; + /** Creates a new token */ + post: operations["createToken"]; + }; + "/tokens/{tokenID}": { + /** update token */ + put: operations["updateToken"]; + /** delete token */ + delete: operations["deleteToken"]; + parameters: {}; + }; + "/environments": { + /** List environments from an organization */ + get: operations["listEnvironments"]; + /** Upsert test environment */ + put: operations["upsertEnvironment"]; + /** Create test environment */ + post: operations["createEnvironment"]; + }; + "/environments/{environmentID}": { + /** Get test environment by ID from CRD in kubernetes cluster */ + get: operations["getEnvironment"]; + /** Update environment with given request body */ + put: operations["updateEnvironment"]; + /** Deletes a test environment */ + delete: operations["deleteEnvironment"]; + parameters: {}; + }; } export interface components {} @@ -839,6 +941,44 @@ export interface operations { 500: unknown; }; }; + /** Upsert new polling profile */ + upsertPollingProfile: { + responses: { + /** successful operation */ + 200: { + content: { + "application/json": external["config.yaml"]["components"]["schemas"]["PollingProfile"]; + "text/yaml": external["config.yaml"]["components"]["schemas"]["PollingProfile"]; + }; + }; + }; + requestBody: { + content: { + "application/json": external["config.yaml"]["components"]["schemas"]["PollingProfile"]; + "text/yaml": external["config.yaml"]["components"]["schemas"]["PollingProfile"]; + }; + }; + }; + /** Create Polling Profile configuration */ + createPollingProfile: { + responses: { + /** successful operation */ + 200: { + content: { + "application/json": external["config.yaml"]["components"]["schemas"]["PollingProfile"]; + "text/yaml": external["config.yaml"]["components"]["schemas"]["PollingProfile"]; + }; + }; + /** problem creating the polling profile */ + 500: unknown; + }; + requestBody: { + content: { + "application/json": external["config.yaml"]["components"]["schemas"]["PollingProfile"]; + "text/yaml": external["config.yaml"]["components"]["schemas"]["PollingProfile"]; + }; + }; + }; /** Get a polling profile used on Tracetest to configure how to fetch traces in a test. */ getPollingProfile: { parameters: {}; @@ -881,6 +1021,18 @@ export interface operations { }; }; }; + /** Delete a polling profile used on Tracetest. */ + deletePollingProfile: { + parameters: {}; + responses: { + /** successful operation */ + 204: never; + /** polling profile not found */ + 404: unknown; + /** problem getting a polling profile */ + 500: unknown; + }; + }; /** List demonstrations used on Tracetest as quick start examples. */ listDemos: { parameters: {}; @@ -1265,160 +1417,544 @@ export interface operations { }; }; }; -} - -export interface external { - "config.yaml": { - paths: {}; - components: { - schemas: { - TestConnectionResponse: { - successful?: boolean; - steps?: external["config.yaml"]["components"]["schemas"]["ConnectionResult"][]; - }; - ConnectionResult: { - portCheck?: external["config.yaml"]["components"]["schemas"]["ConnectionTestStep"]; - connectivity?: external["config.yaml"]["components"]["schemas"]["ConnectionTestStep"]; - authentication?: external["config.yaml"]["components"]["schemas"]["ConnectionTestStep"]; - fetchTraces?: external["config.yaml"]["components"]["schemas"]["ConnectionTestStep"]; - }; - ConnectionTestStep: { - passed?: boolean; - /** @enum {string} */ - status?: "passed" | "warning" | "failed"; - message?: string; - error?: string; - }; - ConfigurationResourceList: { - count?: number; - items?: external["config.yaml"]["components"]["schemas"]["ConfigurationResource"][]; - }; - /** @description Represents a configuration structured into the Resources format. */ - ConfigurationResource: { - /** - * @description Represents the type of this resource. It should always be set as 'Config'. - * @enum {string} - */ - type?: "Config"; - /** @description Represents the set of configuration common options for Tracetest. */ - spec?: { - /** - * @description ID of the configuration resource. It should always be set as 'current'. - * @enum {string} - */ - id?: "current"; - /** - * @description Name given for this configuration set. It should always be set as 'Config'. - * @enum {string} - */ - name?: "Config"; - /** @description Flag telling if a user allow Tracetest to send analytics about its usage. */ - analyticsEnabled: boolean; - }; - }; - PollingProfileList: { - count?: number; - items?: external["config.yaml"]["components"]["schemas"]["PollingProfile"][]; - }; - /** @description Represents a polling profile structured into the Resources format. */ - PollingProfile: { - /** - * @description Represents the type of this resource. It should always be set as 'PollingProfile'. - * @enum {string} - */ - type?: "PollingProfile"; - /** @description Represents the attributes of a Polling Profile. */ - spec?: { - /** @description ID of this Polling Profile. */ - id: string; - /** @description Name given for this profile. */ - name: string; - /** @description Is default polling profile */ - default?: boolean; - /** - * @description Name of the strategy that will be used on this profile. - * @enum {string} - */ - strategy: "periodic"; - /** @description Configuration for the strategy 'periodic'. It only should be filled if the field strategy is equals to 'periodic'. */ - periodic?: { - /** @description Time that the poller should wait until try to fetch more traces. It should be written in duration format (example: 1s, 30s, 1m). */ - retryDelay?: string; - /** @description Total time that the poller should try to continue to fetch traces. It should be written in duration format (example: 1s, 30s, 1m). */ - timeout?: string; - }; - }; + /** Get all the run groups in the system */ + getRunGroups: { + parameters: {}; + responses: { + /** successful operation */ + 200: { + headers: { + /** Total records count */ + "X-Total-Count"?: number; }; - /** @description Represents the settings of the Pokeshop API demonstration. */ - DemoPokeshop: { - /** @description HTTP endpoint for Pokeshop API */ - httpEndpoint?: string; - /** @description gRPC endpoint for Pokeshop API */ - grpcEndpoint?: string; - /** @description kafka broker for Pokeshop API */ - kafkaBroker?: string; + content: { + "application/json": external["runGroups.yaml"]["components"]["schemas"]["RunGroupList"]; }; - /** @description Represents the settings of the Open Telemetry Store demonstration. */ - DemoOpenTelemetryStore: { - /** @description Address of the root URL for the Frontend microservice on Open Telemetry Store. */ - frontendEndpoint?: string; - /** @description Address of the root URL for the Product Catalog microservice on Open Telemetry Store. */ - productCatalogEndpoint?: string; - /** @description Address of the root URL for the Cart microservice on Open Telemetry Store. */ - cartEndpoint?: string; - /** @description Address of the root URL for the Checkout microservice on Open Telemetry Store. */ - checkoutEndpoint?: string; + }; + /** Run Groups not found */ + 404: unknown; + /** problem getting the Run Groups */ + 500: unknown; + }; + }; + /** Create a RunGroup used on Tracetest */ + createRunGroup: { + responses: { + /** successful operation */ + 200: { + content: { + "application/json": external["runGroups.yaml"]["components"]["schemas"]["RunGroup"]; }; - /** @description Represents a demonstration API structured into the Resources format. */ - Demo: { - /** - * @description Represents the type of this resource. It should always be set as 'Demo'. - * @enum {string} - */ - type?: "Demo"; - /** @description Represents the attributes of a Demonstration API. */ - spec?: { - id?: string; - /** - * @description String defining that this demo is a Open Telemetry Store demo. - * @enum {string} - */ - type?: "otelstore" | "pokeshop"; - /** @description Name of the demo */ - name?: string; - /** @description Flag telling if this API is enabled on Tracetest. */ - enabled: boolean; - pokeshop?: external["config.yaml"]["components"]["schemas"]["DemoPokeshop"]; - opentelemetryStore?: external["config.yaml"]["components"]["schemas"]["DemoOpenTelemetryStore"]; - }; + }; + /** invalid RunGroup, some data was sent in incorrect format. */ + 400: unknown; + /** RunGroup not found */ + 404: unknown; + /** problem updating an RunGroup */ + 500: unknown; + }; + requestBody: { + content: { + "application/json": external["runGroups.yaml"]["components"]["schemas"]["RunGroup"]; + }; + }; + }; + /** Get a run groups in the system */ + getRunGroup: { + parameters: {}; + responses: { + /** successful operation */ + 200: { + content: { + "application/json": external["runGroups.yaml"]["components"]["schemas"]["RunGroup"]; }; - DemoList: { - count?: number; - items?: external["config.yaml"]["components"]["schemas"]["Demo"][]; + }; + /** Run Group not found */ + 404: unknown; + /** problem getting the Run Group */ + 500: unknown; + }; + }; + /** List the monitors */ + listMonitors: { + responses: { + /** successful operation */ + 200: { + content: { + "application/json": external["monitors.yaml"]["components"]["schemas"]["MonitorResourceList"]; }; - OTLPTestConnectionResponse: { - spanCount?: number; - lastSpanTimestamp?: string; + }; + /** Monitors not found */ + 404: unknown; + /** problem getting the Monitor list */ + 500: unknown; + }; + }; + /** Upsert a Monitor used on Tracetest */ + upsertMonitor: { + responses: { + /** successful operation */ + 200: { + content: { + "application/json": external["monitors.yaml"]["components"]["schemas"]["MonitorResource"]; }; }; + /** invalid Monitor, some data was sent in incorrect format. */ + 400: unknown; + /** Monitor not found */ + 404: unknown; + /** problem upserting an Monitor */ + 500: unknown; + }; + requestBody: { + content: { + "application/json": external["monitors.yaml"]["components"]["schemas"]["MonitorResource"]; + }; }; - operations: {}; }; - "dataStores.yaml": { - paths: {}; - components: { - schemas: { - DataStoreList: { - count?: number; - items?: external["dataStores.yaml"]["components"]["schemas"]["DataStoreResource"][]; + /** Create a Monitor used on Tracetest */ + creteMonitor: { + responses: { + /** successful operation */ + 200: { + content: { + "application/json": external["monitors.yaml"]["components"]["schemas"]["MonitorResource"]; }; - /** @description Represents a data store structured into the Resources format. */ - DataStoreResource: { - /** - * @description Represents the type of this resource. It should always be set as 'DataStore'. - * @enum {string} - */ - type?: "DataStore"; + }; + /** invalid Monitor, some data was sent in incorrect format. */ + 400: unknown; + /** Monitor not found */ + 404: unknown; + /** problem creating an Monitor */ + 500: unknown; + }; + requestBody: { + content: { + "application/json": external["monitors.yaml"]["components"]["schemas"]["MonitorResource"]; + }; + }; + }; + /** Get a Monitor */ + getMonitor: { + parameters: {}; + responses: { + /** successful operation */ + 200: { + content: { + "application/json": external["monitors.yaml"]["components"]["schemas"]["MonitorResource"]; + }; + }; + /** Monitor not found */ + 404: unknown; + /** problem getting a Monitor */ + 500: unknown; + }; + }; + /** Update a Monitor */ + updateMonitor: { + parameters: {}; + responses: { + /** successful operation */ + 204: never; + /** invalid Monitor, some data was sent in incorrect format. */ + 400: unknown; + /** Monitor not found */ + 404: unknown; + /** problem updating a Monitor */ + 500: unknown; + }; + requestBody: { + content: { + "application/json": external["monitors.yaml"]["components"]["schemas"]["MonitorResource"]; + }; + }; + }; + /** Delete a Monitor */ + deleteMonitor: { + parameters: {}; + responses: { + /** successful operation */ + 204: never; + /** invalid Monitor, some data was sent in incorrect format. */ + 400: unknown; + /** Monitor not found */ + 404: unknown; + /** problem deleting a Monitor */ + 500: unknown; + }; + }; + /** Get a Monitor with Version */ + getMonitorVersion: { + parameters: {}; + responses: { + /** successful operation */ + 200: { + content: { + "application/json": external["monitors.yaml"]["components"]["schemas"]["Monitor"]; + }; + }; + /** Monitor not found */ + 404: unknown; + /** problem getting a Monitor */ + 500: unknown; + }; + }; + /** Get a Monitor runs */ + getMonitorRuns: { + parameters: {}; + responses: { + /** successful operation */ + 200: { + content: { + "application/json": { + items?: external["monitors.yaml"]["components"]["schemas"]["MonitorRun"][]; + count?: number; + }; + }; + }; + /** Monitor not found */ + 404: unknown; + /** problem getting a Monitor runs */ + 500: unknown; + }; + }; + /** run a particular Monitor */ + runMonitor: { + parameters: {}; + responses: { + /** successful operation */ + 200: { + content: { + "application/json": external["monitors.yaml"]["components"]["schemas"]["MonitorRun"]; + }; + }; + }; + requestBody: { + content: { + "application/json": external["monitors.yaml"]["components"]["schemas"]["RunMonitorInformation"]; + }; + }; + }; + /** Get a specific run from a particular Monitor */ + getMonitorRun: { + parameters: {}; + responses: { + /** OK */ + 200: { + content: { + "application/json": external["monitors.yaml"]["components"]["schemas"]["MonitorRun"]; + }; + }; + /** MonitorRun run not found */ + 404: unknown; + }; + }; + /** Delete a Monitor */ + deleteMonitorRun: { + parameters: {}; + responses: { + /** successful operation */ + 204: never; + /** invalid Monitor, some data was sent in incorrect format. */ + 400: unknown; + /** Monitor not found */ + 404: unknown; + /** problem deleting a Monitor */ + 500: unknown; + }; + }; + /** Tests the alert trigger */ + testAlert: { + responses: { + /** Test alert Result */ + 201: { + content: { + "application/json": external["monitors.yaml"]["components"]["schemas"]["AlertResult"]; + }; + }; + }; + requestBody: { + content: { + "text/json": external["monitors.yaml"]["components"]["schemas"]["Alert"]; + }; + }; + }; + /** Lists pending invites */ + listInvites: { + parameters: {}; + responses: { + 200: external["invites.yaml"]["components"]["responses"]["InviteResources"]; + }; + }; + /** Upserts invite */ + upsertInvite: { + responses: { + 201: external["invites.yaml"]["components"]["responses"]["InviteResource"]; + }; + requestBody: external["invites.yaml"]["components"]["requestBodies"]["InviteResource"]; + }; + /** Creates pending email invite */ + createInvite: { + responses: { + 201: external["invites.yaml"]["components"]["responses"]["InviteResource"]; + }; + requestBody: external["invites.yaml"]["components"]["requestBodies"]["InviteResource"]; + }; + /** get invite */ + getInvite: { + parameters: {}; + responses: { + 200: external["invites.yaml"]["components"]["responses"]["InviteResource"]; + }; + }; + /** Updates pending email invite */ + updateInvite: { + parameters: {}; + responses: { + 201: external["invites.yaml"]["components"]["responses"]["InviteResource"]; + }; + requestBody: external["invites.yaml"]["components"]["requestBodies"]["InviteResource"]; + }; + /** delete pending invite */ + deleteInvite: { + parameters: {}; + responses: { + 201: external["invites.yaml"]["components"]["responses"]["InviteResource"]; + }; + }; + /** Lists tokens */ + listTokens: { + parameters: {}; + responses: { + 200: external["tokens.yaml"]["components"]["responses"]["Tokens"]; + }; + }; + /** Upserts a new token */ + upsertToken: { + responses: { + 201: external["tokens.yaml"]["components"]["responses"]["Token"]; + }; + requestBody: external["tokens.yaml"]["components"]["requestBodies"]["Token"]; + }; + /** Creates a new token */ + createToken: { + responses: { + 201: external["tokens.yaml"]["components"]["responses"]["Token"]; + }; + requestBody: external["tokens.yaml"]["components"]["requestBodies"]["Token"]; + }; + /** update token */ + updateToken: { + parameters: {}; + responses: { + 201: external["tokens.yaml"]["components"]["responses"]["Token"]; + }; + }; + /** delete token */ + deleteToken: { + parameters: {}; + responses: { + 201: external["tokens.yaml"]["components"]["responses"]["Token"]; + }; + }; + /** List environments from an organization */ + listEnvironments: { + parameters: {}; + responses: { + 200: external["environments.yaml"]["components"]["responses"]["EnvironmentResources"]; + }; + }; + /** Upsert test environment */ + upsertEnvironment: { + responses: { + 200: external["environments.yaml"]["components"]["responses"]["EnvironmentResource"]; + }; + requestBody: external["environments.yaml"]["components"]["requestBodies"]["EnvironmentResource"]; + }; + /** Create test environment */ + createEnvironment: { + responses: { + 200: external["environments.yaml"]["components"]["responses"]["Environment"]; + }; + requestBody: external["environments.yaml"]["components"]["requestBodies"]["EnvironmentResource"]; + }; + /** Get test environment by ID from CRD in kubernetes cluster */ + getEnvironment: { + parameters: {}; + responses: { + 200: external["environments.yaml"]["components"]["responses"]["EnvironmentResource"]; + }; + }; + /** Update environment with given request body */ + updateEnvironment: { + parameters: {}; + responses: { + 200: external["environments.yaml"]["components"]["responses"]["EnvironmentResource"]; + }; + requestBody: external["environments.yaml"]["components"]["requestBodies"]["EnvironmentResource"]; + }; + /** Deletes a test environment */ + deleteEnvironment: { + parameters: {}; + responses: { + 204: external["environments.yaml"]["components"]["responses"]["EnvironmentResource"]; + }; + }; +} + +export interface external { + "config.yaml": { + paths: {}; + components: { + schemas: { + TestConnectionResponse: { + successful?: boolean; + steps?: external["config.yaml"]["components"]["schemas"]["ConnectionResult"][]; + }; + ConnectionResult: { + portCheck?: external["config.yaml"]["components"]["schemas"]["ConnectionTestStep"]; + connectivity?: external["config.yaml"]["components"]["schemas"]["ConnectionTestStep"]; + authentication?: external["config.yaml"]["components"]["schemas"]["ConnectionTestStep"]; + fetchTraces?: external["config.yaml"]["components"]["schemas"]["ConnectionTestStep"]; + }; + ConnectionTestStep: { + passed?: boolean; + /** @enum {string} */ + status?: "passed" | "warning" | "failed"; + message?: string; + error?: string; + }; + ConfigurationResourceList: { + count?: number; + items?: external["config.yaml"]["components"]["schemas"]["ConfigurationResource"][]; + }; + /** @description Represents a configuration structured into the Resources format. */ + ConfigurationResource: { + /** + * @description Represents the type of this resource. It should always be set as 'Config'. + * @enum {string} + */ + type?: "Config"; + /** @description Represents the set of configuration common options for Tracetest. */ + spec?: { + /** + * @description ID of the configuration resource. It should always be set as 'current'. + * @enum {string} + */ + id?: "current"; + /** + * @description Name given for this configuration set. It should always be set as 'Config'. + * @enum {string} + */ + name?: "Config"; + /** @description Flag telling if a user allow Tracetest to send analytics about its usage. */ + analyticsEnabled: boolean; + }; + }; + PollingProfileList: { + count?: number; + items?: external["config.yaml"]["components"]["schemas"]["PollingProfile"][]; + }; + /** @description Represents a polling profile structured into the Resources format. */ + PollingProfile: { + /** + * @description Represents the type of this resource. It should always be set as 'PollingProfile'. + * @enum {string} + */ + type?: "PollingProfile"; + /** @description Represents the attributes of a Polling Profile. */ + spec?: { + /** @description ID of this Polling Profile. */ + id: string; + /** @description Name given for this profile. */ + name: string; + /** @description Is default polling profile */ + default?: boolean; + /** + * @description Name of the strategy that will be used on this profile. + * @enum {string} + */ + strategy: "periodic" | "no-polling"; + /** @description Configuration for the strategy 'periodic'. It only should be filled if the field strategy is equals to 'periodic'. */ + periodic?: { + /** @description Time that the poller should wait until try to fetch more traces. It should be written in duration format (example: 1s, 30s, 1m). */ + retryDelay?: string; + /** @description Total time that the poller should try to continue to fetch traces. It should be written in duration format (example: 1s, 30s, 1m). */ + timeout?: string; + selectorMatchRetries?: number; + }; + }; + }; + /** @description Represents the settings of the Pokeshop API demonstration. */ + DemoPokeshop: { + /** @description HTTP endpoint for Pokeshop API */ + httpEndpoint?: string; + /** @description gRPC endpoint for Pokeshop API */ + grpcEndpoint?: string; + /** @description kafka broker for Pokeshop API */ + kafkaBroker?: string; + }; + /** @description Represents the settings of the Open Telemetry Store demonstration. */ + DemoOpenTelemetryStore: { + /** @description Address of the root URL for the Frontend microservice on Open Telemetry Store. */ + frontendEndpoint?: string; + /** @description Address of the root URL for the Product Catalog microservice on Open Telemetry Store. */ + productCatalogEndpoint?: string; + /** @description Address of the root URL for the Cart microservice on Open Telemetry Store. */ + cartEndpoint?: string; + /** @description Address of the root URL for the Checkout microservice on Open Telemetry Store. */ + checkoutEndpoint?: string; + }; + /** @description Represents a demonstration API structured into the Resources format. */ + Demo: { + /** + * @description Represents the type of this resource. It should always be set as 'Demo'. + * @enum {string} + */ + type?: "Demo"; + /** @description Represents the attributes of a Demonstration API. */ + spec?: { + id?: string; + /** + * @description String defining that this demo is a Open Telemetry Store demo. + * @enum {string} + */ + type?: "otelstore" | "pokeshop"; + /** @description Name of the demo */ + name?: string; + /** @description Flag telling if this API is enabled on Tracetest. */ + enabled: boolean; + pokeshop?: external["config.yaml"]["components"]["schemas"]["DemoPokeshop"]; + opentelemetryStore?: external["config.yaml"]["components"]["schemas"]["DemoOpenTelemetryStore"]; + }; + }; + DemoList: { + count?: number; + items?: external["config.yaml"]["components"]["schemas"]["Demo"][]; + }; + OTLPTestConnectionResponse: { + spanCount?: number; + lastSpanTimestamp?: string; + }; + }; + }; + operations: {}; + }; + "dataStores.yaml": { + paths: {}; + components: { + schemas: { + DataStoreList: { + count?: number; + items?: external["dataStores.yaml"]["components"]["schemas"]["DataStoreResource"][]; + }; + /** @description Represents a data store structured into the Resources format. */ + DataStoreResource: { + /** + * @description Represents the type of this resource. It should always be set as 'DataStore'. + * @enum {string} + */ + type?: "DataStore"; spec?: external["dataStores.yaml"]["components"]["schemas"]["DataStore"]; }; DataStore: { @@ -1536,6 +2072,98 @@ export interface external { }; operations: {}; }; + "environments.yaml": { + paths: {}; + components: { + schemas: { + EnvironmentResources: { + items?: external["environments.yaml"]["components"]["schemas"]["EnvironmentResource"][]; + count?: number; + }; + EnvironmentsMe: { + elements?: external["environments.yaml"]["components"]["schemas"]["Environment"][]; + count?: number; + }; + Environments: { + items?: external["environments.yaml"]["components"]["schemas"]["Environment"][]; + count?: number; + }; + EnvironmentResource: { + /** @enum {string} */ + type?: "Environment"; + spec?: external["environments.yaml"]["components"]["schemas"]["Environment"]; + }; + Environment: { + id?: string; + name?: string; + description?: string; + labels?: { [key: string]: string }; + /** Format: date-time */ + createdAt?: string; + /** Format: date-time */ + updatedAt?: string; + isLocal?: boolean; + userID?: string; + /** + * @description organizationID + * @example 733420bd-7e56-461f-8431-6378759e60ae + */ + organizationID?: string; + agentApiKey?: string; + resources?: string; + } & { + connected: unknown; + }; + }; + responses: { + /** successful operation for environment */ + EnvironmentResource: { + content: { + "application/json": external["environments.yaml"]["components"]["schemas"]["EnvironmentResource"]; + }; + }; + /** successful operation for environment */ + Environment: { + content: { + "application/json": external["environments.yaml"]["components"]["schemas"]["Environment"]; + }; + }; + /** successful operation for environment */ + EnvironmentResources: { + content: { + "application/json": external["environments.yaml"]["components"]["schemas"]["EnvironmentResources"]; + }; + }; + /** successful operation for environment */ + Environments: { + content: { + "application/json": external["environments.yaml"]["components"]["schemas"]["Environments"]; + }; + }; + /** successful operation for environment */ + EnvironmentsMe: { + content: { + "application/json": external["environments.yaml"]["components"]["schemas"]["EnvironmentsMe"]; + }; + }; + }; + requestBodies: { + /** environment details body */ + Environment: { + content: { + "application/json": external["environments.yaml"]["components"]["schemas"]["Environment"]; + }; + }; + /** environment resource details body */ + EnvironmentResource: { + content: { + "application/json": external["environments.yaml"]["components"]["schemas"]["EnvironmentResource"]; + }; + }; + }; + }; + operations: {}; + }; "expressions.yaml": { paths: {}; components: { @@ -1643,6 +2271,93 @@ export interface external { }; operations: {}; }; + "invites.yaml": { + paths: {}; + components: { + schemas: { + InviteResource: { + /** @enum {string} */ + type?: "Invite"; + spec?: external["invites.yaml"]["components"]["schemas"]["Invite"]; + }; + Invite: { + id: string; + role: external["members.yaml"]["components"]["schemas"]["Role"]; + to: string; + /** Format: date-time */ + createdAt?: string; + /** Format: date-time */ + sentAt?: string; + /** + * @default email + * @enum {string} + */ + type?: "email" | "public"; + /** + * @default pending + * @enum {string} + */ + status?: "pending" | "accepted" | "revoked"; + returnTo?: string; + environments?: external["invites.yaml"]["components"]["schemas"]["InviteEnvironment"][]; + }; + InviteEnvironment: { + id: string; + role: external["members.yaml"]["components"]["schemas"]["Role"]; + environment?: external["environments.yaml"]["components"]["schemas"]["Environment"]; + }; + InviteResources: { + items?: external["invites.yaml"]["components"]["schemas"]["InviteResource"][]; + count?: number; + }; + Invites: { + items?: external["invites.yaml"]["components"]["schemas"]["Invite"][]; + count?: number; + }; + }; + responses: { + /** successful operation for invites */ + Invites: { + content: { + "application/json": external["invites.yaml"]["components"]["schemas"]["Invites"]; + }; + }; + /** successful operation for invites */ + InviteResources: { + content: { + "application/json": external["invites.yaml"]["components"]["schemas"]["InviteResources"]; + }; + }; + /** successful operation for invites */ + Invite: { + content: { + "application/json": external["invites.yaml"]["components"]["schemas"]["Invite"]; + }; + }; + /** successful operation for invites */ + InviteResource: { + content: { + "application/json": external["invites.yaml"]["components"]["schemas"]["InviteResource"]; + }; + }; + }; + requestBodies: { + /** invite details body */ + Invite: { + content: { + "application/json": external["invites.yaml"]["components"]["schemas"]["Invite"]; + }; + }; + /** invite resource details body */ + InviteResource: { + content: { + "application/json": external["invites.yaml"]["components"]["schemas"]["InviteResource"]; + }; + }; + }; + }; + operations: {}; + }; "kafka.yaml": { paths: {}; components: { @@ -1753,26 +2468,222 @@ export interface external { }; operations: {}; }; + "members.yaml": { + paths: {}; + components: { + schemas: { + /** @enum {string} */ + Role: + | "owners" + | "members" + | "admins" + | "billers" + | "engineers" + | "runners" + | "agent"; + Member: { + id: string; + role: external["members.yaml"]["components"]["schemas"]["Role"]; + user: external["users.yaml"]["components"]["schemas"]["User"]; + invite?: external["invites.yaml"]["components"]["schemas"]["Invite"]; + }; + Members: { + elements?: external["members.yaml"]["components"]["schemas"]["Member"][]; + nextToken?: string; + }; + }; + responses: { + /** successful operation for members */ + Members: { + content: { + "application/json": external["members.yaml"]["components"]["schemas"]["Members"]; + }; + }; + /** successful operation for members */ + Member: { + content: { + "application/json": external["members.yaml"]["components"]["schemas"]["Member"]; + }; + }; + }; + requestBodies: { + /** member role update body */ + MemberRole: { + content: { + "application/json": { + role: external["members.yaml"]["components"]["schemas"]["Role"]; + }; + }; + }; + /** member role update body */ + AssignMember: { + content: { + "application/json": { + role: external["members.yaml"]["components"]["schemas"]["Role"]; + id: string; + }; + }; + }; + }; + }; + operations: {}; + }; + "monitors.yaml": { + paths: {}; + components: { + schemas: { + MonitorResourceList: { + count?: number; + items?: external["monitors.yaml"]["components"]["schemas"]["MonitorResource"][]; + }; + /** @description Represents a Monitor structured into the Resources format. */ + MonitorResource: { + /** + * @description Represents the type of this resource. It should always be set as 'Monitor'. + * @enum {string} + */ + type?: "Monitor"; + spec?: external["monitors.yaml"]["components"]["schemas"]["Monitor"]; + }; + Monitor: { + id?: string; + version?: number; + name?: string; + /** Format: date-time */ + createdAt?: string; + /** Format: date-time */ + deletedAt?: string; + /** Format: date-time */ + updatedAt?: string; + enabled?: boolean; + /** @description list of steps of the Monitor containing just each test id */ + tests?: string[]; + /** @description list of steps of the Monitor containing just each test suite id */ + testSuites?: string[]; + /** @description list of steps of the Monitor containing the whole test object */ + fullTests?: external["tests.yaml"]["components"]["schemas"]["Test"][]; + /** @description list of steps of the Monitor containing the whole test suite object */ + fullTestSuites?: external["testsuites.yaml"]["components"]["schemas"]["TestSuite"][]; + variableSetId?: string; + tokenId?: string; + schedule?: external["monitors.yaml"]["components"]["schemas"]["Schedule"]; + alerts?: external["monitors.yaml"]["components"]["schemas"]["Alert"][]; + summary?: external["monitors.yaml"]["components"]["schemas"]["Summary"]; + }; + Summary: { + runs?: number; + lastState?: string; + /** Format: date-time */ + lastRunTime?: string; + }; + Schedule: { + cron?: string; + timeZone?: string; + }; + Alert: { + id?: string; + /** @enum {string} */ + type?: "webhook"; + webhook?: external["monitors.yaml"]["components"]["schemas"]["Webhook"]; + events?: "FAILED"[]; + }; + Webhook: { + url?: string; + body?: string; + /** @enum {string} */ + method?: + | "GET" + | "POST" + | "PUT" + | "DELETE" + | "PATCH" + | "HEAD" + | "OPTIONS"; + headers?: external["http.yaml"]["components"]["schemas"]["HTTPHeader"][]; + sslVerification?: boolean; + }; + MonitorRun: { + id?: number; + monitorId?: string; + monitorVersion?: number; + runGroupId?: string; + /** Format: date-time */ + createdAt?: string; + /** Format: date-time */ + completedAt?: string; + /** + * @default SCHEDULED + * @enum {string} + */ + executionType?: "MANUAL" | "SCHEDULED"; + lastError?: string; + /** @enum {string} */ + state?: "CREATED" | "EXECUTING" | "FINISHED" | "FAILED"; + variableSet?: external["variableSets.yaml"]["components"]["schemas"]["VariableSet"]; + metadata?: { [key: string]: string }; + testRunsCount?: number; + testSuiteRunsCount?: number; + /** @description list of test runs of the Monitor Run */ + testRuns?: external["tests.yaml"]["components"]["schemas"]["TestRun"][]; + /** @description list of test suite runs of the Monitor Run */ + testSuiteRuns?: external["testsuites.yaml"]["components"]["schemas"]["TestSuiteRun"][]; + alerts?: external["monitors.yaml"]["components"]["schemas"]["AlertResult"][]; + }; + AlertResult: { + alertId?: string; + id?: string; + webhook?: external["monitors.yaml"]["components"]["schemas"]["WebhookResult"]; + /** @enum {string} */ + type?: "webhook"; + }; + WebhookResult: { + request?: { + url?: string; + headers?: external["http.yaml"]["components"]["schemas"]["HTTPHeader"][]; + body?: string; + /** @enum {string} */ + method?: + | "GET" + | "POST" + | "PUT" + | "DELETE" + | "PATCH" + | "HEAD" + | "OPTIONS"; + }; + response?: { + statusCode?: number; + status?: string; + body?: string; + headers?: external["http.yaml"]["components"]["schemas"]["HTTPHeader"][]; + error?: string; + }; + }; + RunMonitorInformation: { + metadata?: { [key: string]: string } | null; + runGroupId?: string; + /** @enum {string} */ + runType?: "SCHEDULED" | "MANUAL"; + variables?: external["variableSets.yaml"]["components"]["schemas"]["VariableSetValue"][]; + }; + }; + }; + operations: {}; + }; "parameters.yaml": { paths: {}; components: { parameters: { - /** @description id of the test */ - testId: string; - /** @description id of the run */ - runId: number; - /** @description version of the test */ - version: number; - /** @description id of the TestSuite */ - testSuiteId: string; /** @description indicates how many resources can be returned by each page */ take: number; /** @description indicates how many resources will be skipped when paginating */ skip: number; /** @description query to search resources */ query: string; + /** @description query to search resources by status */ + status: string; /** @description indicates the sort field for the resources */ - runnableResourceSortBy: "created" | "name" | "last_run"; + runnableResourceSortBy: "created" | "name" | "status" | "last_run"; /** @description indicates the sort field for the resources */ sortBy: "created" | "name"; /** @description indicates the sort field for the resources */ @@ -1790,8 +2701,74 @@ export interface external { /** @description ID of a VariableSet used on Tracetest to inject values into tests and TestSuites */ variableSetId: string; /** @description ID of an Linter */ - LinterId: string; + linterId: string; fileExtension: string; + /** @description id of the test */ + testId: string; + /** @description id of the run */ + runId: number; + /** @description version of the test */ + version: number; + /** @description id of the TestSuite */ + testSuiteId: string; + /** @description ID of a monitor used on Tracetest */ + monitorId: string; + /** @description ID of an RunGroup */ + runGroupId: string; + /** @description IDs for RunGroup */ + runGroupIds: string; + /** @description ID for invite */ + inviteID: string; + /** @description ID for token */ + tokenID: string; + /** @description ID for environment */ + environmentID: string; + /** @description name of filters */ + filters: string; + /** @description id of the tests */ + testIds: string; + /** @description group of the runs */ + group: string; + /** @description source of the runs */ + source: string; + /** @description token of the runs */ + token: string; + /** @description branch of the runs */ + branch: string; + /** @description commit of the runs */ + commit: string; + /** @description userEmail of the runs */ + userEmail: string; + /** @description isCi of the runs */ + isCi: string; + /** @description provider of the runs */ + provider: string; + /** @description playwrightBrowser of the runs */ + playwrightBrowser: string; + /** @description cypressBrowser of the runs */ + cypressBrowser: string; + /** @description startDate of the runs */ + startDate: string; + /** @description end of the runs */ + endDate: string; + /** @description name of the tests */ + name: string; + }; + }; + operations: {}; + }; + "playwrightengine.yaml": { + paths: {}; + components: { + schemas: { + PlaywrightEngineRequest: { + target?: string; + method?: string; + script?: string; + }; + PlaywrightEngineResponse: { + success?: boolean; + }; }; }; operations: {}; @@ -1808,6 +2785,30 @@ export interface external { }; operations: {}; }; + "runGroups.yaml": { + paths: {}; + components: { + schemas: { + RunGroupList: { + items?: external["runGroups.yaml"]["components"]["schemas"]["RunGroup"][]; + }; + RunGroup: { + id: string; + /** Format: date-time */ + createdAt?: string; + /** @enum {string} */ + status?: "created" | "inProgress" | "succeed" | "failed"; + summary?: { + pending?: number; + succeed?: number; + failed?: number; + }; + metadata?: { [key: string]: string }; + }; + }; + }; + operations: {}; + }; "testEvents.yaml": { paths: {}; components: { @@ -1906,6 +2907,8 @@ export interface external { trigger?: external["triggers.yaml"]["components"]["schemas"]["Trigger"]; /** @description If true, the test will not collect a trace */ skipTraceCollection?: boolean; + /** @description Id of the polling profile that will be used by all the runs of this test */ + pollingProfile?: string; /** @description specification of assertions that are going to be made */ specs?: external["tests.yaml"]["components"]["schemas"]["TestSpec"][]; /** @@ -1948,6 +2951,7 @@ export interface external { spanId?: string; /** @description Test version used when running this test run */ testVersion?: number; + runGroupId?: string; /** * @description Current execution state * @enum {string} @@ -1963,6 +2967,7 @@ export interface external { | "STOPPED" | "TRIGGER_FAILED" | "TRACE_FAILED" + | "FAILED" | "ASSERTION_FAILED"; /** @description Details of the cause for the last `FAILED` state */ lastErrorState?: string; @@ -2000,6 +3005,7 @@ export interface external { RunInformation: { metadata?: { [key: string]: string } | null; variableSetId?: string; + runGroupId?: string; variables?: external["variableSets.yaml"]["components"]["schemas"]["VariableSetValue"][]; requiredGates?: | external["testRunner.yaml"]["components"]["schemas"]["SupportedGates"][] @@ -2095,6 +3101,7 @@ export interface external { TestSuiteRun: { id?: number; version?: number; + runGroupId?: string; /** Format: date-time */ createdAt?: string; /** Format: date-time */ @@ -2112,6 +3119,86 @@ export interface external { }; operations: {}; }; + "tokens.yaml": { + paths: {}; + components: { + schemas: { + TokenResource: { + /** @enum {string} */ + type?: "Token"; + spec?: external["tokens.yaml"]["components"]["schemas"]["Token"]; + }; + TokenResources: { + items?: external["tokens.yaml"]["components"]["schemas"]["Token"][]; + count?: number; + }; + Tokens: { + items?: external["tokens.yaml"]["components"]["schemas"]["Token"][]; + count?: number; + }; + Token: { + id: string; + /** + * @description token name + * @example my-token + */ + name: string; + isRevoked?: boolean; + role: external["members.yaml"]["components"]["schemas"]["Role"]; + userID?: string; + /** + * @description token duration in minutes + * @example 3600 + */ + duration?: number; + /** Format: date-time */ + issuedAt?: string; + /** Format: date-time */ + expiresAt?: string; + /** Format: date-time */ + updatedAt?: string; + }; + JWT: { + jwt: string; + }; + }; + responses: { + /** successful operation for tokens */ + Tokens: { + content: { + "application/json": external["tokens.yaml"]["components"]["schemas"]["Tokens"]; + }; + }; + /** successful operation for token */ + Token: { + content: { + "application/json": external["tokens.yaml"]["components"]["schemas"]["Token"]; + }; + }; + /** successful operation for jwt */ + JWT: { + content: { + "application/json": external["tokens.yaml"]["components"]["schemas"]["JWT"]; + }; + }; + }; + requestBodies: { + /** invite details body */ + Token: { + content: { + "application/json": external["tokens.yaml"]["components"]["schemas"]["Token"]; + }; + }; + /** invite resource details body */ + TokenResource: { + content: { + "application/json": external["tokens.yaml"]["components"]["schemas"]["TokenResource"]; + }; + }; + }; + }; + operations: {}; + }; "trace.yaml": { paths: {}; components: { @@ -2180,11 +3267,15 @@ export interface external { | "traceid" | "kafka" | "cypress" - | "playwright"; + | "playwright" + | "artillery" + | "k6" + | "playwrightengine"; httpRequest?: external["http.yaml"]["components"]["schemas"]["HTTPRequest"]; grpc?: external["grpc.yaml"]["components"]["schemas"]["GRPCRequest"]; traceid?: external["traceid.yaml"]["components"]["schemas"]["TRACEIDRequest"]; kafka?: external["kafka.yaml"]["components"]["schemas"]["KafkaRequest"]; + playwrightEngine?: external["playwrightengine.yaml"]["components"]["schemas"]["PlaywrightEngineRequest"]; }; TriggerResult: { /** @enum {string} */ @@ -2194,12 +3285,15 @@ export interface external { | "traceid" | "kafka" | "cypress" - | "playwright"; + | "playwright" + | "artillery" + | "k6"; triggerResult?: { http?: external["http.yaml"]["components"]["schemas"]["HTTPResponse"]; grpc?: external["grpc.yaml"]["components"]["schemas"]["GRPCResponse"]; traceid?: external["traceid.yaml"]["components"]["schemas"]["TRACEIDResponse"]; kafka?: external["kafka.yaml"]["components"]["schemas"]["KafkaResponse"]; + playwrightEngine?: external["playwrightengine.yaml"]["components"]["schemas"]["PlaywrightEngineResponse"]; error?: external["triggers.yaml"]["components"]["schemas"]["TriggerError"]; }; }; @@ -2213,6 +3307,32 @@ export interface external { }; operations: {}; }; + "users.yaml": { + paths: {}; + components: { + schemas: { + AfterLogin: { + userId?: string; + email?: string; + name?: string; + }; + User: { + id: string; + name: string; + emails: string[]; + }; + }; + requestBodies: { + /** After login request */ + AfterLogin: { + content: { + "application/json": external["users.yaml"]["components"]["schemas"]["AfterLogin"]; + }; + }; + }; + }; + operations: {}; + }; "variables.yaml": { paths: {}; components: { @@ -2258,6 +3378,11 @@ export interface external { VariableSetValue: { key?: string; value?: string; + /** + * @default raw + * @enum {string} + */ + type?: "raw" | "secret"; }; }; };