diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 08119835..784abc15 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -30,17 +30,10 @@ jobs: - name: Build the binary run: just build - - name: Setup tests - run: just test-setup - env: - CODE_PATH: /home/runner/code - - name: Run tests run: just test - env: - CODE_PATH: /home/runner/code - name: Report test coverage to DeepSource run: | - curl https://deepsource.io/cli | sh + curl -fsSL https://cli.deepsource.com/install | BINDIR=./bin sh ./bin/deepsource report --analyzer test-coverage --key go --value-file ./coverage.out --use-oidc diff --git a/VERSION b/VERSION index e63421e7..3d22ace4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.37 +2.0.40 diff --git a/buildinfo/version.go b/buildinfo/version.go index 696b9add..9618ef22 100644 --- a/buildinfo/version.go +++ b/buildinfo/version.go @@ -9,10 +9,8 @@ var buildInfo *BuildInfo // App identity variables. Defaults are prod values; overridden in main.go for dev builds. var ( - AppName = "deepsource" // binary name / display name - ConfigDirName = ".deepsource" // ~// - KeychainSvc = "deepsource-cli" // macOS keychain service - KeychainKey = "deepsource-cli-token" // macOS keychain account + AppName = "deepsource" // binary name / display name + ConfigDirName = ".deepsource" // ~// ) // BuildInfo describes the compile time information. @@ -25,7 +23,6 @@ type BuildInfo struct { BuildMode string `json:"build_mode,omitempty"` } -// SetBuildInfo sets the build info as a package global. func SetBuildInfo(version, dateStr, buildMode string) { date, _ := time.Parse("2006-01-02T15:04:05Z", dateStr) @@ -36,7 +33,6 @@ func SetBuildInfo(version, dateStr, buildMode string) { } } -// GetBuildInfo returns the package global `buildInfo` func GetBuildInfo() *BuildInfo { return buildInfo } diff --git a/cmd/deepsource/main.go b/cmd/deepsource/main.go index dbdf617f..71fd81b4 100644 --- a/cmd/deepsource/main.go +++ b/cmd/deepsource/main.go @@ -16,16 +16,9 @@ import ( ) var ( - // Version is the build version. This is set using ldflags -X - version = "development" - - // Date is the build date. This is set using ldflags -X - Date = "YYYY-MM-DD" // YYYY-MM-DD - - // DSN used for sentry + version = "development" + Date = "YYYY-MM-DD" SentryDSN string - - // buildMode is "dev" or "prod" (default). Set via ldflags -X. buildMode string ) @@ -47,8 +40,6 @@ func mainRun() (exitCode int) { if buildMode == "dev" { v.AppName = "deepsource-dev" v.ConfigDirName = ".deepsource-dev" - v.KeychainSvc = "deepsource-dev-cli" - v.KeychainKey = "deepsource-dev-cli-token" } // Init sentry diff --git a/command/auth/auth.go b/command/auth/auth.go index 3299dc64..d5a64d85 100644 --- a/command/auth/auth.go +++ b/command/auth/auth.go @@ -8,10 +8,8 @@ import ( "github.com/deepsourcelabs/cli/command/auth/status" ) -// Options holds the metadata. type Options struct{} -// NewCmdAuth handles the auth command which has various sub-commands like `login`, `logout` and `status` func NewCmdAuth() *cobra.Command { cmd := &cobra.Command{ Use: "auth", diff --git a/command/auth/login/login.go b/command/auth/login/login.go index 6a6349e0..22ece504 100644 --- a/command/auth/login/login.go +++ b/command/auth/login/login.go @@ -17,7 +17,6 @@ import ( var accountTypes = []string{"DeepSource (deepsource.com)", "Enterprise Server"} -// LoginOptions hold the metadata related to login operation type LoginOptions struct { AuthTimedOut bool TokenExpired bool @@ -28,12 +27,10 @@ type LoginOptions struct { deps *cmddeps.Deps } -// NewCmdLogin handles the login functionality for the CLI func NewCmdLogin() *cobra.Command { return NewCmdLoginWithDeps(nil) } -// NewCmdLoginWithDeps creates the login command with injectable dependencies. func NewCmdLoginWithDeps(deps *cmddeps.Deps) *cobra.Command { doc := heredoc.Docf(` Log in to DeepSource using the CLI. @@ -66,7 +63,6 @@ func NewCmdLoginWithDeps(deps *cmddeps.Deps) *cobra.Command { }, } - // --host flag (--hostname kept as deprecated alias) cmd.Flags().StringVar(&opts.HostName, "host", "", "Authenticate with a specific DeepSource instance") cmd.Flags().StringVar(&opts.HostName, "hostname", "", "Authenticate with a specific DeepSource instance") _ = cmd.Flags().MarkDeprecated("hostname", "use --host instead") @@ -76,7 +72,6 @@ func NewCmdLoginWithDeps(deps *cmddeps.Deps) *cobra.Command { return cmd } -// Run executes the auth command and starts the login flow if not already authenticated func (opts *LoginOptions) Run() (err error) { var cfgMgr *config.Manager if opts.deps != nil && opts.deps.ConfigMgr != nil { @@ -92,18 +87,15 @@ func (opts *LoginOptions) Run() (err error) { } else { svc = authsvc.NewService(cfgMgr) } - // Fetch config (errors are non-fatal: a zero config just means "not logged in") cfg, err := svc.LoadConfig() if err != nil { - cfg = &config.CLIConfig{} + cfg = config.NewDefault() } opts.User = cfg.User opts.TokenExpired = cfg.IsExpired() - // If local says valid, verify against the server - opts.verifyTokenWithServer(cfg, cfgMgr) + opts.verifyTokenWithServer(cfg, svc) - // Login using the interactive mode if opts.Interactive { err = opts.handleInteractiveLogin() if err != nil { @@ -111,73 +103,62 @@ func (opts *LoginOptions) Run() (err error) { } } - // Checking if the user passed a hostname. If yes, storing it in the config - // Else using the default hostname (deepsource.com) if opts.HostName != "" { cfg.Host = opts.HostName } else { cfg.Host = config.DefaultHostName } - // If PAT is passed, start the login flow through PAT (skip interactive prompts) if opts.PAT != "" { return opts.startPATLoginFlow(svc, cfg, opts.PAT) } - // Before starting the login workflow, check here for two conditions: - // Condition 1 : If the token has expired, display a message about it and re-authenticate user - // Condition 2 : If the token has not expired,does the user want to re-authenticate? - - // Checking for condition 1 if !opts.TokenExpired { - // The user is already logged in, confirm re-authentication. - msg := fmt.Sprintf("You're already logged into DeepSource as %s. Do you want to re-authenticate?", opts.User) + var msg string + if opts.User != "" { + msg = fmt.Sprintf("You're already logged into DeepSource as %s. Do you want to re-authenticate?", opts.User) + } else { + msg = "You're already logged into DeepSource. Do you want to re-authenticate?" + } response, err := prompt.ConfirmFromUser(msg, "") if err != nil { return fmt.Errorf("Error in fetching response. Please try again.") } - // If the response is No, it implies that the user doesn't want to re-authenticate - // In this case, just exit if !response { return nil } } - // Condition 2 - // `startLoginFlow` implements the authentication flow for the CLI return opts.startLoginFlow(svc, cfg) } -func (opts *LoginOptions) verifyTokenWithServer(cfg *config.CLIConfig, cfgMgr *config.Manager) { - if opts.TokenExpired || cfg.Token == "" || cfg.Host == "" { +func (opts *LoginOptions) verifyTokenWithServer(cfg *config.CLIConfig, svc *authsvc.Service) { + if opts.TokenExpired || cfg.Token == "" { return } - client, err := deepsource.New(deepsource.ClientOpts{ - Token: cfg.Token, - HostName: cfg.Host, - OnTokenRefreshed: cfgMgr.TokenRefreshCallback(), - }) + viewer, err := svc.GetViewer(context.Background(), cfg) if err != nil { + opts.TokenExpired = true return } - if _, err := client.GetViewer(context.Background()); err != nil { - opts.TokenExpired = true + // Backfill user from the server when config file was missing or incomplete. + if cfg.User == "" && viewer.Email != "" { + cfg.User = viewer.Email + opts.User = viewer.Email + _ = svc.SaveConfig(cfg) } } func (opts *LoginOptions) handleInteractiveLogin() error { - // Prompt messages and help texts loginPromptMessage := "Which account do you want to login into?" loginPromptHelpText := "Select the type of account you want to authenticate" hostPromptMessage := "Please enter the hostname:" hostPromptHelpText := "The hostname of the DeepSource instance to authenticate with" - // Display prompt to user loginType, err := prompt.SelectFromOptions(loginPromptMessage, loginPromptHelpText, accountTypes) if err != nil { return err } - // Prompt the user for hostname only in the case of on-premise if loginType == "Enterprise Server" { opts.HostName, err = prompt.GetSingleLineInput(hostPromptMessage, hostPromptHelpText) if err != nil { diff --git a/command/auth/login/login_flow.go b/command/auth/login/login_flow.go index 62d94704..903f90f4 100644 --- a/command/auth/login/login_flow.go +++ b/command/auth/login/login_flow.go @@ -15,16 +15,13 @@ import ( "github.com/fatih/color" ) -// Starts the login flow for the CLI func (opts *LoginOptions) startLoginFlow(svc *authsvc.Service, cfg *config.CLIConfig) error { - // Register the device and get a device code through the response ctx := context.Background() deviceRegistrationResponse, err := registerDevice(ctx, svc, cfg) if err != nil { return err } - // Open the browser for authentication err = browser.OpenURL(deviceRegistrationResponse.VerificationURIComplete) if err != nil { c := color.New(color.FgCyan, color.Bold) @@ -38,7 +35,6 @@ func (opts *LoginOptions) startLoginFlow(svc *authsvc.Service, cfg *config.CLICo fmt.Println() fmt.Println("Waiting for authentication") - // Fetch the PAT by polling the server var tokenData *auth.PAT tokenData, opts.AuthTimedOut, err = fetchPAT(ctx, deviceRegistrationResponse, svc, cfg) if err != nil { @@ -49,7 +45,6 @@ func (opts *LoginOptions) startLoginFlow(svc *authsvc.Service, cfg *config.CLICo return clierrors.ErrAuthTimeout() } - // Store auth data in config cfg.User = tokenData.User.Email cfg.Token = tokenData.Token cfg.SetTokenExpiry(tokenData.Expiry) @@ -76,9 +71,6 @@ func fetchPAT(ctx context.Context, deviceRegistrationData *auth.Device, svc *aut userName := "" authTimedOut := true - /* ======================================================================= */ - // The username and hostname to add in the description for the PAT request - /* ======================================================================= */ userData, err := user.Current() if err != nil { userName = defaultUserName @@ -92,11 +84,9 @@ func fetchPAT(ctx context.Context, deviceRegistrationData *auth.Device, svc *aut } userDescription := fmt.Sprintf("CLI PAT for %s@%s", userName, hostName) - // Keep polling the mutation at a certain interval till the expiry timeperiod ticker := time.NewTicker(time.Duration(deviceRegistrationData.Interval) * time.Second) pollStartTime := time.Now() - // Polling for fetching PAT func() { for range ticker.C { tokenData, err = svc.RequestPAT(ctx, cfg, deviceRegistrationData.Code, userDescription) diff --git a/command/auth/login/pat_login_flow.go b/command/auth/login/pat_login_flow.go index cc91b1c5..11e29469 100644 --- a/command/auth/login/pat_login_flow.go +++ b/command/auth/login/pat_login_flow.go @@ -9,19 +9,15 @@ import ( "github.com/fatih/color" ) -// Starts the login flow for the CLI (using PAT) func (opts *LoginOptions) startPATLoginFlow(svc *authsvc.Service, cfg *config.CLIConfig, token string) error { - // set personal access token (PAT) cfg.Token = token - // Verify the token against the server before saving viewer, err := svc.GetViewer(context.Background(), cfg) if err != nil { return fmt.Errorf("Invalid token: could not authenticate with DeepSource") } cfg.User = viewer.Email - // Having stored the data in the global Cfg object, write it into the config file present in the local filesystem err = svc.SaveConfig(cfg) if err != nil { return fmt.Errorf("Error in writing authentication data to a file. Exiting..") diff --git a/command/auth/login/tests/login_test.go b/command/auth/login/tests/login_test.go index 33c7f06c..74ceeb26 100644 --- a/command/auth/login/tests/login_test.go +++ b/command/auth/login/tests/login_test.go @@ -4,13 +4,19 @@ import ( "context" "encoding/json" "fmt" + "os" + "path/filepath" "testing" loginCmd "github.com/deepsourcelabs/cli/command/auth/login" "github.com/deepsourcelabs/cli/command/cmddeps" + "github.com/deepsourcelabs/cli/config" "github.com/deepsourcelabs/cli/deepsource" "github.com/deepsourcelabs/cli/deepsource/graphqlclient" + "github.com/deepsourcelabs/cli/internal/adapters" "github.com/deepsourcelabs/cli/internal/testutil" + + "github.com/deepsourcelabs/cli/buildinfo" ) func newMockViewerClient(t *testing.T) *deepsource.Client { @@ -135,6 +141,110 @@ func TestLoginDefaultHostname(t *testing.T) { } } +func TestLoginConfigLoadError(t *testing.T) { + // When LoadConfig fails, login should use NewDefault() and proceed with PAT flow + tmpDir := t.TempDir() + fs := adapters.NewOSFileSystem() + cfgMgr := config.NewManager(fs, func() (string, error) { + return tmpDir, nil + }) + // Don't write any config — but the directory exists, so Load succeeds. + // To simulate a real failure we need a corrupt file. + configDir := filepath.Join(tmpDir, buildinfo.ConfigDirName) + if err := os.MkdirAll(configDir, 0o700); err != nil { + t.Fatalf("failed to create config dir: %v", err) + } + if err := os.WriteFile(filepath.Join(configDir, config.ConfigFileName), []byte("invalid[toml"), 0o644); err != nil { + t.Fatalf("failed to write corrupt config: %v", err) + } + + deps := &cmddeps.Deps{ + ConfigMgr: cfgMgr, + Client: newMockViewerClient(t), + } + + cmd := loginCmd.NewCmdLoginWithDeps(deps) + cmd.SetArgs([]string{"--with-token", "dsp_fallback"}) + + if err := cmd.Execute(); err != nil { + t.Fatalf("expected PAT flow to succeed despite config load error: %v", err) + } + + // Token should have been saved + cfg, err := cfgMgr.Load() + if err != nil { + t.Fatalf("failed to load config: %v", err) + } + if cfg.Token != "dsp_fallback" { + t.Errorf("expected token %q, got %q", "dsp_fallback", cfg.Token) + } +} + +func TestLoginVerifyTokenBackfillsUser(t *testing.T) { + // Valid token + empty user → verifyTokenWithServer backfills email from server + cfgMgr := testutil.CreateTestConfigManager(t, "valid-token", "deepsource.com", "") + + deps := &cmddeps.Deps{ + ConfigMgr: cfgMgr, + Client: newMockViewerClient(t), + } + + cmd := loginCmd.NewCmdLoginWithDeps(deps) + cmd.SetArgs([]string{"--with-token", "dsp_new"}) + + if err := cmd.Execute(); err != nil { + t.Fatalf("unexpected error: %v", err) + } + + cfg, err := cfgMgr.Load() + if err != nil { + t.Fatalf("failed to load config: %v", err) + } + // User should have been backfilled by verifyTokenWithServer + if cfg.User != "test@example.com" { + t.Errorf("expected user %q, got %q", "test@example.com", cfg.User) + } +} + +func TestLoginVerifyTokenServerReject(t *testing.T) { + // Server rejects token → marks expired, PAT flow re-authenticates + cfgMgr := testutil.CreateTestConfigManager(t, "old-token", "deepsource.com", "old@example.com") + + rejectMock := graphqlclient.NewMockClient() + callCount := 0 + rejectMock.QueryFunc = func(_ context.Context, _ string, _ map[string]any, result any) error { + callCount++ + if callCount == 1 { + // First call: verifyTokenWithServer — reject the token + return fmt.Errorf("unauthorized") + } + // Subsequent calls: PAT verification — succeed + resp := `{"viewer":{"id":"1","firstName":"Test","lastName":"User","email":"new@example.com","accounts":{"edges":[]}}}` + return json.Unmarshal([]byte(resp), result) + } + client := deepsource.NewWithGraphQLClient(rejectMock) + + deps := &cmddeps.Deps{ + ConfigMgr: cfgMgr, + Client: client, + } + + cmd := loginCmd.NewCmdLoginWithDeps(deps) + cmd.SetArgs([]string{"--with-token", "dsp_renewed"}) + + if err := cmd.Execute(); err != nil { + t.Fatalf("unexpected error: %v", err) + } + + cfg, err := cfgMgr.Load() + if err != nil { + t.Fatalf("failed to load config: %v", err) + } + if cfg.Token != "dsp_renewed" { + t.Errorf("expected renewed token %q, got %q", "dsp_renewed", cfg.Token) + } +} + func TestLoginPATInvalidToken(t *testing.T) { cfgMgr := testutil.CreateExpiredTestConfigManager(t, "", "deepsource.com", "") diff --git a/command/auth/logout/logout.go b/command/auth/logout/logout.go index 3727442c..867fac55 100644 --- a/command/auth/logout/logout.go +++ b/command/auth/logout/logout.go @@ -26,17 +26,14 @@ func (opts *LogoutOptions) stdout() io.Writer { return os.Stdout } -// NewLogoutOptionsForTest creates a LogoutOptions for use in tests. func NewLogoutOptionsForTest(deps *cmddeps.Deps, confirmFunc func(string, string) (bool, error)) *LogoutOptions { return &LogoutOptions{deps: deps, ConfirmFunc: confirmFunc} } -// NewCmdLogout handles the logout functionality for the CLI func NewCmdLogout() *cobra.Command { return NewCmdLogoutWithDeps(nil) } -// NewCmdLogoutWithDeps creates the logout command with injectable dependencies. func NewCmdLogoutWithDeps(deps *cmddeps.Deps) *cobra.Command { cmd := &cobra.Command{ Use: "logout", @@ -58,17 +55,14 @@ func (opts *LogoutOptions) Run() error { cfgMgr = config.DefaultManager() } svc := authsvc.NewService(cfgMgr) - // Fetch config cfg, err := svc.LoadConfig() if err != nil { return clierrors.NewCLIError(clierrors.ErrInvalidConfig, "Error reading DeepSource CLI config", err) } - // Checking if the user has authenticated / logged in or not if cfg.Token == "" { return clierrors.ErrNotLoggedIn() } - // Confirm from the user if they want to logout logoutConfirmationMsg := "Are you sure you want to log out of DeepSource account?" confirmFn := opts.ConfirmFunc if confirmFn == nil { @@ -79,7 +73,6 @@ func (opts *LogoutOptions) Run() error { return err } - // If response is true, delete the config file => logged out the user if response { if err := svc.DeleteConfig(); err != nil { return err diff --git a/command/auth/status/status.go b/command/auth/status/status.go index 60934f89..2710dfe7 100644 --- a/command/auth/status/status.go +++ b/command/auth/status/status.go @@ -11,6 +11,7 @@ import ( "github.com/deepsourcelabs/cli/command/cmddeps" "github.com/deepsourcelabs/cli/config" "github.com/deepsourcelabs/cli/deepsource" + dsuser "github.com/deepsourcelabs/cli/deepsource/user" "github.com/deepsourcelabs/cli/internal/cli/args" "github.com/deepsourcelabs/cli/internal/cli/style" clierrors "github.com/deepsourcelabs/cli/internal/errors" @@ -28,7 +29,6 @@ func (opts *AuthStatusOptions) stdout() io.Writer { return os.Stdout } -// NewCmdStatus handles the fetching of authentication status of CLI func NewCmdStatus() *cobra.Command { return NewCmdStatusWithDeps(nil) } @@ -54,61 +54,73 @@ func NewCmdStatusWithDeps(deps *cmddeps.Deps) *cobra.Command { } func (opts *AuthStatusOptions) Run() error { - var cfgMgr *config.Manager - if opts.deps != nil && opts.deps.ConfigMgr != nil { - cfgMgr = opts.deps.ConfigMgr - } else { - cfgMgr = config.DefaultManager() - } - // Fetch config + cfgMgr := opts.configManager() cfg, err := cfgMgr.Load() if err != nil { return clierrors.NewCLIError(clierrors.ErrInvalidConfig, "Error reading DeepSource CLI config", err) } - // Checking if the user has authenticated / logged in or not if cfg.Token == "" { return clierrors.ErrNotLoggedIn() } - // Fast path: if the local token expiry has passed, no need for a network call. - // Skip for env var tokens since they have no local expiry info. if !cfg.TokenFromEnv && cfg.IsExpired() { style.Warnf(opts.stdout(), "Authentication expired. Run %q to re-authenticate", "deepsource auth login") return nil } - // Validate token against the server - var client *deepsource.Client - if opts.deps != nil && opts.deps.Client != nil { - client = opts.deps.Client - } else { - client, err = deepsource.New(deepsource.ClientOpts{ - Token: cfg.Token, - HostName: cfg.Host, - OnTokenRefreshed: cfgMgr.TokenRefreshCallback(), - }) - if err != nil { - fmt.Fprintf(opts.stdout(), "Logged in to DeepSource as %s (could not verify with server).\n", cfg.User) - return nil - } + client, err := opts.apiClient(cfg, cfgMgr) + if err != nil { + style.Warnf(opts.stdout(), "Could not connect to DeepSource to verify authentication") + return nil } - _, verifyErr := client.GetViewer(context.Background()) - if verifyErr != nil { - var ce *clierrors.CLIError - if stderrors.As(verifyErr, &ce) && ce.Code.IsAuthError() { - style.Warnf(opts.stdout(), "Authentication expired. Run %q to re-authenticate", "deepsource auth login") - return nil - } - // Network error or other non-auth failure — report as logged in but unverified - fmt.Fprintf(opts.stdout(), "Logged in to DeepSource as %s (could not verify with server).\n", cfg.User) + viewer, err := opts.verifyWithServer(client) + if err != nil { return nil } - msg := fmt.Sprintf("Logged in to DeepSource as %s", cfg.User) + displayUser := viewer.Email + if displayUser == "" { + displayUser = cfg.User + } + cfgMgr.BackfillUser(cfg, viewer.Email) + + msg := fmt.Sprintf("Logged in to DeepSource as %s", displayUser) if cfg.TokenFromEnv { msg += " (via DEEPSOURCE_TOKEN)" } fmt.Fprintln(opts.stdout(), msg+".") return nil } + +func (opts *AuthStatusOptions) configManager() *config.Manager { + if opts.deps != nil && opts.deps.ConfigMgr != nil { + return opts.deps.ConfigMgr + } + return config.DefaultManager() +} + +func (opts *AuthStatusOptions) apiClient(cfg *config.CLIConfig, cfgMgr *config.Manager) (*deepsource.Client, error) { + if opts.deps != nil && opts.deps.Client != nil { + return opts.deps.Client, nil + } + return deepsource.New(deepsource.ClientOpts{ + Token: cfg.Token, + HostName: cfg.Host, + OnTokenRefreshed: cfgMgr.TokenRefreshCallback(), + }) +} + +func (opts *AuthStatusOptions) verifyWithServer(client *deepsource.Client) (*dsuser.User, error) { + viewer, err := client.GetViewer(context.Background()) + if err != nil { + var ce *clierrors.CLIError + if stderrors.As(err, &ce) && ce.Code.IsAuthError() { + style.Warnf(opts.stdout(), "Authentication expired. Run %q to re-authenticate", "deepsource auth login") + } else { + style.Warnf(opts.stdout(), "Could not connect to DeepSource to verify authentication") + } + return nil, err + } + return viewer, nil +} diff --git a/command/auth/status/tests/auth_status_test.go b/command/auth/status/tests/auth_status_test.go index 0f795c97..b2554156 100644 --- a/command/auth/status/tests/auth_status_test.go +++ b/command/auth/status/tests/auth_status_test.go @@ -16,7 +16,6 @@ import ( "github.com/deepsourcelabs/cli/deepsource/graphqlclient" "github.com/deepsourcelabs/cli/internal/adapters" clierrors "github.com/deepsourcelabs/cli/internal/errors" - "github.com/deepsourcelabs/cli/internal/secrets" "github.com/deepsourcelabs/cli/internal/testutil" ) @@ -29,9 +28,9 @@ func createConfigManager(t *testing.T, token, host, user string, expiry time.Tim t.Helper() tmpDir := t.TempDir() fs := adapters.NewOSFileSystem() - mgr := config.NewManagerWithSecrets(fs, func() (string, error) { + mgr := config.NewManager(fs, func() (string, error) { return tmpDir, nil - }, secrets.NoopStore{}, "") + }) cfg := &config.CLIConfig{ Token: token, @@ -115,9 +114,9 @@ func TestAuthStatusEnvVarToken(t *testing.T) { // No config file — token comes purely from env var tmpDir := t.TempDir() fs := adapters.NewOSFileSystem() - cfgMgr := config.NewManagerWithSecrets(fs, func() (string, error) { + cfgMgr := config.NewManager(fs, func() (string, error) { return tmpDir, nil - }, secrets.NoopStore{}, "") + }) t.Setenv("DEEPSOURCE_TOKEN", "env-test-token") @@ -144,6 +143,126 @@ func TestAuthStatusEnvVarToken(t *testing.T) { } } +func TestAuthStatusDefaultHostBackfill(t *testing.T) { + // Config with no host — Load() should default to deepsource.com and succeed + tmpDir := t.TempDir() + fs := adapters.NewOSFileSystem() + cfgMgr := config.NewManager(fs, func() (string, error) { + return tmpDir, nil + }) + // Write config without host + cfg := &config.CLIConfig{Token: "test-token", User: "user@example.com"} + cfg.TokenExpiresIn = time.Now().Add(24 * time.Hour) + if err := cfgMgr.Write(cfg); err != nil { + t.Fatalf("failed to write test config: %v", err) + } + + mock := testutil.MockQueryFunc(t, map[string]string{ + "viewer": goldenPath("viewer_response.json"), + }) + client := deepsource.NewWithGraphQLClient(mock) + + var buf strings.Builder + deps := &cmddeps.Deps{ + ConfigMgr: cfgMgr, + Client: client, + Stdout: &buf, + } + + cmd := statusCmd.NewCmdStatusWithDeps(deps) + if err := cmd.Execute(); err != nil { + t.Fatalf("unexpected error: %v", err) + } + + if !strings.Contains(buf.String(), "Logged in to DeepSource as") { + t.Errorf("expected logged-in message, got: %q", buf.String()) + } +} + +func TestAuthStatusViewerEmailBackfill(t *testing.T) { + // Config with no user — BackfillUser should persist the viewer's email + cfgMgr := createConfigManager(t, "test-token", "deepsource.com", "", time.Now().Add(24*time.Hour)) + + mock := testutil.MockQueryFunc(t, map[string]string{ + "viewer": goldenPath("viewer_response.json"), + }) + client := deepsource.NewWithGraphQLClient(mock) + + var buf strings.Builder + deps := &cmddeps.Deps{ + ConfigMgr: cfgMgr, + Client: client, + Stdout: &buf, + } + + cmd := statusCmd.NewCmdStatusWithDeps(deps) + if err := cmd.Execute(); err != nil { + t.Fatalf("unexpected error: %v", err) + } + + // Verify user was backfilled to config + cfg, err := cfgMgr.Load() + if err != nil { + t.Fatalf("failed to load config: %v", err) + } + if cfg.User != "user@example.com" { + t.Errorf("expected user backfilled to %q, got %q", "user@example.com", cfg.User) + } +} + +func TestAuthStatusViewerEmptyEmailFallback(t *testing.T) { + // Viewer returns empty email → display should fall back to config user + cfgMgr := createConfigManager(t, "test-token", "deepsource.com", "config-user@example.com", time.Now().Add(24*time.Hour)) + + mock := testutil.MockQueryFunc(t, map[string]string{ + "viewer": goldenPath("viewer_no_email_response.json"), + }) + client := deepsource.NewWithGraphQLClient(mock) + + var buf strings.Builder + deps := &cmddeps.Deps{ + ConfigMgr: cfgMgr, + Client: client, + Stdout: &buf, + } + + cmd := statusCmd.NewCmdStatusWithDeps(deps) + if err := cmd.Execute(); err != nil { + t.Fatalf("unexpected error: %v", err) + } + + if !strings.Contains(buf.String(), "config-user@example.com") { + t.Errorf("expected fallback to config user, got: %q", buf.String()) + } +} + +func TestAuthStatusNetworkError(t *testing.T) { + cfgMgr := createConfigManager(t, "test-token", "deepsource.com", "user@example.com", time.Now().Add(24*time.Hour)) + + // Mock client that returns a non-auth error + mock := graphqlclient.NewMockClient() + mock.QueryFunc = func(_ context.Context, query string, _ map[string]any, _ any) error { + return fmt.Errorf("connection refused") + } + client := deepsource.NewWithGraphQLClient(mock) + + var buf strings.Builder + deps := &cmddeps.Deps{ + ConfigMgr: cfgMgr, + Client: client, + Stdout: &buf, + } + + cmd := statusCmd.NewCmdStatusWithDeps(deps) + if err := cmd.Execute(); err != nil { + t.Fatalf("unexpected error: %v", err) + } + + if !strings.Contains(buf.String(), "Could not connect") { + t.Errorf("expected network error warning, got: %q", buf.String()) + } +} + func TestAuthStatusServerRejected(t *testing.T) { cfgMgr := createConfigManager(t, "test-token", "deepsource.com", "user@example.com", time.Now().Add(24*time.Hour)) diff --git a/command/auth/status/tests/golden_files/viewer_no_email_response.json b/command/auth/status/tests/golden_files/viewer_no_email_response.json new file mode 100644 index 00000000..f6d1ba63 --- /dev/null +++ b/command/auth/status/tests/golden_files/viewer_no_email_response.json @@ -0,0 +1,20 @@ +{ + "viewer": { + "id": "VXNlcjoxMjM0", + "firstName": "Test", + "lastName": "User", + "email": "", + "accounts": { + "edges": [ + { + "node": { + "id": "QWNjb3VudDo1Njc4", + "login": "testorg", + "type": "TEAM", + "vcsProvider": "GITHUB" + } + } + ] + } + } +} diff --git a/command/issues/issues.go b/command/issues/issues.go index c3650c8d..e923cc59 100644 --- a/command/issues/issues.go +++ b/command/issues/issues.go @@ -95,31 +95,19 @@ func NewCmdIssuesWithDeps(deps *cmddeps.Deps) *cobra.Command { }, } - // --repo, -r flag cmd.Flags().StringVarP(&opts.RepoArg, "repo", "r", "", "Repository in provider/owner/name format (e.g. gh/owner/name). Supported providers: gh, gl, bb, ads") - - // --limit, -l flag cmd.Flags().IntVarP(&opts.LimitArg, "limit", "l", 0, "Maximum number of issues to display (0 = all)") - - // --output, -o flag cmd.Flags().StringVarP(&opts.OutputFormat, "output", "o", "pretty", "Output format: pretty, json") - - // --verbose, -v flag cmd.Flags().BoolVarP(&opts.Verbose, "verbose", "v", false, "Show issue description") - - // Scoping flags cmd.Flags().StringVar(&opts.CommitOid, "commit", "", "Scope to a specific analysis run by commit SHA") cmd.Flags().IntVar(&opts.PRNumber, "pr", 0, "Scope to a specific pull request by number") cmd.Flags().BoolVar(&opts.DefaultBranch, "default-branch", false, "Show issues from the default branch instead of current branch") - - // Filter flags cmd.Flags().StringSliceVar(&opts.AnalyzerFilters, "analyzer", nil, "Filter by analyzer shortcode (e.g. python,go)") cmd.Flags().StringSliceVar(&opts.CategoryFilters, "category", nil, "Filter by category (e.g. security,bug-risk)") cmd.Flags().StringSliceVar(&opts.SeverityFilters, "severity", nil, "Filter by severity (e.g. critical,major)") cmd.Flags().StringSliceVar(&opts.PathFilters, "path", nil, "Filter by path substring (e.g. cmd/,internal/)") cmd.Flags().StringSliceVar(&opts.SourceFilters, "source", nil, "Filter by source (static, ai)") - // Completions _ = cmd.RegisterFlagCompletionFunc("repo", func(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) { return completion.RepoCompletionCandidates(), cobra.ShellCompDirectiveNoFileComp }) @@ -145,7 +133,6 @@ func NewCmdIssuesWithDeps(deps *cmddeps.Deps) *cobra.Command { return []string{"critical", "major", "minor"}, cobra.ShellCompDirectiveNoFileComp }) - // Mutual exclusivity cmd.MarkFlagsMutuallyExclusive("commit", "pr", "default-branch") setIssuesUsageFunc(cmd) @@ -270,7 +257,6 @@ func (opts *IssuesOptions) Run(ctx context.Context) error { issuesList = opts.filterIssues(issuesList) - // Apply limit cap if set if opts.LimitArg > 0 && len(issuesList) > opts.LimitArg { issuesList = issuesList[:opts.LimitArg] } diff --git a/command/metrics/metrics.go b/command/metrics/metrics.go index 20323a6a..956f66de 100644 --- a/command/metrics/metrics.go +++ b/command/metrics/metrics.go @@ -90,24 +90,14 @@ func NewCmdMetricsWithDeps(deps *cmddeps.Deps) *cobra.Command { }, } - // --repo, -r flag cmd.Flags().StringVarP(&opts.RepoArg, "repo", "r", "", "Repository in provider/owner/name format (e.g. gh/owner/name). Supported providers: gh, gl, bb, ads") - - // --limit, -l flag cmd.Flags().IntVarP(&opts.LimitArg, "limit", "l", 0, "Maximum number of metrics to display (0 = all)") - - // --output, -o flag cmd.Flags().StringVarP(&opts.OutputFormat, "output", "o", "pretty", "Output format: pretty, json") - - // --verbose, -v flag cmd.Flags().BoolVarP(&opts.Verbose, "verbose", "v", false, "Show shortcodes and descriptions") - - // Scoping flags cmd.Flags().StringVar(&opts.CommitOid, "commit", "", "Scope to a specific analysis run by commit SHA") cmd.Flags().IntVar(&opts.PRNumber, "pr", 0, "Scope to a specific pull request by number") cmd.Flags().BoolVar(&opts.DefaultBranch, "default-branch", false, "Show metrics from the default branch instead of current branch") - // Completions _ = cmd.RegisterFlagCompletionFunc("repo", func(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) { return completion.RepoCompletionCandidates(), cobra.ShellCompDirectiveNoFileComp }) @@ -118,7 +108,6 @@ func NewCmdMetricsWithDeps(deps *cmddeps.Deps) *cobra.Command { }, cobra.ShellCompDirectiveNoFileComp }) - // Mutual exclusivity cmd.MarkFlagsMutuallyExclusive("commit", "pr", "default-branch") setMetricsUsageFunc(cmd) @@ -127,7 +116,6 @@ func NewCmdMetricsWithDeps(deps *cmddeps.Deps) *cobra.Command { } func (opts *MetricsOptions) Run(ctx context.Context) error { - // Load configuration var cfgMgr *config.Manager if opts.deps != nil && opts.deps.ConfigMgr != nil { cfgMgr = opts.deps.ConfigMgr @@ -142,14 +130,12 @@ func (opts *MetricsOptions) Run(ctx context.Context) error { return err } - // Resolve remote repository remote, err := vcs.ResolveRemote(opts.RepoArg) if err != nil { return err } opts.repoSlug = remote.Owner + "/" + remote.RepoName - // Create DeepSource client var client *deepsource.Client if opts.deps != nil && opts.deps.Client != nil { client = opts.deps.Client @@ -174,7 +160,6 @@ func (opts *MetricsOptions) Run(ctx context.Context) error { opts.applyLimit() - // Output based on format var outErr error switch opts.OutputFormat { case "json": diff --git a/command/report/git.go b/command/report/git.go deleted file mode 100644 index 165c3705..00000000 --- a/command/report/git.go +++ /dev/null @@ -1,127 +0,0 @@ -package report - -import ( - "bytes" - "os" - "os/exec" - "strings" -) - -// gitGetHead accepts a git directory and returns head commit OID / error -func gitGetHead(workspaceDir string) (headOID string, warning string, err error) { - // Check if DeepSource's Test coverage action triggered this first before executing any git commands. - headOID, err = getTestCoverageActionCommit() - if headOID != "" { - return - } - - // Check if the `GIT_COMMIT_SHA` environment variable exists. If yes, return this as - // the latest commit sha. - // This is used in cases when the user wants to report tcv from inside a docker container in which they are running tests. - // In this scenario, the container doesn't have data about the latest git commit sha so - // it is injected by the user manually while running the container. - // Example: - // GIT_COMMIT_SHA=$(git --no-pager rev-parse HEAD | tr -d '\n') - // docker run -e DEEPSOURCE_DSN -e GIT_COMMIT_SHA ... - if injectedSHA, isManuallyInjectedSHA := os.LookupEnv("GIT_COMMIT_SHA"); isManuallyInjectedSHA { - return injectedSHA, "", nil - } - - // get the top commit manually, using git command. We will be using this if there's no env variable set for extracting commit. - headOID, err = fetchHeadManually(workspaceDir) - if err != nil { - return - } - - // TRAVIS CI - if envUser := os.Getenv("USER"); envUser == "travis" { - headOID, warning, err = getTravisCommit(headOID) - return - } - - // GITHUB ACTIONS - if _, isGitHubEnv := os.LookupEnv("GITHUB_ACTIONS"); isGitHubEnv { - headOID, warning, err = getGitHubActionsCommit(headOID) - return - } - - // If we are here, it means there weren't any special cases. Return the manually found headOID. - return -} - -// Fetches the latest commit hash using the command `git rev-parse HEAD` -// through git -func fetchHeadManually(directoryPath string) (string, error) { - cmd := exec.Command("git", "--no-pager", "rev-parse", "HEAD") - cmd.Dir = directoryPath - - var stdout, stderr bytes.Buffer - cmd.Stdout = &stdout - cmd.Stderr = &stderr - - err := cmd.Run() - outStr, _ := stdout.String(), stderr.String() - if err != nil { - return "", err - } - - // Trim newline suffix from Commit OID - return strings.TrimSuffix(outStr, "\n"), nil -} - -// Handle special cases for GitHub Actions. -func getGitHubActionsCommit(topCommit string) (headOID string, warning string, err error) { - // When GITHUB_REF is not set, GITHUB_SHA points to original commit. - // When set, it points to the "latest *merge* commit in the branch". - // Early exit when GITHUB_SHA points to the original commit. - // Ref: https://help.github.com/en/actions/reference/events-that-trigger-workflows#pull-request-event-pull_request - if _, isRefPresent := os.LookupEnv("GITHUB_REF"); !isRefPresent { - headOID = os.Getenv("GITHUB_SHA") - return - } - - // Case: Detect Merge commit made by GitHub Actions, which pull_request events are nutorious to make. - // We are anyways going to return `headOID` fetched manually, but want to warn users about the merge commit. - - // When ref is not provided during the checkout step, headOID would be the same as GITHUB_SHA - // This confirms the merge commit. - // event names where GITHUB_SHA would be of a merge commit: - // "pull_request", - // "pull_request_review", - // "pull_request_review", - // "pull_request_review_comment", - eventName := os.Getenv("GITHUB_EVENT_NAME") - eventCommitSha := os.Getenv("GITHUB_SHA") - if strings.HasPrefix(eventName, "pull_request") && topCommit == eventCommitSha { - warning = "Warning: Looks like the checkout step is making a merge commit. " + - "Test coverage Analyzer would not run for the reported artifact because the merge commit doesn't exist upstream.\n" + - "Please refer to the docs for required changes. Ref: https://docs.deepsource.com/docs/analyzers-test-coverage#with-github-actions" - } - headOID = topCommit - return -} - -// Return PR's HEAD ref set as env variable manually by DeepSource's Test coverage action. -func getTestCoverageActionCommit() (headOID string, err error) { - // This is kept separate from `getGitHubActionsCommit` because we don't want to run any git command manually - // before this is checked. Since this is guaranteed to be set if artifact is sent using our GitHub action, - // we can reliably send the commit SHA, and no git commands are executed, making the actions work all the time. \o/ - - // We are setting PR's head commit as default using github context as env variable: "GHA_HEAD_COMMIT_SHA" - headOID = os.Getenv("GHA_HEAD_COMMIT_SHA") - - return -} - -// Handle special case for TravisCI -func getTravisCommit(topCommit string) (string, string, error) { - // Travis creates a merge commit for pull requests on forks. - // The head of commit is this merge commit, which does not match the commit of deepsource check. - // Fetch value of pull request SHA. If this is a PR, it will return SHA of HEAD commit of the PR, else "". - // If prSHA is not empty, that means we got an SHA, which is HEAD. Return this. - if prSHA := os.Getenv("TRAVIS_PULL_REQUEST_SHA"); len(prSHA) > 0 { - return prSHA, "", nil - } - - return topCommit, "", nil -} diff --git a/command/report/query.go b/command/report/query.go deleted file mode 100644 index 22c83325..00000000 --- a/command/report/query.go +++ /dev/null @@ -1,55 +0,0 @@ -package report - -import ( - "bytes" - "crypto/tls" - "fmt" - "io" - "net/http" - "strconv" - "time" -) - -// makeQuery makes a HTTP query with a specified body and returns the response -func makeQuery(url string, body []byte, bodyMimeType string, skipCertificateVerification bool) ([]byte, error) { - var resBody []byte - httpClient := &http.Client{ - Timeout: time.Second * 60, - } - - if skipCertificateVerification { - // Create a custom HTTP Transport for skipping verification of SSL certificates - // if `--skip-verify` flag is passed. - tr := &http.Transport{ - TLSClientConfig: &tls.Config{ - InsecureSkipVerify: true, - }, - } - httpClient.Transport = tr - } - - req, err := http.NewRequest("POST", url, bytes.NewBuffer(body)) - if err != nil { - return nil, err - } - req.Header.Set("Content-Type", bodyMimeType) - res, err := httpClient.Do(req) - if err != nil { - return resBody, err - } - defer res.Body.Close() - - resBody, err = io.ReadAll(res.Body) - if err != nil { - return resBody, err - } - - if res.StatusCode >= http.StatusInternalServerError || res.StatusCode != 200 { - if resBody != nil { - return resBody, fmt.Errorf("Server responded with %s: %s", strconv.Itoa(res.StatusCode), string(resBody)) - } - return resBody, fmt.Errorf("Server responded with %s", strconv.Itoa(res.StatusCode)) - } - - return resBody, nil -} diff --git a/command/report/report.go b/command/report/report.go index f56165f1..6881c719 100644 --- a/command/report/report.go +++ b/command/report/report.go @@ -94,7 +94,6 @@ func NewCmdReportWithDeps(deps *container.Container) *cobra.Command { }, } - // --analyzer flag cmd.Flags().StringVar(&opts.Analyzer, "analyzer", "", "name of the analyzer to report the artifact to (example: test-coverage)") cmd.Flags().StringVar(&opts.AnalyzerType, "analyzer-type", "", "type of the analyzer (example: community)") @@ -116,7 +115,6 @@ func NewCmdReportWithDeps(deps *container.Container) *cobra.Command { cmd.Flags().StringVar(&opts.OIDCProvider, "oidc-provider", "", "OIDC provider to use for authentication. Supported providers: github-actions") cmd.Flags().StringVar(&opts.Output, "output", "pretty", "Output format: pretty, json") - // --skip-verify flag to skip SSL certificate verification while reporting test coverage data. cmd.Flags().BoolVar(&opts.SkipCertificateVerification, "skip-verify", false, "skip SSL certificate verification while sending the test coverage data") _ = cmd.RegisterFlagCompletionFunc("analyzer", func(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) { diff --git a/command/report/tests/init_test.go b/command/report/tests/init_test.go index c725d0ca..9e82f6a6 100644 --- a/command/report/tests/init_test.go +++ b/command/report/tests/init_test.go @@ -66,14 +66,7 @@ func prepareArtifacts() error { return err } - defaultRoot := filepath.Clean(filepath.Join(wd, "..", "..", "..")) - rootDir := defaultRoot - if envRoot := os.Getenv("CODE_PATH"); envRoot != "" { - coverageCandidate := filepath.Join(envRoot, "command", "report", "tests", "golden_files", "python_coverage.xml") - if _, err := os.Stat(coverageCandidate); err == nil { - rootDir = envRoot - } - } + rootDir := filepath.Clean(filepath.Join(wd, "..", "..", "..")) repoRoot = rootDir tempDir, err := os.MkdirTemp("", "deepsource-report") diff --git a/command/report/tests/report_host_test.go b/command/report/tests/report_host_test.go index f5dd65f5..48c75913 100644 --- a/command/report/tests/report_host_test.go +++ b/command/report/tests/report_host_test.go @@ -7,16 +7,15 @@ import ( "github.com/deepsourcelabs/cli/config" "github.com/deepsourcelabs/cli/internal/adapters" "github.com/deepsourcelabs/cli/internal/container" - "github.com/deepsourcelabs/cli/internal/secrets" ) func TestReportHostFallsBackToConfig(t *testing.T) { // Create a config manager with an enterprise host tmpDir := t.TempDir() fs := adapters.NewOSFileSystem() - cfgMgr := config.NewManagerWithSecrets(fs, func() (string, error) { + cfgMgr := config.NewManager(fs, func() (string, error) { return tmpDir, nil - }, secrets.NoopStore{}, "") + }) cfg := &config.CLIConfig{ Host: "enterprise.example.com", @@ -66,9 +65,9 @@ func TestReportHostExplicitFlagOverridesConfig(t *testing.T) { // Config has enterprise host, but --host flag overrides it tmpDir := t.TempDir() fs := adapters.NewOSFileSystem() - cfgMgr := config.NewManagerWithSecrets(fs, func() (string, error) { + cfgMgr := config.NewManager(fs, func() (string, error) { return tmpDir, nil - }, secrets.NoopStore{}, "") + }) cfg := &config.CLIConfig{ Host: "enterprise.example.com", @@ -115,9 +114,9 @@ func TestReportHostDefaultWhenNoConfigNoFlag(t *testing.T) { // No config host, no --host flag: should use default tmpDir := t.TempDir() fs := adapters.NewOSFileSystem() - cfgMgr := config.NewManagerWithSecrets(fs, func() (string, error) { + cfgMgr := config.NewManager(fs, func() (string, error) { return tmpDir, nil - }, secrets.NoopStore{}, "") + }) // Write empty config (no host) cfg := &config.CLIConfig{} diff --git a/command/report/types.go b/command/report/types.go index ab69242c..bc55de43 100644 --- a/command/report/types.go +++ b/command/report/types.go @@ -1,7 +1,5 @@ package report -// ReportQueryInput is the schema for variables of artifacts -// report GraphQL query type ReportQueryInput struct { AccessToken string `json:"accessToken"` CommitOID string `json:"commitOid"` @@ -14,8 +12,6 @@ type ReportQueryInput struct { Metadata interface{} `json:"metadata,omitempty"` } -// ReportQueryInput is the structure of artifacts report -// GraphQL query type ReportQuery struct { Query string `json:"query"` Variables struct { @@ -23,8 +19,6 @@ type ReportQuery struct { } `json:"variables"` } -// QueryResponse is the response returned by artifacts report -// GraphQL query type QueryResponse struct { Data struct { CreateArtifact struct { diff --git a/command/root.go b/command/root.go index 6ac7bbd9..d8dee937 100644 --- a/command/root.go +++ b/command/root.go @@ -125,6 +125,14 @@ func buildExampleText() string { } func rootHelpFunc(cmd *cobra.Command, _ []string) { + if cmd.Parent() != nil { + root := cmd.Root() + root.SetHelpFunc(nil) + cmd.Help() + root.SetHelpFunc(rootHelpFunc) + return + } + out := cmd.OutOrStdout() // Long description (already colored) diff --git a/command/vulnerabilities/vulnerabilities.go b/command/vulnerabilities/vulnerabilities.go index ca7fb24c..026c9535 100644 --- a/command/vulnerabilities/vulnerabilities.go +++ b/command/vulnerabilities/vulnerabilities.go @@ -101,7 +101,6 @@ func NewCmdVulnerabilitiesWithDeps(deps *cmddeps.Deps) *cobra.Command { cmd.Flags().BoolVar(&opts.DefaultBranch, "default-branch", false, "Show vulnerabilities from the default branch instead of current branch") cmd.Flags().StringSliceVar(&opts.SeverityFilters, "severity", nil, "Filter by severity (e.g. critical,high)") - // Completions _ = cmd.RegisterFlagCompletionFunc("repo", func(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) { return completion.RepoCompletionCandidates(), cobra.ShellCompDirectiveNoFileComp }) @@ -123,7 +122,6 @@ func NewCmdVulnerabilitiesWithDeps(deps *cmddeps.Deps) *cobra.Command { } func (opts *VulnerabilitiesOptions) Run(ctx context.Context) error { - // Load configuration var cfgMgr *config.Manager if opts.deps != nil && opts.deps.ConfigMgr != nil { cfgMgr = opts.deps.ConfigMgr @@ -138,14 +136,12 @@ func (opts *VulnerabilitiesOptions) Run(ctx context.Context) error { return err } - // Resolve remote repository remote, err := vcs.ResolveRemote(opts.RepoArg) if err != nil { return err } opts.repoSlug = remote.Owner + "/" + remote.RepoName - // Create DeepSource client var client *deepsource.Client if opts.deps != nil && opts.deps.Client != nil { client = opts.deps.Client @@ -168,13 +164,9 @@ func (opts *VulnerabilitiesOptions) Run(ctx context.Context) error { return err } - // Apply severity filter if provided opts.applyFilters() - - // Apply limit cap if set opts.applyLimit() - // Output based on format var outErr error switch opts.OutputFormat { case "json": diff --git a/config/config.go b/config/config.go index 69a65ac1..27195726 100644 --- a/config/config.go +++ b/config/config.go @@ -19,14 +19,11 @@ type CLIConfig struct { TokenFromEnv bool `toml:"-"` } -// Sets the token expiry in the desired format -// Sets the token expiry in the desired format func (cfg *CLIConfig) SetTokenExpiry(str string) { t, _ := time.Parse(time.RFC3339, str) cfg.TokenExpiresIn = t.UTC() } -// Checks if the token has expired or not func (cfg CLIConfig) IsExpired() bool { if cfg.TokenExpiresIn.IsZero() { return false @@ -40,3 +37,9 @@ func (cfg *CLIConfig) VerifyAuthentication() error { } return nil } + +// NewDefault returns a CLIConfig with the default host set. +// Use this when Load() fails and a zero-value config is needed. +func NewDefault() *CLIConfig { + return &CLIConfig{Host: DefaultHostName} +} diff --git a/config/manager.go b/config/manager.go index edda6e8b..65b43edc 100644 --- a/config/manager.go +++ b/config/manager.go @@ -9,37 +9,23 @@ import ( "github.com/deepsourcelabs/cli/internal/adapters" "github.com/deepsourcelabs/cli/internal/debug" "github.com/deepsourcelabs/cli/internal/interfaces" - "github.com/deepsourcelabs/cli/internal/secrets" "github.com/pelletier/go-toml" ) // Manager handles reading and writing CLI config. type Manager struct { - fs interfaces.FileSystem - homeDir func() (string, error) - secrets secrets.Store - secretsKey string + fs interfaces.FileSystem + homeDir func() (string, error) } // NewManager creates a config manager with injected dependencies. func NewManager(fs interfaces.FileSystem, homeDir func() (string, error)) *Manager { - return NewManagerWithSecrets(fs, homeDir, secrets.NoopStore{}, "") -} - -// NewManagerWithSecrets creates a config manager with a secrets store. -func NewManagerWithSecrets(fs interfaces.FileSystem, homeDir func() (string, error), store secrets.Store, key string) *Manager { - if key == "" { - key = buildinfo.KeychainKey - } - if store == nil { - store = secrets.NoopStore{} - } - return &Manager{fs: fs, homeDir: homeDir, secrets: store, secretsKey: key} + return &Manager{fs: fs, homeDir: homeDir} } // DefaultManager returns a manager using OS-backed dependencies. func DefaultManager() *Manager { - return NewManagerWithSecrets(adapters.NewOSFileSystem(), os.UserHomeDir, secrets.DefaultStore(), "") + return NewManager(adapters.NewOSFileSystem(), os.UserHomeDir) } func (m *Manager) configDir() (string, error) { @@ -80,13 +66,6 @@ func (m *Manager) Load() (*CLIConfig, error) { } } - tokenFromKeychain := false - if cfg.Token == "" { - if token, err := m.secrets.Get(m.secretsKey); err == nil { - cfg.Token = token - tokenFromKeychain = true - } - } if cfg.Token == "" { if envToken := os.Getenv("DEEPSOURCE_TOKEN"); envToken != "" { cfg.Token = envToken @@ -96,24 +75,19 @@ func (m *Manager) Load() (*CLIConfig, error) { if cfg.Host == "" { if envHost := os.Getenv("DEEPSOURCE_HOST"); envHost != "" { cfg.Host = envHost + } else { + cfg.Host = DefaultHostName } } - debug.Log("config: host=%q user=%q token_present=%v keychain=%v env=%v", cfg.Host, cfg.User, cfg.Token != "", tokenFromKeychain, cfg.TokenFromEnv) + debug.Log("config: host=%q user=%q token_present=%v env=%v", cfg.Host, cfg.User, cfg.Token != "", cfg.TokenFromEnv) return cfg, nil } // Write persists the CLI config file. func (m *Manager) Write(cfg *CLIConfig) error { - cfgToWrite := *cfg - if cfg.Token != "" { - if err := m.secrets.Set(m.secretsKey, cfg.Token); err == nil { - cfgToWrite.Token = "" - } - } - - data, err := toml.Marshal(&cfgToWrite) + data, err := toml.Marshal(cfg) if err != nil { return err } @@ -137,10 +111,6 @@ func (m *Manager) Write(cfg *CLIConfig) error { // Delete removes the CLI config file if it exists. func (m *Manager) Delete() error { - if err := m.secrets.Delete(m.secretsKey); err != nil && !errors.Is(err, secrets.ErrNotFound) && !errors.Is(err, secrets.ErrUnavailable) { - return err - } - path, err := m.configPath() if err != nil { return err @@ -163,6 +133,14 @@ func (m *Manager) exists(path string) (bool, error) { return false, err } +// BackfillUser writes the user email to config if it is currently empty. +func (m *Manager) BackfillUser(cfg *CLIConfig, email string) { + if cfg.User == "" && email != "" { + cfg.User = email + _ = m.Write(cfg) + } +} + // TokenRefreshCallback returns a callback that persists refreshed token // credentials. Intended for use with deepsource.ClientOpts.OnTokenRefreshed. func (m *Manager) TokenRefreshCallback() func(token, expiry, email string) { diff --git a/config/manager_test.go b/config/manager_test.go index 689a2792..e434e4f5 100644 --- a/config/manager_test.go +++ b/config/manager_test.go @@ -7,45 +7,11 @@ import ( "github.com/deepsourcelabs/cli/buildinfo" "github.com/deepsourcelabs/cli/internal/adapters" - "github.com/deepsourcelabs/cli/internal/secrets" "github.com/pelletier/go-toml" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) -type fakeSecretStore struct { - data map[string]string -} - -func (f *fakeSecretStore) Get(key string) (string, error) { - value, ok := f.data[key] - if !ok { - return "", secrets.ErrNotFound - } - return value, nil -} - -func (f *fakeSecretStore) Set(key string, value string) error { - f.data[key] = value - return nil -} - -func (f *fakeSecretStore) Delete(key string) error { - delete(f.data, key) - return nil -} - -func TestManagerLoadTokenFromSecrets(t *testing.T) { - tempDir := t.TempDir() - homeDir := func() (string, error) { return tempDir, nil } - store := &fakeSecretStore{data: map[string]string{"token-key": "secret-token"}} - - mgr := NewManagerWithSecrets(adapters.NewOSFileSystem(), homeDir, store, "token-key") - cfg, err := mgr.Load() - assert.NoError(t, err) - assert.Equal(t, "secret-token", cfg.Token) -} - func TestManagerLoadFromFile(t *testing.T) { tempDir := t.TempDir() homeDir := func() (string, error) { return tempDir, nil } @@ -74,7 +40,7 @@ func TestManagerLoadNoFile(t *testing.T) { mgr := NewManager(adapters.NewOSFileSystem(), homeDir) cfg, err := mgr.Load() require.NoError(t, err) - assert.Empty(t, cfg.Host) + assert.Equal(t, DefaultHostName, cfg.Host) assert.Empty(t, cfg.User) assert.Empty(t, cfg.Token) } @@ -83,7 +49,6 @@ func TestManagerWrite(t *testing.T) { tempDir := t.TempDir() homeDir := func() (string, error) { return tempDir, nil } - // Use NoopStore so token stays in the TOML file mgr := NewManager(adapters.NewOSFileSystem(), homeDir) err := mgr.Write(&CLIConfig{ Host: "example.com", @@ -102,37 +67,32 @@ func TestManagerWrite(t *testing.T) { assert.Equal(t, "bob", got.User) } -func TestManagerWriteStoresTokenInSecrets(t *testing.T) { +func TestManagerWriteStoresTokenInTOML(t *testing.T) { tempDir := t.TempDir() homeDir := func() (string, error) { return tempDir, nil } - store := &fakeSecretStore{data: make(map[string]string)} - mgr := NewManagerWithSecrets(adapters.NewOSFileSystem(), homeDir, store, "mykey") + mgr := NewManager(adapters.NewOSFileSystem(), homeDir) err := mgr.Write(&CLIConfig{ Host: "example.com", Token: "super-secret", }) require.NoError(t, err) - // Token should be in secret store - assert.Equal(t, "super-secret", store.data["mykey"]) - - // Token should NOT be in the TOML file + // Token should be in the TOML file path := filepath.Join(tempDir, buildinfo.ConfigDirName, ConfigFileName) data, err := os.ReadFile(path) require.NoError(t, err) var got CLIConfig require.NoError(t, toml.Unmarshal(data, &got)) - assert.Empty(t, got.Token, "token should not be written to TOML when secret store succeeds") + assert.Equal(t, "super-secret", got.Token, "token should be written to TOML") } func TestManagerDelete(t *testing.T) { tempDir := t.TempDir() homeDir := func() (string, error) { return tempDir, nil } - store := &fakeSecretStore{data: map[string]string{"mykey": "tok"}} - mgr := NewManagerWithSecrets(adapters.NewOSFileSystem(), homeDir, store, "mykey") + mgr := NewManager(adapters.NewOSFileSystem(), homeDir) // Write a config first require.NoError(t, mgr.Write(&CLIConfig{Host: "example.com", Token: "tok"})) @@ -144,10 +104,6 @@ func TestManagerDelete(t *testing.T) { path := filepath.Join(tempDir, buildinfo.ConfigDirName, ConfigFileName) _, err := os.Stat(path) assert.True(t, os.IsNotExist(err), "config file should be deleted") - - // Secret should be gone - _, ok := store.data["mykey"] - assert.False(t, ok, "secret should be deleted") } func TestManagerDeleteNonExistent(t *testing.T) { @@ -162,9 +118,8 @@ func TestManagerDeleteNonExistent(t *testing.T) { func TestManagerTokenRefreshCallback(t *testing.T) { tempDir := t.TempDir() homeDir := func() (string, error) { return tempDir, nil } - store := &fakeSecretStore{data: make(map[string]string)} - mgr := NewManagerWithSecrets(adapters.NewOSFileSystem(), homeDir, store, "key") + mgr := NewManager(adapters.NewOSFileSystem(), homeDir) // Write initial config require.NoError(t, mgr.Write(&CLIConfig{Host: "example.com", User: "old@test.com", Token: "old-token"})) @@ -237,8 +192,7 @@ func TestManagerRefreshCallbackSkipsEnvToken(t *testing.T) { t.Setenv("DEEPSOURCE_TOKEN", "env-token") - store := &fakeSecretStore{data: make(map[string]string)} - mgr := NewManagerWithSecrets(adapters.NewOSFileSystem(), homeDir, store, "key") + mgr := NewManager(adapters.NewOSFileSystem(), homeDir) cb := mgr.TokenRefreshCallback() cb("refreshed-token", "2030-01-01T00:00:00Z", "new@test.com") @@ -253,12 +207,55 @@ func TestManagerRefreshCallbackSkipsEnvToken(t *testing.T) { func TestNewManagerDefaults(t *testing.T) { homeDir := func() (string, error) { return "/tmp", nil } - // NewManager uses NoopStore mgr := NewManager(adapters.NewOSFileSystem(), homeDir) assert.NotNil(t, mgr) +} + +func TestManagerLoadDefaultHost(t *testing.T) { + tempDir := t.TempDir() + homeDir := func() (string, error) { return tempDir, nil } + + // No config file, no DEEPSOURCE_HOST env var → Host should default + mgr := NewManager(adapters.NewOSFileSystem(), homeDir) + cfg, err := mgr.Load() + require.NoError(t, err) + assert.Equal(t, DefaultHostName, cfg.Host) +} + +func TestManagerBackfillUser(t *testing.T) { + tempDir := t.TempDir() + homeDir := func() (string, error) { return tempDir, nil } + mgr := NewManager(adapters.NewOSFileSystem(), homeDir) + + // Write initial config with no user + require.NoError(t, mgr.Write(&CLIConfig{Host: "example.com", Token: "tok"})) + + cfg, err := mgr.Load() + require.NoError(t, err) + assert.Empty(t, cfg.User) + + // BackfillUser should write the email + mgr.BackfillUser(cfg, "alice@example.com") + assert.Equal(t, "alice@example.com", cfg.User) + + // Reload to confirm it was persisted + cfg2, err := mgr.Load() + require.NoError(t, err) + assert.Equal(t, "alice@example.com", cfg2.User) +} + +func TestManagerBackfillUserNoop(t *testing.T) { + tempDir := t.TempDir() + homeDir := func() (string, error) { return tempDir, nil } + mgr := NewManager(adapters.NewOSFileSystem(), homeDir) + + // Write config with user already set + require.NoError(t, mgr.Write(&CLIConfig{Host: "example.com", Token: "tok", User: "existing@example.com"})) + + cfg, err := mgr.Load() + require.NoError(t, err) - // nil store defaults to NoopStore, empty key defaults to KeychainKey - mgr2 := NewManagerWithSecrets(adapters.NewOSFileSystem(), homeDir, nil, "") - assert.NotNil(t, mgr2) - assert.Equal(t, buildinfo.KeychainKey, mgr2.secretsKey) + // BackfillUser should be a no-op + mgr.BackfillUser(cfg, "new@example.com") + assert.Equal(t, "existing@example.com", cfg.User) } diff --git a/deepsource/analyzers/queries/get_analyzers.go b/deepsource/analyzers/queries/get_analyzers.go index ddcd2cd2..465407a5 100644 --- a/deepsource/analyzers/queries/get_analyzers.go +++ b/deepsource/analyzers/queries/get_analyzers.go @@ -8,7 +8,6 @@ import ( "github.com/deepsourcelabs/cli/deepsource/analyzers" ) -// GraphQL query const listAnalyzersQuery = ` { analyzers { @@ -48,7 +47,6 @@ func (a *AnalyzersRequest) Do(ctx context.Context) ([]analyzers.Analyzer, error) return nil, fmt.Errorf("Fetch analyzers: %w", err) } - // Formatting the query response w.r.t the output format analyzersData := make([]analyzers.Analyzer, len(respData.Analyzers.Edges)) for index, edge := range respData.Analyzers.Edges { analyzersData[index].Name = edge.Node.Name diff --git a/deepsource/client.go b/deepsource/client.go index b8a029ef..bf7bae11 100644 --- a/deepsource/client.go +++ b/deepsource/client.go @@ -1,4 +1,3 @@ -// DeepSource SDK package deepsource import ( @@ -47,12 +46,10 @@ type Client struct { token string } -// Returns a GraphQL client which can be used to interact with the GQL APIs func (c Client) GQL() *graphql.Client { return c.gql } -// Returns the PAT which is required for authentication and thus, interacting with the APIs func (c Client) GetToken() string { return c.token } @@ -63,7 +60,6 @@ func NewWithGraphQLClient(gql graphqlclient.GraphQLClient) *Client { return &Client{gqlWrapper: gql} } -// Returns a new GQLClient func New(cp ClientOpts) (*Client, error) { apiClientURL := getAPIClientURL(cp.HostName) httpClient := &http.Client{ @@ -106,20 +102,16 @@ func normalizeHostName(hostName string) string { } } -// Formats and returns the DeepSource Public API client URL func getAPIClientURL(hostName string) string { hostName = normalizeHostName(hostName) apiClientURL := fmt.Sprintf("https://api.%s/graphql/", defaultHostName) - // Check if the domain is different from the default domain (In case of Enterprise users) if hostName != defaultHostName { apiClientURL = fmt.Sprintf("https://%s/api/graphql/", hostName) } return apiClientURL } -// Registers the device and allots it a device code which is further used for fetching -// the PAT and other authentication data func (c Client) RegisterDevice(ctx context.Context) (*auth.Device, error) { req := authmut.NewRegisterDeviceRequest(c.gqlWrapper) res, err := req.Do(ctx) @@ -129,7 +121,6 @@ func (c Client) RegisterDevice(ctx context.Context) (*auth.Device, error) { return res, nil } -// Logs in the client using the deviceCode and the user Code and returns the PAT and data which is required for authentication func (c Client) Login(ctx context.Context, deviceCode, description string) (*auth.PAT, error) { req := authmut.NewRequestPATRequest(c.gqlWrapper, authmut.RequestPATParams{ DeviceCode: deviceCode, @@ -143,7 +134,6 @@ func (c Client) Login(ctx context.Context, deviceCode, description string) (*aut return res, nil } -// Refreshes the authentication credentials. Takes the refreshToken as a parameter. func (c Client) RefreshAuthCreds(ctx context.Context, token string) (*auth.PAT, error) { req := authmut.NewRefreshTokenRequest(c.gqlWrapper, authmut.RefreshTokenParams{ Token: token, @@ -155,7 +145,6 @@ func (c Client) RefreshAuthCreds(ctx context.Context, token string) (*auth.PAT, return res, nil } -// Returns the list of Analyzers supported by DeepSource along with their meta like shortcode, metaschema. func (c Client) GetSupportedAnalyzers(ctx context.Context) ([]analyzers.Analyzer, error) { req := analyzerQuery.NewAnalyzersRequest(c.gqlWrapper) res, err := req.Do(ctx) @@ -165,7 +154,6 @@ func (c Client) GetSupportedAnalyzers(ctx context.Context) ([]analyzers.Analyzer return res, nil } -// Returns the list of CodeFormatters supported by DeepSource along with their meta like shortcode. func (c Client) GetSupportedCodeFormatters(ctx context.Context) ([]codeformatters.CodeFormatter, error) { req := codeformatterQuery.NewCodeFormattersRequest(c.gqlWrapper) res, err := req.Do(ctx) @@ -175,10 +163,6 @@ func (c Client) GetSupportedCodeFormatters(ctx context.Context) ([]codeformatter return res, nil } -// Returns the activation status of the repository whose data is sent as parameters. -// Owner : The username of the owner of the repository -// repoName : The name of the repository whose activation status has to be queried -// provider : The VCS provider which hosts the repo (GITHUB/GITLAB/BITBUCKET) func (c Client) GetRepoStatus(ctx context.Context, owner, repoName, provider string) (*repository.Meta, error) { req := repoQuery.NewRepoStatusRequest(c.gqlWrapper, repoQuery.RepoStatusParams{ Owner: owner, @@ -192,7 +176,7 @@ func (c Client) GetRepoStatus(ctx context.Context, owner, repoName, provider str return res, nil } -// Returns the list of issues for a certain repository. Auto-paginates to fetch all results. +// Auto-paginates to fetch all results. func (c Client) GetIssues(ctx context.Context, owner, repoName, provider string) ([]issues.Issue, error) { req := issuesQuery.NewIssuesListRequest(c.gqlWrapper, issuesQuery.IssuesListParams{ Owner: owner, @@ -207,7 +191,7 @@ func (c Client) GetIssues(ctx context.Context, owner, repoName, provider string) return res, nil } -// Returns the list of issues reported for a certain file. Auto-paginates to fetch all results. +// Auto-paginates to fetch all results. func (c Client) GetIssuesForFile(ctx context.Context, owner, repoName, provider, filePath string) ([]issues.Issue, error) { req := issuesQuery.NewFileIssuesListRequest(c.gqlWrapper, issuesQuery.FileIssuesListParams{ Owner: owner, @@ -222,7 +206,6 @@ func (c Client) GetIssuesForFile(ctx context.Context, owner, repoName, provider, return res, nil } -// Returns details of the authenticated user. func (c Client) GetViewer(ctx context.Context) (*user.User, error) { req := userQuery.NewViewerRequest(c.gqlWrapper) res, err := req.Do(ctx) @@ -232,12 +215,6 @@ func (c Client) GetViewer(ctx context.Context) (*user.User, error) { return res, nil } -// Returns the list of analysis runs for a repository. -// owner : The username of the owner of the repository -// repoName : The name of the repository -// provider : The VCS provider which hosts the repo (GITHUB/GITLAB/BITBUCKET) -// limit : The number of analysis runs to fetch -// after : Cursor for pagination (nil for first page) func (c Client) GetAnalysisRuns(ctx context.Context, owner, repoName, provider string, limit int, after *string, branchName *string) ([]runs.AnalysisRun, runsQuery.PageInfo, error) { req := runsQuery.NewAnalysisRunsListRequest(c.gqlWrapper, runsQuery.AnalysisRunsListParams{ Owner: owner, @@ -254,7 +231,6 @@ func (c Client) GetAnalysisRuns(ctx context.Context, owner, repoName, provider s return res, pageInfo, nil } -// Returns the analysis run for a specific commit. // Returns nil (not an error) if no run exists for the given commit. func (c Client) GetRunByCommit(ctx context.Context, commitOid string) (*runs.AnalysisRun, error) { req := runsQuery.NewGetRunRequest(c.gqlWrapper, runsQuery.GetRunParams{ @@ -267,8 +243,6 @@ func (c Client) GetRunByCommit(ctx context.Context, commitOid string) (*runs.Ana return res, nil } -// Returns the issues for a specific analysis run. -// commitOid : The commit OID of the analysis run func (c Client) GetRunIssues(ctx context.Context, commitOid string) (*runs.RunWithIssues, error) { req := runsQuery.NewRunIssuesRequest(c.gqlWrapper, runsQuery.RunIssuesParams{ CommitOid: commitOid, @@ -280,7 +254,7 @@ func (c Client) GetRunIssues(ctx context.Context, commitOid string) (*runs.RunWi return res, nil } -// Returns issues for a specific run as a flat list (for issues --commit). Auto-paginates nested results. +// Auto-paginates nested results. func (c Client) GetRunIssuesFlat(ctx context.Context, commitOid string, filters issuesQuery.RunIssuesFlatParams) ([]issues.Issue, error) { filters.CommitOid = commitOid req := issuesQuery.NewRunIssuesFlatRequest(c.gqlWrapper, filters) @@ -291,7 +265,7 @@ func (c Client) GetRunIssuesFlat(ctx context.Context, commitOid string, filters return res, nil } -// Returns issues for a specific pull request. Auto-paginates to fetch all results. +// Auto-paginates to fetch all results. func (c Client) GetPRIssues(ctx context.Context, owner, repoName, provider string, prNumber int) ([]issues.Issue, error) { req := issuesQuery.NewPRIssuesListRequest(c.gqlWrapper, issuesQuery.PRIssuesListParams{ Owner: owner, @@ -306,7 +280,6 @@ func (c Client) GetPRIssues(ctx context.Context, owner, repoName, provider strin return res, nil } -// Returns metrics for a repository's default branch. func (c Client) GetRepoMetrics(ctx context.Context, owner, repoName, provider string) ([]metrics.RepositoryMetric, error) { req := metricsQuery.NewRepoMetricsRequest(c.gqlWrapper, metricsQuery.RepoMetricsParams{ Owner: owner, @@ -320,7 +293,6 @@ func (c Client) GetRepoMetrics(ctx context.Context, owner, repoName, provider st return res, nil } -// Returns metrics for a specific analysis run. func (c Client) GetRunMetrics(ctx context.Context, commitOid string) (*metrics.RunMetrics, error) { req := metricsQuery.NewRunMetricsRequest(c.gqlWrapper, metricsQuery.RunMetricsParams{ CommitOid: commitOid, @@ -332,7 +304,6 @@ func (c Client) GetRunMetrics(ctx context.Context, commitOid string) (*metrics.R return res, nil } -// Returns metrics for a specific pull request. func (c Client) GetPRMetrics(ctx context.Context, owner, repoName, provider string, prNumber int) (*metrics.PRMetrics, error) { req := metricsQuery.NewPRMetricsRequest(c.gqlWrapper, metricsQuery.PRMetricsParams{ Owner: owner, @@ -347,7 +318,7 @@ func (c Client) GetPRMetrics(ctx context.Context, owner, repoName, provider stri return res, nil } -// Returns vulnerabilities for a repository's default branch. Auto-paginates to fetch all results. +// Auto-paginates to fetch all results. func (c Client) GetRepoVulns(ctx context.Context, owner, repoName, provider string) ([]vulnerabilities.VulnerabilityOccurrence, error) { req := vulnerabilitiesQuery.NewRepoVulnsRequest(c.gqlWrapper, vulnerabilitiesQuery.RepoVulnsParams{ Owner: owner, @@ -361,7 +332,6 @@ func (c Client) GetRepoVulns(ctx context.Context, owner, repoName, provider stri return res, nil } -// Returns vulnerabilities for a specific analysis run. func (c Client) GetRunVulns(ctx context.Context, commitOid string) (*vulnerabilities.RunVulns, error) { req := vulnerabilitiesQuery.NewRunVulnsRequest(c.gqlWrapper, vulnerabilitiesQuery.RunVulnsParams{ CommitOid: commitOid, @@ -373,7 +343,6 @@ func (c Client) GetRunVulns(ctx context.Context, commitOid string) (*vulnerabili return res, nil } -// Returns the list of enabled analyzers for a repository. func (c Client) GetEnabledAnalyzers(ctx context.Context, owner, repoName, provider string) ([]analyzers.Analyzer, error) { req := repoQuery.NewEnabledAnalyzersRequest(c.gqlWrapper, repoQuery.EnabledAnalyzersParams{ Owner: owner, @@ -387,7 +356,6 @@ func (c Client) GetEnabledAnalyzers(ctx context.Context, owner, repoName, provid return res, nil } -// Returns the branch name for a specific pull request. func (c Client) GetPRBranch(ctx context.Context, owner, repoName, provider string, prNumber int) (string, error) { req := runsQuery.NewPRBranchRequest(c.gqlWrapper, runsQuery.PRBranchParams{ Owner: owner, @@ -398,7 +366,6 @@ func (c Client) GetPRBranch(ctx context.Context, owner, repoName, provider strin return req.Do(ctx) } -// Returns the PR number for a branch, if an open PR exists. // Returns found=false when no PR exists or the PR is not open. func (c Client) GetPRForBranch(ctx context.Context, owner, repoName, provider, branch string) (prNumber int, found bool, err error) { req := runsQuery.NewPRByBranchRequest(c.gqlWrapper, runsQuery.PRByBranchParams{ @@ -417,7 +384,7 @@ func (c Client) GetPRForBranch(ctx context.Context, owner, repoName, provider, b return number, true, nil } -// Returns vulnerabilities for a specific pull request. Auto-paginates to fetch all results. +// Auto-paginates to fetch all results. func (c Client) GetPRVulns(ctx context.Context, owner, repoName, provider string, prNumber int) (*vulnerabilities.PRVulns, error) { req := vulnerabilitiesQuery.NewPRVulnsRequest(c.gqlWrapper, vulnerabilitiesQuery.PRVulnsParams{ Owner: owner, diff --git a/deepsource/codeformatters/codeformatters.go b/deepsource/codeformatters/codeformatters.go index 355edbda..e8a52f72 100644 --- a/deepsource/codeformatters/codeformatters.go +++ b/deepsource/codeformatters/codeformatters.go @@ -1,6 +1,6 @@ package codeformatters type CodeFormatter struct { - Name string // Name of the CodeFormatter - Shortcode string // Shortcode of the CodeFormatter + Name string + Shortcode string } diff --git a/deepsource/issues/issues_list.go b/deepsource/issues/issues_list.go index 6ebf0f15..41a66fa9 100644 --- a/deepsource/issues/issues_list.go +++ b/deepsource/issues/issues_list.go @@ -1,27 +1,27 @@ package issues type Position struct { - BeginLine int `json:"begin"` // The line where the code covered under the issue starts - EndLine int `json:"end"` // The line where the code covered under the issue starts + BeginLine int `json:"begin"` + EndLine int `json:"end"` } type Location struct { - Path string `json:"path"` // The filepath where the issue is reported - Position Position `json:"position"` // The position info where the issue is raised + Path string `json:"path"` + Position Position `json:"position"` } type AnalyzerMeta struct { - Name string `json:"name"` // Analyzer name (human-readable) - Shortcode string `json:"analyzer"` // Analyzer shortcode + Name string `json:"name"` + Shortcode string `json:"analyzer"` } type Issue struct { - IssueText string `json:"issue_title"` // The describing heading of the issue - IssueCode string `json:"issue_code"` // DeepSource code for the issue reported - IssueCategory string `json:"issue_category"` // Category of the issue reported - IssueSeverity string `json:"issue_severity"` // Severity of the issue reported - IssueSource string `json:"issue_source"` // Source of the issue (STATIC or AI) - Description string `json:"description"` // Short description / explanation of the issue - Location Location `json:"location"` // The location data for the issue reported - Analyzer AnalyzerMeta // The Analyzer which raised the issue + IssueText string `json:"issue_title"` + IssueCode string `json:"issue_code"` + IssueCategory string `json:"issue_category"` + IssueSeverity string `json:"issue_severity"` + IssueSource string `json:"issue_source"` + Description string `json:"description"` + Location Location `json:"location"` + Analyzer AnalyzerMeta } diff --git a/deepsource/issues/queries/list_file_issues.go b/deepsource/issues/queries/list_file_issues.go index 68b4bf39..8fc84b0e 100644 --- a/deepsource/issues/queries/list_file_issues.go +++ b/deepsource/issues/queries/list_file_issues.go @@ -1,4 +1,3 @@ -// Lists the issues reported in a single file mentioned by the user package issues import ( diff --git a/deepsource/issues/queries/list_issues.go b/deepsource/issues/queries/list_issues.go index 37609a0e..3534f887 100644 --- a/deepsource/issues/queries/list_issues.go +++ b/deepsource/issues/queries/list_issues.go @@ -1,4 +1,3 @@ -// Lists the issues reported in the whole project package issues import ( diff --git a/deepsource/issues/queries/pr_issues.go b/deepsource/issues/queries/pr_issues.go index a94f2697..9883a412 100644 --- a/deepsource/issues/queries/pr_issues.go +++ b/deepsource/issues/queries/pr_issues.go @@ -1,4 +1,3 @@ -// Lists the issues from a pull request package issues import ( diff --git a/deepsource/issues/queries/run_issues.go b/deepsource/issues/queries/run_issues.go index 598f236b..dfb61bc7 100644 --- a/deepsource/issues/queries/run_issues.go +++ b/deepsource/issues/queries/run_issues.go @@ -1,4 +1,3 @@ -// Lists the issues from a specific run (flattened to Issue type) package issues import ( diff --git a/deepsource/metrics/queries/pr.go b/deepsource/metrics/queries/pr.go index f9d2dc42..75fdf689 100644 --- a/deepsource/metrics/queries/pr.go +++ b/deepsource/metrics/queries/pr.go @@ -1,4 +1,3 @@ -// Fetches metrics from a pull request package queries import ( diff --git a/deepsource/metrics/queries/repo.go b/deepsource/metrics/queries/repo.go index 95471a09..12bdefea 100644 --- a/deepsource/metrics/queries/repo.go +++ b/deepsource/metrics/queries/repo.go @@ -1,4 +1,3 @@ -// Fetches metrics from a repository's default branch package queries import ( diff --git a/deepsource/metrics/queries/run.go b/deepsource/metrics/queries/run.go index 5c53a03f..893ee173 100644 --- a/deepsource/metrics/queries/run.go +++ b/deepsource/metrics/queries/run.go @@ -1,4 +1,3 @@ -// Fetches metrics from a specific analysis run package queries import ( diff --git a/deepsource/repository/queries/repository_status.go b/deepsource/repository/queries/repository_status.go index 0a9783ea..7294d936 100644 --- a/deepsource/repository/queries/repository_status.go +++ b/deepsource/repository/queries/repository_status.go @@ -8,7 +8,6 @@ import ( "github.com/deepsourcelabs/cli/deepsource/repository" ) -// Query to fetch the status of the repo data sent as param const repoStatusQuery = `query RepoStatus($name: String!,$owner: String!, $provider: VCSProvider!){ repository(name:$name, login:$owner, vcsProvider:$provider){ isActivated @@ -47,8 +46,6 @@ func (r *RepoStatusRequest) Do(ctx context.Context) (*repository.Meta, error) { return nil, fmt.Errorf("Fetch repo status: %w", err) } - // Formatting the query response w.r.t the repository.Meta structure - // defined in `repository.go` repositoryData := repository.Meta{ Activated: false, Name: r.Params.RepoName, @@ -59,7 +56,6 @@ func (r *RepoStatusRequest) Do(ctx context.Context) (*repository.Meta, error) { repositoryData.Owner = r.Params.Owner repositoryData.Provider = r.Params.Provider - // Check and set the activation status if respData.Repository.Isactivated { repositoryData.Activated = true } else { diff --git a/deepsource/repository/repository.go b/deepsource/repository/repository.go index 89fb3cf8..37b09b8f 100644 --- a/deepsource/repository/repository.go +++ b/deepsource/repository/repository.go @@ -1,8 +1,8 @@ package repository type Meta struct { - Activated bool // Activation status of the repository. True: Activated. False: Not Activated. - Name string // Name of the repository - Owner string // Owner username of the repository - Provider string // VCS host for the repo. Github/Gitlab/BitBucket supported yet. + Activated bool + Name string + Owner string + Provider string } diff --git a/deepsource/runs/queries/get_pr_branch.go b/deepsource/runs/queries/get_pr_branch.go index 0eeba867..10255228 100644 --- a/deepsource/runs/queries/get_pr_branch.go +++ b/deepsource/runs/queries/get_pr_branch.go @@ -1,4 +1,3 @@ -// Get the branch name for a pull request package queries import ( diff --git a/deepsource/runs/queries/get_pr_by_branch.go b/deepsource/runs/queries/get_pr_by_branch.go index e3f8da20..143790cc 100644 --- a/deepsource/runs/queries/get_pr_by_branch.go +++ b/deepsource/runs/queries/get_pr_by_branch.go @@ -1,4 +1,3 @@ -// Get the pull request for a branch package queries import ( diff --git a/deepsource/runs/queries/get_run.go b/deepsource/runs/queries/get_run.go index 8e71eedd..5156fff1 100644 --- a/deepsource/runs/queries/get_run.go +++ b/deepsource/runs/queries/get_run.go @@ -1,4 +1,3 @@ -// Get an analysis run by commit OID package queries import ( diff --git a/deepsource/runs/queries/get_run_issues.go b/deepsource/runs/queries/get_run_issues.go index 6b0959f3..0b36e927 100644 --- a/deepsource/runs/queries/get_run_issues.go +++ b/deepsource/runs/queries/get_run_issues.go @@ -1,4 +1,3 @@ -// Get issues for a specific analysis run package queries import ( diff --git a/deepsource/runs/queries/list_analysis_runs.go b/deepsource/runs/queries/list_analysis_runs.go index c641e953..79aba10e 100644 --- a/deepsource/runs/queries/list_analysis_runs.go +++ b/deepsource/runs/queries/list_analysis_runs.go @@ -1,4 +1,3 @@ -// Lists the analysis runs for a repository package queries import ( diff --git a/deepsource/vulnerabilities/queries/pr.go b/deepsource/vulnerabilities/queries/pr.go index 0bec5dd1..b48df75b 100644 --- a/deepsource/vulnerabilities/queries/pr.go +++ b/deepsource/vulnerabilities/queries/pr.go @@ -1,4 +1,3 @@ -// Fetches vulnerabilities from a pull request package queries import ( diff --git a/deepsource/vulnerabilities/queries/repo.go b/deepsource/vulnerabilities/queries/repo.go index 855b14a0..76767eea 100644 --- a/deepsource/vulnerabilities/queries/repo.go +++ b/deepsource/vulnerabilities/queries/repo.go @@ -1,4 +1,3 @@ -// Fetches vulnerabilities from a repository's default branch package queries import ( diff --git a/deepsource/vulnerabilities/queries/run.go b/deepsource/vulnerabilities/queries/run.go index 2e21bb1e..ee41cad6 100644 --- a/deepsource/vulnerabilities/queries/run.go +++ b/deepsource/vulnerabilities/queries/run.go @@ -1,4 +1,3 @@ -// Fetches vulnerabilities from a specific analysis run package queries import ( diff --git a/docs/architecture_refactor_phase1.md b/docs/architecture_refactor_phase1.md deleted file mode 100644 index e14d0a27..00000000 --- a/docs/architecture_refactor_phase1.md +++ /dev/null @@ -1,25 +0,0 @@ -# Architecture Refactor Phase 1 Notes - -This document summarizes the Phase 1 foundation work for the DeepSource CLI refactor. - -## Interfaces -- `internal/interfaces/` defines contracts for filesystem, environment, git, HTTP, output, and telemetry. -- These interfaces enable dependency injection and isolate external dependencies. - -## Container -- `internal/container` provides production (`New`) and test (`NewTest`) containers. -- The container wires adapters to the interface contracts and holds shared config state. - -## Dual Output System -- `internal/adapters/dual_output.go` writes user output to stdout. -- Diagnostic output is written to stderr and optionally to a debug log file. -- Set `DEEPSOURCE_CLI_DEBUG=1` to enable logging at `~/.deepsource/cli-debug.log`. -- Set `DEEPSOURCE_CLI_DEBUG=/path/to/log` to write diagnostics to a custom file. - -## Context Propagation -- `command.ExecuteContext(ctx)` sets the context on the root command. -- Existing `command.Execute()` now calls `ExecuteContext(context.Background())`. - -## Next Steps -- Add services and adapters as commands are refactored. -- Move command logic into service packages and inject dependencies via the container. diff --git a/internal/adapters/git.go b/internal/adapters/git.go index 062636d2..5fcaab55 100644 --- a/internal/adapters/git.go +++ b/internal/adapters/git.go @@ -50,41 +50,33 @@ func (*RealGitClient) ListRemotes(_ string) (map[string]interfaces.RemoteInfo, e // gitGetHead accepts a git directory and returns head commit OID / error. func gitGetHead(workspaceDir string) (headOID string, warning string, err error) { - // Check if DeepSource's Test coverage action triggered this first before executing any git commands. headOID, err = getTestCoverageActionCommit() if headOID != "" { return } - // Check if the `GIT_COMMIT_SHA` environment variable exists. If yes, return this as - // the latest commit sha. if injectedSHA, isManuallyInjectedSHA := os.LookupEnv("GIT_COMMIT_SHA"); isManuallyInjectedSHA { return injectedSHA, "", nil } - // Get the top commit manually, using git command. headOID, err = fetchHeadManually(workspaceDir) if err != nil { return } - // TRAVIS CI if envUser := os.Getenv("USER"); envUser == "travis" { headOID, warning, err = getTravisCommit(headOID) return } - // GITHUB ACTIONS if _, isGitHubEnv := os.LookupEnv("GITHUB_ACTIONS"); isGitHubEnv { headOID, warning, err = getGitHubActionsCommit(headOID) return } - // If we are here, it means there weren't any special cases. return } -// Fetches the latest commit hash using the command `git rev-parse HEAD`. func fetchHeadManually(directoryPath string) (string, error) { cmd := exec.Command("git", "--no-pager", "rev-parse", "HEAD") cmd.Dir = directoryPath @@ -99,7 +91,6 @@ func fetchHeadManually(directoryPath string) (string, error) { return "", err } - // Trim newline suffix from Commit OID. return strings.TrimSuffix(outStr, "\n"), nil } diff --git a/internal/oidc/fetch_oidc_token.go b/internal/oidc/fetch_oidc_token.go index dc5dcc67..b9c9b798 100644 --- a/internal/oidc/fetch_oidc_token.go +++ b/internal/oidc/fetch_oidc_token.go @@ -14,21 +14,16 @@ var ( } ) -// FetchOIDCTokenFromProvider fetches the OIDC token from the OIDC token provider. -// It takes the request ID and the request URL as input and returns the OIDC token as a string. func FetchOIDCTokenFromProvider(requestId, requestUrl string) (string, error) { - // requestid is the bearer token that needs to be sent to the request url req, err := http.NewRequest("GET", requestUrl, http.NoBody) if err != nil { return "", err } req.Header.Set("Authorization", "Bearer "+requestId) - // set the expected audiences as the audience parameter q := req.URL.Query() q.Set("audience", DEEPSOURCE_AUDIENCE) req.URL.RawQuery = q.Encode() - // send the request client := &http.Client{} resp, err := client.Do(req) if err != nil { @@ -36,29 +31,22 @@ func FetchOIDCTokenFromProvider(requestId, requestUrl string) (string, error) { } defer resp.Body.Close() - // check if the response is 200 if resp.StatusCode != http.StatusOK { return "", fmt.Errorf("Failed to fetch OIDC token: %s", resp.Status) } - // extract the token from the json response. The token is sent under the key `value` - // and the response is a json object var tokenResponse struct { Value string `json:"value"` } if err := json.NewDecoder(resp.Body).Decode(&tokenResponse); err != nil { return "", err } - // check if the token is empty if tokenResponse.Value == "" { return "", fmt.Errorf("Failed to fetch OIDC token: empty token") } - // return the token return tokenResponse.Value, nil } -// ExchangeOIDCTokenForTempDSN exchanges the OIDC token for a temporary DSN. -// It sends the OIDC token to the respective DeepSource API endpoint and returns the temp DSN as string. func ExchangeOIDCTokenForTempDSN(oidcToken, dsEndpoint, provider string) (string, error) { apiEndpoint := fmt.Sprintf("%s/services/oidc/%s/", dsEndpoint, provider) req, err := http.NewRequest("POST", apiEndpoint, http.NoBody) @@ -82,17 +70,13 @@ func ExchangeOIDCTokenForTempDSN(oidcToken, dsEndpoint, provider string) (string if err := json.NewDecoder(resp.Body).Decode(&exchangeResponse); err != nil { return "", err } - // check if the token is empty if exchangeResponse.DSN == "" { return "", fmt.Errorf("Failed to exchange OIDC token for DSN: empty token") } - // return the token return exchangeResponse.DSN, nil } func GetDSNFromOIDC(requestId, requestUrl, dsEndpoint, provider string) (string, error) { - // infer provider from environment variables. - // Github actions sets the GITHUB_ACTIONS environment variable to true by default. if os.Getenv("GITHUB_ACTIONS") == "true" { provider = "github-actions" } @@ -111,7 +95,6 @@ func GetDSNFromOIDC(requestId, requestUrl, dsEndpoint, provider string) (string, } if requestId == "" || requestUrl == "" { var foundIDToken, foundRequestURL bool - // try to fetch the token from the environment variables. // skipcq: CRT-A0014 switch provider { case "github-actions": diff --git a/internal/secrets/keychain_darwin.go b/internal/secrets/keychain_darwin.go deleted file mode 100644 index 07a41860..00000000 --- a/internal/secrets/keychain_darwin.go +++ /dev/null @@ -1,56 +0,0 @@ -//go:build darwin - -package secrets - -import ( - "bytes" - "os/exec" - "strings" - - "github.com/deepsourcelabs/cli/buildinfo" -) - -type keychainStore struct { - service string -} - -// NewKeychainStore returns a macOS keychain-backed store. -func NewKeychainStore() Store { - return &keychainStore{service: buildinfo.KeychainSvc} -} - -func (k *keychainStore) Get(key string) (string, error) { - cmd := exec.Command("security", "find-generic-password", "-s", k.service, "-a", key, "-w") - var stderr bytes.Buffer - cmd.Stderr = &stderr - output, err := cmd.Output() - if err != nil { - if strings.Contains(stderr.String(), "could not be found") { - return "", ErrNotFound - } - return "", err - } - return strings.TrimSpace(string(output)), nil -} - -func (k *keychainStore) Set(key string, value string) error { - cmd := exec.Command("security", "add-generic-password", "-s", k.service, "-a", key, "-w", value, "-U") - output, err := cmd.CombinedOutput() - if err != nil { - return err - } - _ = output - return nil -} - -func (k *keychainStore) Delete(key string) error { - cmd := exec.Command("security", "delete-generic-password", "-s", k.service, "-a", key) - output, err := cmd.CombinedOutput() - if err != nil { - if strings.Contains(string(output), "could not be found") { - return ErrNotFound - } - return err - } - return nil -} diff --git a/internal/secrets/keychain_stub.go b/internal/secrets/keychain_stub.go deleted file mode 100644 index 29e90a15..00000000 --- a/internal/secrets/keychain_stub.go +++ /dev/null @@ -1,8 +0,0 @@ -//go:build !darwin - -package secrets - -// NewKeychainStore returns a no-op store on unsupported platforms. -func NewKeychainStore() Store { - return NoopStore{} -} diff --git a/internal/secrets/store.go b/internal/secrets/store.go deleted file mode 100644 index 65eba63b..00000000 --- a/internal/secrets/store.go +++ /dev/null @@ -1,35 +0,0 @@ -package secrets - -import "errors" - -var ( - ErrNotFound = errors.New("Secret not found") - ErrUnavailable = errors.New("Secrets store unavailable") -) - -// Store provides secret storage primitives. -type Store interface { - Get(key string) (string, error) - Set(key string, value string) error - Delete(key string) error -} - -// NoopStore implements Store with no backing storage. -type NoopStore struct{} - -func (NoopStore) Get(_ string) (string, error) { - return "", ErrUnavailable -} - -func (NoopStore) Set(_ string, _ string) error { - return ErrUnavailable -} - -func (NoopStore) Delete(_ string) error { - return ErrUnavailable -} - -// DefaultStore returns the best available store for the platform. -func DefaultStore() Store { - return NewKeychainStore() -} diff --git a/internal/services/auth/service_test.go b/internal/services/auth/service_test.go index 20b960ac..4db4c9ed 100644 --- a/internal/services/auth/service_test.go +++ b/internal/services/auth/service_test.go @@ -5,14 +5,13 @@ import ( "github.com/deepsourcelabs/cli/config" "github.com/deepsourcelabs/cli/internal/adapters" - "github.com/deepsourcelabs/cli/internal/secrets" "github.com/stretchr/testify/assert" ) func TestServiceSaveLoadDeleteConfig(t *testing.T) { tempDir := t.TempDir() homeDir := func() (string, error) { return tempDir, nil } - mgr := config.NewManagerWithSecrets(adapters.NewOSFileSystem(), homeDir, secrets.NoopStore{}, "test-key") + mgr := config.NewManager(adapters.NewOSFileSystem(), homeDir) svc := NewService(mgr) cfg := &config.CLIConfig{Host: "deepsource.com", User: "demo", Token: "demo-token"} diff --git a/internal/services/repo/service_test.go b/internal/services/repo/service_test.go index ba38605a..c92df000 100644 --- a/internal/services/repo/service_test.go +++ b/internal/services/repo/service_test.go @@ -10,7 +10,6 @@ import ( "github.com/deepsourcelabs/cli/deepsource/analyzers" "github.com/deepsourcelabs/cli/deepsource/repository" "github.com/deepsourcelabs/cli/internal/adapters" - "github.com/deepsourcelabs/cli/internal/secrets" "github.com/deepsourcelabs/cli/internal/vcs" "github.com/stretchr/testify/assert" ) @@ -32,7 +31,7 @@ func (f *fakeRepoClient) GetEnabledAnalyzers(_ context.Context, _, _, _ string) func TestServiceStatus(t *testing.T) { tempDir := t.TempDir() homeDir := func() (string, error) { return tempDir, nil } - mgr := config.NewManagerWithSecrets(adapters.NewOSFileSystem(), homeDir, secrets.NoopStore{}, "test-key") + mgr := config.NewManager(adapters.NewOSFileSystem(), homeDir) cfg := &config.CLIConfig{Host: "deepsource.com", User: "demo", Token: "token"} assert.NoError(t, mgr.Write(cfg)) @@ -72,7 +71,7 @@ func TestGetDashboardHost(t *testing.T) { func TestServiceViewURLUnauthorized(t *testing.T) { tempDir := t.TempDir() homeDir := func() (string, error) { return tempDir, nil } - mgr := config.NewManagerWithSecrets(adapters.NewOSFileSystem(), homeDir, secrets.NoopStore{}, "test-key") + mgr := config.NewManager(adapters.NewOSFileSystem(), homeDir) cfg := &config.CLIConfig{Host: "deepsource.com", User: "demo", Token: "token"} assert.NoError(t, mgr.Write(cfg)) @@ -92,7 +91,7 @@ func TestServiceViewURLUnauthorized(t *testing.T) { func TestServiceStatusWithAnalyzers_Activated(t *testing.T) { tempDir := t.TempDir() homeDir := func() (string, error) { return tempDir, nil } - mgr := config.NewManagerWithSecrets(adapters.NewOSFileSystem(), homeDir, secrets.NoopStore{}, "test-key") + mgr := config.NewManager(adapters.NewOSFileSystem(), homeDir) cfg := &config.CLIConfig{Host: "deepsource.com", User: "demo", Token: "token"} assert.NoError(t, mgr.Write(cfg)) @@ -124,7 +123,7 @@ func TestServiceStatusWithAnalyzers_Activated(t *testing.T) { func TestServiceStatusWithAnalyzers_NotActivated(t *testing.T) { tempDir := t.TempDir() homeDir := func() (string, error) { return tempDir, nil } - mgr := config.NewManagerWithSecrets(adapters.NewOSFileSystem(), homeDir, secrets.NoopStore{}, "test-key") + mgr := config.NewManager(adapters.NewOSFileSystem(), homeDir) cfg := &config.CLIConfig{Host: "deepsource.com", User: "demo", Token: "token"} assert.NoError(t, mgr.Write(cfg)) diff --git a/internal/testutil/testutil.go b/internal/testutil/testutil.go index 36dbe680..07684dc1 100644 --- a/internal/testutil/testutil.go +++ b/internal/testutil/testutil.go @@ -11,7 +11,6 @@ import ( "github.com/deepsourcelabs/cli/config" "github.com/deepsourcelabs/cli/deepsource/graphqlclient" "github.com/deepsourcelabs/cli/internal/adapters" - "github.com/deepsourcelabs/cli/internal/secrets" ) // CreateTestConfigManager creates a config.Manager backed by a temp directory @@ -21,9 +20,9 @@ func CreateTestConfigManager(t *testing.T, token, host, user string) *config.Man tmpDir := t.TempDir() fs := adapters.NewOSFileSystem() - mgr := config.NewManagerWithSecrets(fs, func() (string, error) { + mgr := config.NewManager(fs, func() (string, error) { return tmpDir, nil - }, secrets.NoopStore{}, "") + }) cfg := &config.CLIConfig{ Token: token, @@ -45,9 +44,9 @@ func CreateExpiredTestConfigManager(t *testing.T, token, host, user string) *con tmpDir := t.TempDir() fs := adapters.NewOSFileSystem() - mgr := config.NewManagerWithSecrets(fs, func() (string, error) { + mgr := config.NewManager(fs, func() (string, error) { return tmpDir, nil - }, secrets.NoopStore{}, "") + }) cfg := &config.CLIConfig{ Token: token, diff --git a/internal/vcs/remote_resolver.go b/internal/vcs/remote_resolver.go index 73d85a04..927f37ac 100644 --- a/internal/vcs/remote_resolver.go +++ b/internal/vcs/remote_resolver.go @@ -18,7 +18,6 @@ type RemoteData struct { func ResolveRemote(repoArg string) (*RemoteData, error) { var remote RemoteData - // If the user supplied a --repo flag with the repo URL if repoArg != "" { debug.Log("remote: using --repo flag %q", repoArg) repoData, err := RepoArgumentResolver(repoArg) @@ -32,8 +31,6 @@ func ResolveRemote(repoArg string) (*RemoteData, error) { return &remote, nil } - // If the user didn't pass --repo flag - // Figure out list of remotes by reading git config debug.Log("remote: auto-detecting from git remotes") remotesData, err := ListRemotes() if err != nil { @@ -43,12 +40,10 @@ func ResolveRemote(repoArg string) (*RemoteData, error) { return nil, err } - // If no supported VCS remotes were found if len(remotesData) == 0 { return nil, fmt.Errorf("No supported VCS remotes found. Use --repo flag to specify the repository manually") } - // If there is only one remote, use it if len(remotesData) == 1 { for _, value := range remotesData { remote.Owner = value[0] @@ -59,10 +54,7 @@ func ResolveRemote(repoArg string) (*RemoteData, error) { return &remote, nil } - // If there are more than one remotes, give the option to user - // to select the one which they want var promptOpts []string - // Preparing the options to show to the user for _, value := range remotesData { promptOpts = append(promptOpts, value[3]) } @@ -72,7 +64,6 @@ func ResolveRemote(repoArg string) (*RemoteData, error) { return nil, err } - // Matching the list of remotes with the one selected by user for _, value := range remotesData { if value[3] == selectedRemote { remote.Owner = value[0] @@ -83,10 +74,7 @@ func ResolveRemote(repoArg string) (*RemoteData, error) { return &remote, nil } -// Utility to parse the --repo flag func RepoArgumentResolver(arg string) ([]string, error) { - // github.com/deepsourcelabs/cli or gh/deepsourcelabs/cli - argComponents := strings.Split(arg, "/") switch argComponents[0] { diff --git a/internal/vcs/remotes.go b/internal/vcs/remotes.go index deb6eaec..b72c7264 100644 --- a/internal/vcs/remotes.go +++ b/internal/vcs/remotes.go @@ -106,15 +106,6 @@ func getRemoteMap(remoteList []string) (map[string][]string, error) { return remoteMap, nil } -// 1. Run git remote -v -// 2. Parse the output and get the list of remotes -// 3. Do git config --get --local remote..url -// 4. Parse the urls to filter out reponame,owner,provider -// 5. Send them back - -// Returns a map of remotes to their urls -// { "origin":["reponame","owner","provider"]} -// { "upstream":["reponame","owner","provider"]} func ListRemotes() (map[string][]string, error) { remoteMap := make(map[string][]string) @@ -123,17 +114,14 @@ func ListRemotes() (map[string][]string, error) { return remoteMap, err } - // Split the remotes into single remote array remoteList := strings.Split(string(remotes), "\n") if len(remoteList) <= 1 { return remoteMap, fmt.Errorf("No remotes found") } - // Removing the last blank element remoteList = remoteList[:len(remoteList)-1] - // Get remote map remoteMap, err = getRemoteMap(remoteList) if err != nil { return remoteMap, err diff --git a/introspection.json b/introspection.json deleted file mode 100644 index 65413cc4..00000000 --- a/introspection.json +++ /dev/null @@ -1,14421 +0,0 @@ -{ - "data": { - "__schema": { - "queryType": { - "name": "Query" - }, - "mutationType": { - "name": "Mutation" - }, - "subscriptionType": null, - "types": [ - { - "kind": "OBJECT", - "name": "ComplianceReport", - "description": null, - "fields": [ - { - "name": "key", - "description": "The key of the report.", - "args": [], - "type": { - "kind": "ENUM", - "name": "ReportKey", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "title", - "description": "The title of the report.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "currentValue", - "description": "The current value of the report.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "status", - "description": "The status of the report.", - "args": [], - "type": { - "kind": "ENUM", - "name": "ReportStatus", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "historicalValues", - "description": "The historical values for this report.", - "args": [ - { - "name": "startDate", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Date", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "endDate", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Date", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "HistoricalValueItem", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "trends", - "description": "The trends associated with this report.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Trend", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "complianceIssueStats", - "description": "The compliance issue stats associated with this report.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "ComplianceIssueStat", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "Report", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INTERFACE", - "name": "Report", - "description": null, - "fields": [ - { - "name": "key", - "description": "The key of the report.", - "args": [], - "type": { - "kind": "ENUM", - "name": "ReportKey", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "title", - "description": "The title of the report.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "currentValue", - "description": "The current value of the report.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "status", - "description": "The status of the report.", - "args": [], - "type": { - "kind": "ENUM", - "name": "ReportStatus", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "historicalValues", - "description": "The historical values for this report.", - "args": [ - { - "name": "startDate", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Date", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "endDate", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Date", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "HistoricalValueItem", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "trends", - "description": "The trends associated with this report.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Trend", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": [ - { - "kind": "OBJECT", - "name": "ComplianceReport", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "InsightReport", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "IssueDistributionReport", - "ofType": null - } - ] - }, - { - "kind": "ENUM", - "name": "ReportKey", - "description": "All possible report keys.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "OWASP_TOP_10", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SANS_TOP_25", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "MISRA_C", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "CODE_COVERAGE", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "CODE_HEALTH_TREND", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ISSUE_DISTRIBUTION", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ISSUES_PREVENTED", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ISSUES_AUTOFIXED", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "String", - "description": "The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "Int", - "description": "The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "ReportStatus", - "description": "The different statuses possible for a report.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "PASSING", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FAILING", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "NOOP", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "HistoricalValueItem", - "description": null, - "fields": [ - { - "name": "date", - "description": "The date of the historical value.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Date", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "values", - "description": "The values associated with this item.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "HistoricalValue", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "Date", - "description": "The `Date` scalar type represents a Date\nvalue as specified by\n[iso8601](https://en.wikipedia.org/wiki/ISO_8601).", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "HistoricalValue", - "description": null, - "fields": [ - { - "name": "key", - "description": "The key associated with the value.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "value", - "description": "The value.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Trend", - "description": "Represents a trend for a report.", - "fields": [ - { - "name": "label", - "description": "The label associated with the trend.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "value", - "description": "The value of the trend.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "rate", - "description": "The percentage change in the trend.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Float", - "ofType": null - }, - "isDeprecated": true, - "deprecationReason": "Deprecated in favor of `changePercentage`." - }, - { - "name": "changePercentage", - "description": "The percentage change in the trend.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Float", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "Float", - "description": "The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "ComplianceIssueStat", - "description": null, - "fields": [ - { - "name": "key", - "description": "The key for this stat.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "title", - "description": "The title for this stat.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "occurrence", - "description": "The occurrence count of the compliance issue.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "ComplianceIssueOccurrenceCount", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "ComplianceIssueOccurrenceCount", - "description": null, - "fields": [ - { - "name": "critical", - "description": "The count of critical severity issues.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "major", - "description": "The count of major severity issues.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "minor", - "description": "The count of minor severity issues.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "total", - "description": "The total count of issues.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "InsightReport", - "description": null, - "fields": [ - { - "name": "key", - "description": "The key of the report.", - "args": [], - "type": { - "kind": "ENUM", - "name": "ReportKey", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "title", - "description": "The title of the report.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "currentValue", - "description": "The current value of the report.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "status", - "description": "The status of the report.", - "args": [], - "type": { - "kind": "ENUM", - "name": "ReportStatus", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "historicalValues", - "description": "The historical values for this report.", - "args": [ - { - "name": "startDate", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Date", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "endDate", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Date", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "HistoricalValueItem", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "trends", - "description": "The trends associated with this report.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Trend", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "Report", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Issue", - "description": null, - "fields": [ - { - "name": "shortcode", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "title", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "analyzer", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Analyzer", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "autofixAvailable", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "autofixAiAvailable", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isRecommended", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "id", - "description": "The ID of the object", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "category", - "description": "Category of the issue.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "IssueCategory", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "severity", - "description": "Severity of the issue.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "IssueSeverity", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": "The description of the issue in markdown.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "shortDescription", - "description": "A short description of the issue.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "tags", - "description": "A list of tags associated with the issue.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "MaskPrimaryKeyNode", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INTERFACE", - "name": "MaskPrimaryKeyNode", - "description": "Custom node class to prevent leaking primary keys as integers", - "fields": [ - { - "name": "id", - "description": "The ID of the object", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": [ - { - "kind": "OBJECT", - "name": "Issue", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "Analyzer", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "Metric", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "User", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "Account", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "CodeCoverageReportRepository", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "Repository", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "AnalysisRun", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "Check", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "Occurrence", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "RepositoryMetricItem", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "MetricValue", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "RepositoryIssue", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "VulnerabilityOccurrence", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "Vulnerability", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "Package", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "PackageVersion", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "RepositoryTarget", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "IgnoreRule", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "TeamMember", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "TeamSuppressedIssue", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "Transformer", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "Installation", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "CodeFormatter", - "ofType": null - } - ] - }, - { - "kind": "SCALAR", - "name": "ID", - "description": "The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `\"4\"`) or integer (such as `4`) input value will be accepted as an ID.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Analyzer", - "description": "A DeepSource Analyzer.", - "fields": [ - { - "name": "version", - "description": "Version of the image used for this analyzer.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "shortcode", - "description": "Unique identifier for this analyzer globally.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "Human-friendly name for this analyzer.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": "Verbose description, written in Markdown.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "metaSchema", - "description": "Schema of the meta fields accepted by the analyzer in .deepsource.toml.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "JSONString", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "exampleConfig", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "id", - "description": "The ID of the object", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "logo", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "numIssues", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "issues", - "description": null, - "args": [ - { - "name": "offset", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "before", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "after", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "first", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "last", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "IssueConnection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "issue", - "description": "Get a specific issue by its shortcode.", - "args": [ - { - "name": "shortcode", - "description": "Shortcode of the issue.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Issue", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "issueDistribution", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "IssueDistributionItem", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": null, - "args": [], - "type": { - "kind": "ENUM", - "name": "AnalyzerType", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "MaskPrimaryKeyNode", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "JSONString", - "description": "Allows use of a JSON String for input / output from the GraphQL schema.\n\nUse of this type is *not recommended* as you lose the benefits of having a defined, static\nschema (one of the key benefits of GraphQL).", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "IssueConnection", - "description": null, - "fields": [ - { - "name": "pageInfo", - "description": "Pagination data for this connection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PageInfo", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "edges", - "description": "Contains the nodes in this connection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "IssueEdge", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "totalCount", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "PageInfo", - "description": "The Relay compliant `PageInfo` type, containing data necessary to paginate this connection.", - "fields": [ - { - "name": "hasNextPage", - "description": "When paginating forwards, are there more items?", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "hasPreviousPage", - "description": "When paginating backwards, are there more items?", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "startCursor", - "description": "When paginating backwards, the cursor to continue.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "endCursor", - "description": "When paginating forwards, the cursor to continue.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "Boolean", - "description": "The `Boolean` scalar type represents `true` or `false`.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "IssueEdge", - "description": "A Relay edge containing a `Issue` and its cursor.", - "fields": [ - { - "name": "node", - "description": "The item at the end of the edge", - "args": [], - "type": { - "kind": "OBJECT", - "name": "Issue", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "cursor", - "description": "A cursor for use in pagination", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "IssueDistributionItem", - "description": null, - "fields": [ - { - "name": "category", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "IssueCategory", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "title", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "count", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "IssueCategory", - "description": "An enumeration.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "ANTI_PATTERN", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "BUG_RISK", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "PERFORMANCE", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SECURITY", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "COVERAGE", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "TYPECHECK", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "STYLE", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "DOCUMENTATION", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SECRETS", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "AnalyzerType", - "description": "An enumeration.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "CORE", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "COMMUNITY", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "CUSTOM", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "IssueSeverity", - "description": "An enumeration.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "CRITICAL", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "MAJOR", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "MINOR", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "IssueDistributionReport", - "description": null, - "fields": [ - { - "name": "key", - "description": "The key of the report.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "ReportKey", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "title", - "description": "The title of the report.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "currentValue", - "description": "The current value of the report.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "status", - "description": "The status of the report.", - "args": [], - "type": { - "kind": "ENUM", - "name": "ReportStatus", - "ofType": null - }, - "isDeprecated": true, - "deprecationReason": "Report doesn't have a status." - }, - { - "name": "historicalValues", - "description": "The historical values for this report.", - "args": [ - { - "name": "startDate", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Date", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "endDate", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Date", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "HistoricalValueItem", - "ofType": null - } - }, - "isDeprecated": true, - "deprecationReason": "Deprecated in favor of `values`." - }, - { - "name": "trends", - "description": "The trends associated with this report.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Trend", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "values", - "description": "The report values for this report.", - "args": [ - { - "name": "startDate", - "description": "The start date to get the report values.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Date", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "endDate", - "description": "The start date to get the report values.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Date", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "ReportValueItem", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "issueDistributionByAnalyzer", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "IssueDistribution", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "issueDistributionByCategory", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "IssueDistribution", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "Report", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "ReportValueItem", - "description": "Represents the values recorded on a specific date.", - "fields": [ - { - "name": "date", - "description": "The date when the values were recorded.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Date", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "values", - "description": "The values recorded on the given date.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "ReportValue", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "ReportValue", - "description": "Represents a value recorded for a report.", - "fields": [ - { - "name": "key", - "description": "The key associated with the value.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "value", - "description": "The value.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "IssueDistribution", - "description": null, - "fields": [ - { - "name": "key", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "value", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Metric", - "description": "A metric tracked by an analyzer.", - "fields": [ - { - "name": "id", - "description": "The ID of the object", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "The metric's name.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "shortcode", - "description": "The metric's unique identifier.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "MetricShortcode", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": "The metric's description in markdown format.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "positiveDirection", - "description": "Direction which can be considered positive for the metric.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "Direction", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "unit", - "description": "Unit suffix to apply to the metric value.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "minValueAllowed", - "description": "Lower bound for the metric value.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "maxValueAllowed", - "description": "Upper bound for the metric value.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "MaskPrimaryKeyNode", - "ofType": null - }, - { - "kind": "INTERFACE", - "name": "MetricDefinition", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INTERFACE", - "name": "MetricDefinition", - "description": "A metric's definition.", - "fields": [ - { - "name": "name", - "description": "The metric's name.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "shortcode", - "description": "The metric's unique identifier.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "MetricShortcode", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": "The metric's description in markdown format.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "positiveDirection", - "description": "Direction which can be considered positive for the metric.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "Direction", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "unit", - "description": "Unit suffix to apply to the metric value.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "minValueAllowed", - "description": "Lower bound for the metric value.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "maxValueAllowed", - "description": "Upper bound for the metric value.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": [ - { - "kind": "OBJECT", - "name": "Metric", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "RepositoryMetric", - "ofType": null - } - ] - }, - { - "kind": "ENUM", - "name": "MetricShortcode", - "description": "Represents the various metric types.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "BCV", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "CCV", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "DCV", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "DDP", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "LCV", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "CPCV", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "NLCV", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "NBCV", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "NCCV", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "NCPCV", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "Direction", - "description": "Represents the direction of a value.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "UPWARD", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "DOWNWARD", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "ChangesetStats", - "description": "Statistics pertaining to the changeset (of a commit or PR), as analyzed by an `AnalysisRun`.", - "fields": [ - { - "name": "lines", - "description": "Stats for number of lines in the changeset.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "ChangesetStatsCounts", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "branches", - "description": "Stats for number of branches in the changeset.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "ChangesetStatsCounts", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "conditions", - "description": "Stats for number of conditions in the changeset.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "ChangesetStatsCounts", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "ChangesetStatsCounts", - "description": "Overall and newly added number of lines (or branches or conditions) in a changeset.", - "fields": [ - { - "name": "overall", - "description": "\n Overall number of lines (or branches or conditions) across the repository.\n Note: `0` depicts no lines (or branches or conditions) were found whereas `None` depicts the information is not available.\n ", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "overallCovered", - "description": "\n Overall number of lines (or branches or conditions) that are covered across the repository.\",\n Note: `0` depicts no lines (or branches or conditions) were found whereas `None` depicts the information is not available.\n ", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "new", - "description": "Newly added number of lines (or branches or conditions) in the changeset.\nNote: `0` depicts no lines (or branches or conditions) were found whereas `None` depicts the information is not available.\n ", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "newCovered", - "description": "\n Newly added number of lines (or branches or conditions) that are covered in the changeset.\n Note: `0` depicts no lines (or branches or conditions) were found whereas `None` depicts the information is not available.\n ", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Query", - "description": null, - "fields": [ - { - "name": "viewer", - "description": "The currently authenticated user.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "User", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "transformer", - "description": "Lookup a transformer by its shortcode.", - "args": [ - { - "name": "shortcode", - "description": "Shortcode of the transformer.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Transformer", - "ofType": null - }, - "isDeprecated": true, - "deprecationReason": "Use `codeFormatter` instead" - }, - { - "name": "transformers", - "description": "List all transformers with optional filtering.", - "args": [ - { - "name": "offset", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "before", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "after", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "first", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "last", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "name_Icontains", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "TransformerConnection", - "ofType": null - }, - "isDeprecated": true, - "deprecationReason": "Use `codeFormatters` instead" - }, - { - "name": "repository", - "description": "Lookup a repository on DeepSource using it's name and VCS provider.", - "args": [ - { - "name": "name", - "description": "The name of the repository to lookup.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "login", - "description": "The login or username of the account under which the repository exists.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "vcsProvider", - "description": "VCS Provider of the repository.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "VCSProvider", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Repository", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "installation", - "description": "The DeepSource installation.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "Installation", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "codeFormatter", - "description": "Lookup a code formatter by its shortcode.", - "args": [ - { - "name": "shortcode", - "description": "Shortcode of the code formatter.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "CodeFormatter", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "codeFormatters", - "description": "List all code formatters with optional filtering.", - "args": [ - { - "name": "offset", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "before", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "after", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "first", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "last", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "name_Icontains", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "CodeFormatterConnection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "analyzer", - "description": "Get an analyzer from its shortcode.", - "args": [ - { - "name": "shortcode", - "description": "Shortcode of the analyzer you'd like to get.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Analyzer", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "analyzers", - "description": "Get all analyzers available on DeepSource.", - "args": [ - { - "name": "offset", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "before", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "after", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "first", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "last", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "AnalyzerConnection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "run", - "description": "Fetch an AnalysisRun object from it's UID or commit OID.", - "args": [ - { - "name": "runUid", - "description": "UID of the Analysis Run you want to get.", - "type": { - "kind": "SCALAR", - "name": "UUID", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "commitOid", - "description": "Commit OID of the Analysis Run you want to get.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "AnalysisRun", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "account", - "description": "An account on DeepSource (individual or team). A user can add multiple accounts from multiple VCS providers.", - "args": [ - { - "name": "login", - "description": "The login or username to lookup the account by.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "vcsProvider", - "description": "VCS Provider of the account.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "VCSProvider", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Account", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "node", - "description": null, - "args": [ - { - "name": "id", - "description": "The ID of the object", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "INTERFACE", - "name": "MaskPrimaryKeyNode", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "User", - "description": null, - "fields": [ - { - "name": "firstName", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "lastName", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "email", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "id", - "description": "The ID of the object", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "accounts", - "description": "All the accounts associated with the user. This includes the team accounts the user is part of and the individual accounts they have added on DeepSource.", - "args": [ - { - "name": "offset", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "before", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "after", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "first", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "last", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "AccountConnection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "analyticsId", - "description": "The anonymous ID used for analytics and tracking.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isBetaTester", - "description": "Whether the user is a beta tester.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ideSubscription", - "description": "The IDE subscription associated with the user.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "IDESubscription", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "MaskPrimaryKeyNode", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "AccountConnection", - "description": null, - "fields": [ - { - "name": "pageInfo", - "description": "Pagination data for this connection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PageInfo", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "edges", - "description": "Contains the nodes in this connection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "AccountEdge", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "totalCount", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "AccountEdge", - "description": "A Relay edge containing a `Account` and its cursor.", - "fields": [ - { - "name": "node", - "description": "The item at the end of the edge", - "args": [], - "type": { - "kind": "OBJECT", - "name": "Account", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "cursor", - "description": "A cursor for use in pagination", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Account", - "description": null, - "fields": [ - { - "name": "id", - "description": "The ID of the object", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "login", - "description": "The unique identifier (or username) of the account.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": "The account type (individual or team).", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "AccountType", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "vcsProvider", - "description": "VCS Provider of the account.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "VCSProvider", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isBetaTester", - "description": "Whether the account is a beta tester", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "avatarUrl", - "description": "URL for the account's public avatar.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "report", - "description": "Get a report associated with this account", - "args": [ - { - "name": "key", - "description": "Get the report associated with the report key", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "ReportKey", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INTERFACE", - "name": "Report", - "ofType": null - } - }, - "isDeprecated": true, - "deprecationReason": "Deprecated in favor of `reports`." - }, - { - "name": "reports", - "description": "Namespace containing all available reports.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "AccountReportsNamespace", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "vcsUrl", - "description": "URL for the account on the VCS Provider.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "repositories", - "description": "Get all repositories accessible to the current user under the given account.", - "args": [ - { - "name": "offset", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "before", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "after", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "first", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "last", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "RepositoryConnection", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "members", - "description": "Members of the team. This is an empty list for an individual account.", - "args": [ - { - "name": "offset", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "before", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "after", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "first", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "last", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "TeamMemberConnection", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "subscription", - "description": "Subscription and billing details of the account.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "AccountSubscription", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "suppressedIssues", - "description": "Suppressed issues on the account/team.", - "args": [ - { - "name": "offset", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "before", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "after", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "first", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "last", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "issueShortcode", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "TeamSuppressedIssueConnection", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "MaskPrimaryKeyNode", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "AccountType", - "description": null, - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "INDIVIDUAL", - "description": "A individual account.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "TEAM", - "description": "A team account.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "VCSProvider", - "description": "An enumeration.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "GITHUB", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "GITLAB", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "BITBUCKET", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "BITBUCKET_DATACENTER", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "GITHUB_ENTERPRISE", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "GSR", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ADS", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "AccountReportsNamespace", - "description": "Namespace containing all the reports available for an `Account`", - "fields": [ - { - "name": "owaspTop10", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "OwaspTop10Report", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "sansTop25", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "SansTop25Report", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "misraC", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "MisraCReport", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "codeCoverage", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "CodeCoverageReport", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "codeHealthTrend", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "CodeHealthTrendReport", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "issueDistribution", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "IssueDistributionReport", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "issuesPrevented", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "IssuesPreventedReport", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "issuesAutofixed", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "IssuesAutofixedReport", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "OwaspTop10Report", - "description": "The OWASP Top 10 report.", - "fields": [ - { - "name": "key", - "description": "The key of the report.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "ReportKey", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "title", - "description": "The title of the report.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "currentValue", - "description": "The current value of the report.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "values", - "description": "The report values for this report.", - "args": [ - { - "name": "startDate", - "description": "The start date to get the report values.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Date", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "endDate", - "description": "The start date to get the report values.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Date", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "ReportValueItem", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "trends", - "description": "The trends associated with this report.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Trend", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "status", - "description": "The status of the report.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "ReportStatus", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "securityIssueStats", - "description": "The compliance issue stats associated with this report.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "SecurityIssueStat", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "SecurityIssueStat", - "description": null, - "fields": [ - { - "name": "key", - "description": "The key for this stat.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "title", - "description": "The title for this stat.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "occurrence", - "description": "The severity distribution for this stat.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "SeverityDistribution", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "SeverityDistribution", - "description": "Distribution of severity count.", - "fields": [ - { - "name": "critical", - "description": "The count of critical severity issues.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "major", - "description": "The count of major severity issues.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "minor", - "description": "The count of minor severity issues.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "total", - "description": "The total count of issues.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "SansTop25Report", - "description": "The SANS Top 25 report.", - "fields": [ - { - "name": "key", - "description": "The key of the report.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "ReportKey", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "title", - "description": "The title of the report.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "currentValue", - "description": "The current value of the report.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "values", - "description": "The report values for this report.", - "args": [ - { - "name": "startDate", - "description": "The start date to get the report values.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Date", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "endDate", - "description": "The start date to get the report values.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Date", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "ReportValueItem", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "trends", - "description": "The trends associated with this report.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Trend", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "status", - "description": "The status of the report.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "ReportStatus", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "securityIssueStats", - "description": "The compliance issue stats associated with this report.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "SecurityIssueStat", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "MisraCReport", - "description": "The MISRA-C report.", - "fields": [ - { - "name": "key", - "description": "The key of the report.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "ReportKey", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "title", - "description": "The title of the report.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "currentValue", - "description": "The current value of the report.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "values", - "description": "The report values for this report.", - "args": [ - { - "name": "startDate", - "description": "The start date to get the report values.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Date", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "endDate", - "description": "The start date to get the report values.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Date", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "ReportValueItem", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "trends", - "description": "The trends associated with this report.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Trend", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "status", - "description": "The status of the report.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "ReportStatus", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "securityIssueStats", - "description": "The compliance issue stats associated with this report.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "SecurityIssueStat", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CodeCoverageReport", - "description": "The Code Coverage report.", - "fields": [ - { - "name": "key", - "description": "The key of the report.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "ReportKey", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "title", - "description": "The title of the report.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "repositories", - "description": "The list of repositories.", - "args": [ - { - "name": "q", - "description": "The query string to search for repositories.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "sortKey", - "description": "The sort key to sort the repositories results by.", - "type": { - "kind": "ENUM", - "name": "CodeCoverageReportRepositorySortKey", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "offset", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "before", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "after", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "first", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "last", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "CodeCoverageReportRepositoryConnection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CodeCoverageReportRepositoryConnection", - "description": null, - "fields": [ - { - "name": "pageInfo", - "description": "Pagination data for this connection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PageInfo", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "edges", - "description": "Contains the nodes in this connection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "CodeCoverageReportRepositoryEdge", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "totalCount", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CodeCoverageReportRepositoryEdge", - "description": "A Relay edge containing a `CodeCoverageReportRepository` and its cursor.", - "fields": [ - { - "name": "node", - "description": "The item at the end of the edge", - "args": [], - "type": { - "kind": "OBJECT", - "name": "CodeCoverageReportRepository", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "cursor", - "description": "A cursor for use in pagination", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CodeCoverageReportRepository", - "description": "Representation of a `Repository` in the Code Coverage report.", - "fields": [ - { - "name": "name", - "description": "The name of this repository.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "id", - "description": "The ID of the object", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "lcvMetricValue", - "description": "The LCV metric value for this repository.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Float", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "bcvMetricValue", - "description": "The BCV metric value for this repository.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Float", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isLcvPassing", - "description": "Whether the LCV value is passing.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isBcvPassing", - "description": "Whether the BCV value is passing.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "MaskPrimaryKeyNode", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "CodeCoverageReportRepositorySortKey", - "description": "Possible options to sort the list of repositories in the Code Coverage report.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "LCV_ASCENDING", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "LCV_DESCENDING", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "BCV_ASCENDING", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "BCV_DESCENDING", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CodeHealthTrendReport", - "description": "The Code Health Trend report.", - "fields": [ - { - "name": "key", - "description": "The key of the report.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "ReportKey", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "title", - "description": "The title of the report.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "currentValue", - "description": "The current value of the report.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "values", - "description": "The report values for this report.", - "args": [ - { - "name": "startDate", - "description": "The start date to get the report values.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Date", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "endDate", - "description": "The start date to get the report values.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Date", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "ReportValueItem", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "trends", - "description": "The trends associated with this report.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Trend", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "IssuesPreventedReport", - "description": "The Issues Prevented report.", - "fields": [ - { - "name": "key", - "description": "The key of the report.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "ReportKey", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "title", - "description": "The title of the report.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "currentValue", - "description": "The current value of the report.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "values", - "description": "The report values for this report.", - "args": [ - { - "name": "startDate", - "description": "The start date to get the report values.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Date", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "endDate", - "description": "The start date to get the report values.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Date", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "ReportValueItem", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "trends", - "description": "The trends associated with this report.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Trend", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "IssuesAutofixedReport", - "description": "The Issues Autofixed report.", - "fields": [ - { - "name": "key", - "description": "The key of the report.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "ReportKey", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "title", - "description": "The title of the report.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "currentValue", - "description": "The current value of the report.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "values", - "description": "The report values for this report.", - "args": [ - { - "name": "startDate", - "description": "The start date to get the report values.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Date", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "endDate", - "description": "The start date to get the report values.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Date", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "ReportValueItem", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "trends", - "description": "The trends associated with this report.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Trend", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "RepositoryConnection", - "description": null, - "fields": [ - { - "name": "pageInfo", - "description": "Pagination data for this connection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PageInfo", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "edges", - "description": "Contains the nodes in this connection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "RepositoryEdge", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "totalCount", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "RepositoryEdge", - "description": "A Relay edge containing a `Repository` and its cursor.", - "fields": [ - { - "name": "node", - "description": "The item at the end of the edge", - "args": [], - "type": { - "kind": "OBJECT", - "name": "Repository", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "cursor", - "description": "A cursor for use in pagination", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Repository", - "description": null, - "fields": [ - { - "name": "name", - "description": "The name of this repository.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "latestCommitOid", - "description": "Object ID of the latest commit on the default branch.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isPrivate", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isActivated", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "id", - "description": "The ID of the object", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "account", - "description": "The account under which this repository exists.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Account", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "analysisRuns", - "description": "Past analysis runs for the repository", - "args": [ - { - "name": "offset", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "before", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "after", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "first", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "last", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "AnalysisRunConnection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "configJson", - "description": "The `.deepsource.toml` config of the repository represented as a JSON object.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "JSON", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "defaultBranch", - "description": "The default base branch of the repository on DeepSource.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "dsn", - "description": "The DSN for this repository.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "enabledAnalyzers", - "description": "Get all the analyzers enabled in this repository.", - "args": [ - { - "name": "offset", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "before", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "after", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "first", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "last", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "AnalyzerConnection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "issues", - "description": "Get all issues raised in the default branch of this repository. Specifying a path would only return those issues whose occurrences are present in the file at path.", - "args": [ - { - "name": "path", - "description": "Show issues for this path only.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "offset", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "before", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "after", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "first", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "last", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "tags", - "description": null, - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "analyzerIn", - "description": null, - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "RepositoryIssueConnection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "issueOccurrences", - "description": "All issue occurrences in the default branch.", - "args": [ - { - "name": "offset", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "before", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "after", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "first", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "last", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "analyzerIn", - "description": null, - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "OccurrenceConnection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "dependencyVulnerabilityOccurrences", - "description": "List of dependency vulnerability occurrences in the default branch.", - "args": [ - { - "name": "offset", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "before", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "after", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "first", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "last", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "VulnerabilityOccurrenceConnection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "dependencyVulnerabilityOccurrence", - "description": "Get a dependency vulnerability occurrence by its ID.", - "args": [ - { - "name": "id", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "VulnerabilityOccurrence", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "target", - "description": "Get a specific repository target.", - "args": [ - { - "name": "id", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "RepositoryTarget", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "targets", - "description": "List of repository targets for this repository.", - "args": [ - { - "name": "offset", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "before", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "after", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "first", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "last", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "RepositoryTargetConnection", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "report", - "description": "Get a report associated with this repository", - "args": [ - { - "name": "key", - "description": "Get the report associated with the report key", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "ReportKey", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INTERFACE", - "name": "Report", - "ofType": null - } - }, - "isDeprecated": true, - "deprecationReason": "Deprecated in favor of `reports`." - }, - { - "name": "reports", - "description": "Namespace containing all available reports.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "RepositoryReportsNamespace", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "vcsProvider", - "description": "VCS Provider of the repository.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "VCSProvider", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "vcsUrl", - "description": "URL of the repository on the VCS.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "metrics", - "description": "List of all DeepSource metrics.", - "args": [ - { - "name": "shortcodeIn", - "description": "List of metric shortcodes to filter on.", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "MetricShortcode", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "RepositoryMetric", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ignoreRules", - "description": "List of `IgnoreRule`s that exist for the repository.", - "args": [ - { - "name": "offset", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "before", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "after", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "first", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "last", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "issueShortcode", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "filePath", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "IgnoreRuleConnection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "issueCategorySettings", - "description": "Issue categories configuration for the repository.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "IssueCategorySetting", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "issuePrioritySettings", - "description": "Issue priority configuration for the repository.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "IssuePrioritySetting", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "metricSettings", - "description": "Metric settings for the repository.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "MetricSetting", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "allowAutofixAi", - "description": "Whether the account has allowed Autofix AI to run on private repositories.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "useLegacyAutofix", - "description": "Whether to use the legacy autofix engine.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "MaskPrimaryKeyNode", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "AnalysisRunConnection", - "description": null, - "fields": [ - { - "name": "pageInfo", - "description": "Pagination data for this connection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PageInfo", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "edges", - "description": "Contains the nodes in this connection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "AnalysisRunEdge", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "totalCount", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "AnalysisRunEdge", - "description": "A Relay edge containing a `AnalysisRun` and its cursor.", - "fields": [ - { - "name": "node", - "description": "The item at the end of the edge", - "args": [], - "type": { - "kind": "OBJECT", - "name": "AnalysisRun", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "cursor", - "description": "A cursor for use in pagination", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "AnalysisRun", - "description": null, - "fields": [ - { - "name": "createdAt", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "branchName", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "baseOid", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "commitOid", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "finishedAt", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "repository", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Repository", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "id", - "description": "The ID of the object", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "runUid", - "description": "UID of this AnalysisRun.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "UUID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "status", - "description": "The current status of the run.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "AnalysisRunStatus", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "summary", - "description": "Summary of the analysis run", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "AnalysisRunSummary", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "updatedAt", - "description": "Time when the analysis run was last modified", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "checks", - "description": "Analyzer checks in the analysis run.", - "args": [ - { - "name": "offset", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "before", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "after", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "first", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "last", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "analyzerIn", - "description": null, - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "CheckConnection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "changesetStats", - "description": "Statistics pertaining to the changeset (of a commit or PR) in the analysis run.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "ChangesetStats", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "MaskPrimaryKeyNode", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "DateTime", - "description": "The `DateTime` scalar type represents a DateTime\nvalue as specified by\n[iso8601](https://en.wikipedia.org/wiki/ISO_8601).", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "UUID", - "description": "Leverages the internal Python implementation of UUID (uuid.UUID) to provide native UUID objects\nin fields, resolvers and input.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "AnalysisRunStatus", - "description": "An enumeration.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "PENDING", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SUCCESS", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FAILURE", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "TIMEOUT", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "CANCEL", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "READY", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SKIPPED", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "AnalysisRunSummary", - "description": null, - "fields": [ - { - "name": "occurrencesIntroduced", - "description": "Number of issues introduced during this analysis run", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "occurrencesResolved", - "description": "Number of issues marked as resolved in this analysis run", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "occurrencesSuppressed", - "description": "Number of issues marked as suppressed in this analysis run", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "occurrenceDistributionByAnalyzer", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "OccurrenceDistributionByAnalyzer", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "occurrenceDistributionByCategory", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "OccurrenceDistributionByCategory", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "OccurrenceDistributionByAnalyzer", - "description": null, - "fields": [ - { - "name": "analyzerShortcode", - "description": "Shortcode of the analyzer", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "introduced", - "description": "Number of issues detected by the analyzer", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "OccurrenceDistributionByCategory", - "description": null, - "fields": [ - { - "name": "category", - "description": "Category of the issue", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "IssueCategory", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "introduced", - "description": "Number of issues detected that belong to this category", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CheckConnection", - "description": null, - "fields": [ - { - "name": "pageInfo", - "description": "Pagination data for this connection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PageInfo", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "edges", - "description": "Contains the nodes in this connection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "CheckEdge", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "totalCount", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CheckEdge", - "description": "A Relay edge containing a `Check` and its cursor.", - "fields": [ - { - "name": "node", - "description": "The item at the end of the edge", - "args": [], - "type": { - "kind": "OBJECT", - "name": "Check", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "cursor", - "description": "A cursor for use in pagination", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Check", - "description": "A single analyzer check as part of an analysis run.", - "fields": [ - { - "name": "id", - "description": "The ID of the object", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "sequence", - "description": "Sequence number of the check in the analysis run it belongs to.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "status", - "description": "The current status of the check.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "CheckStatus", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "analyzer", - "description": "The analyzer related to the check.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Analyzer", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "createdAt", - "description": "Time when the check was created.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "updatedAt", - "description": "Time when the check was last modified.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "finishedAt", - "description": "Time when the check finished.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "summary", - "description": "Summary of the check.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "CheckSummary", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "occurrences", - "description": "Issue occurrences found in the check.", - "args": [ - { - "name": "offset", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "before", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "after", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "first", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "last", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "analyzerIn", - "description": null, - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "OccurrenceConnection", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "metrics", - "description": "List of DeepSource metrics captured in the check.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "RepositoryMetric", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "MaskPrimaryKeyNode", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "CheckStatus", - "description": "An enumeration.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "WAITING", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "PENDING", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SUCCESS", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FAILURE", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "TIMEOUT", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "CANCEL", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "READY", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "NEUTRAL", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ARTIFACT_TIMEOUT", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SKIPPED", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CheckSummary", - "description": "Summary of a check.", - "fields": [ - { - "name": "occurrencesIntroduced", - "description": "Number of issues introduced in the check.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "occurrencesResolved", - "description": "Number of issues resolved in the check.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "occurrencesSuppressed", - "description": "Number of issues marked as suppressed in the check.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "occurrenceDistributionByCategory", - "description": "The issue category distribution for the check.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "OccurrenceDistributionByCategory", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "OccurrenceConnection", - "description": null, - "fields": [ - { - "name": "pageInfo", - "description": "Pagination data for this connection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PageInfo", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "edges", - "description": "Contains the nodes in this connection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "OccurrenceEdge", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "totalCount", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "OccurrenceEdge", - "description": "A Relay edge containing a `Occurrence` and its cursor.", - "fields": [ - { - "name": "node", - "description": "The item at the end of the edge", - "args": [], - "type": { - "kind": "OBJECT", - "name": "Occurrence", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "cursor", - "description": "A cursor for use in pagination", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Occurrence", - "description": null, - "fields": [ - { - "name": "path", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "beginLine", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "beginColumn", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "endLine", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "endColumn", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "id", - "description": "The ID of the object", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "issue", - "description": "The definition of the issue which has been raised.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Issue", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "title", - "description": "Title describing the issue which has been raised here.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "MaskPrimaryKeyNode", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "RepositoryMetric", - "description": "A Metric's manifestation specific to a repository.", - "fields": [ - { - "name": "name", - "description": "The metric's name.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "shortcode", - "description": "The metric's unique identifier.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "MetricShortcode", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": "The metric's description in markdown format.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "positiveDirection", - "description": "Direction which can be considered positive for the metric.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "Direction", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "unit", - "description": "Unit suffix to apply to the metric value.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "minValueAllowed", - "description": "Lower bound for the metric value.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "maxValueAllowed", - "description": "Upper bound for the metric value.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isReported", - "description": "Whether this metric is enabled for reporting in the repository.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isThresholdEnforced", - "description": "Whether to fail checks when thresholds are not met for the metric in the repository.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "items", - "description": "Items in the repository metric.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "RepositoryMetricItem", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "MetricDefinition", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "RepositoryMetricItem", - "description": "An item in the `RepositoryMetric`.", - "fields": [ - { - "name": "id", - "description": "The ID of the object", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "key", - "description": "Distinct key representing the metric in the repository.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "MetricKey", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "threshold", - "description": "Threshold value for the metric, customizable by the user. Null if no threshold is set.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "latestValue", - "description": "Latest value captured for this metric on the repository's default branch.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Float", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "latestValueDisplay", - "description": "Latest value captured for this metric on the repository's default branch. Suffixed with the unit and returned as a human-readable string.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "thresholdStatus", - "description": "The status of the threshold condition for the latest metric value on the repository's default branch.", - "args": [], - "type": { - "kind": "ENUM", - "name": "MetricThresholdStatus", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "values", - "description": "All values captured for this metric in the repository's default branch.", - "args": [ - { - "name": "offset", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "before", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "after", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "first", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "last", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "commitOidIn", - "description": null, - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "MetricValueConnection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "MaskPrimaryKeyNode", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "MetricKey", - "description": "Represents the key for which the metric is recorded in a repository.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "AGGREGATE", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "C_AND_CPP", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "CSHARP", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "GO", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "JAVA", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "JAVASCRIPT", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "PHP", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "PYTHON", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "RUBY", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "RUST", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SCALA", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "KOTLIN", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SWIFT", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "MetricThresholdStatus", - "description": "Represents the status of the threshold condition for a particular metric value.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "PASSING", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FAILING", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "MetricValueConnection", - "description": null, - "fields": [ - { - "name": "pageInfo", - "description": "Pagination data for this connection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PageInfo", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "edges", - "description": "Contains the nodes in this connection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "MetricValueEdge", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "totalCount", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "MetricValueEdge", - "description": "A Relay edge containing a `MetricValue` and its cursor.", - "fields": [ - { - "name": "node", - "description": "The item at the end of the edge", - "args": [], - "type": { - "kind": "OBJECT", - "name": "MetricValue", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "cursor", - "description": "A cursor for use in pagination", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "MetricValue", - "description": "An individual value captured for a RepositoryMetric.", - "fields": [ - { - "name": "id", - "description": "The ID of the object", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "value", - "description": "Metric value reported by the analyzer.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Float", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "valueDisplay", - "description": "Value suffixed with the unit of the metric.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "threshold", - "description": "Threshold value for the metric when this value was reported. Null if no threshold was set.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "thresholdStatus", - "description": "The status of the threshold condition for the metric value.", - "args": [], - "type": { - "kind": "ENUM", - "name": "MetricThresholdStatus", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "commitOid", - "description": "Commit SHA for which this value was recorded on the repository.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "createdAt", - "description": "The time at which the value was captured.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "MaskPrimaryKeyNode", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "JSON", - "description": "A JSON object.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "AnalyzerConnection", - "description": null, - "fields": [ - { - "name": "pageInfo", - "description": "Pagination data for this connection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PageInfo", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "edges", - "description": "Contains the nodes in this connection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "AnalyzerEdge", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "totalCount", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "AnalyzerEdge", - "description": "A Relay edge containing a `Analyzer` and its cursor.", - "fields": [ - { - "name": "node", - "description": "The item at the end of the edge", - "args": [], - "type": { - "kind": "OBJECT", - "name": "Analyzer", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "cursor", - "description": "A cursor for use in pagination", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "RepositoryIssueConnection", - "description": null, - "fields": [ - { - "name": "pageInfo", - "description": "Pagination data for this connection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PageInfo", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "edges", - "description": "Contains the nodes in this connection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "RepositoryIssueEdge", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "totalCount", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "RepositoryIssueEdge", - "description": "A Relay edge containing a `RepositoryIssue` and its cursor.", - "fields": [ - { - "name": "node", - "description": "The item at the end of the edge", - "args": [], - "type": { - "kind": "OBJECT", - "name": "RepositoryIssue", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "cursor", - "description": "A cursor for use in pagination", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "RepositoryIssue", - "description": null, - "fields": [ - { - "name": "id", - "description": "The ID of the object", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "issue", - "description": "Definition of the issue that has been raised.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Issue", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "occurrences", - "description": "All occurrences of this issue in the default branch.", - "args": [ - { - "name": "offset", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "before", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "after", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "first", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "last", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "analyzerIn", - "description": null, - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "OccurrenceConnection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "repository", - "description": "The repository for which this issue has been raised.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Repository", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "MaskPrimaryKeyNode", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "VulnerabilityOccurrenceConnection", - "description": null, - "fields": [ - { - "name": "pageInfo", - "description": "Pagination data for this connection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PageInfo", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "edges", - "description": "Contains the nodes in this connection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "VulnerabilityOccurrenceEdge", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "totalCount", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "VulnerabilityOccurrenceEdge", - "description": "A Relay edge containing a `VulnerabilityOccurrence` and its cursor.", - "fields": [ - { - "name": "node", - "description": "The item at the end of the edge", - "args": [], - "type": { - "kind": "OBJECT", - "name": "VulnerabilityOccurrence", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "cursor", - "description": "A cursor for use in pagination", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "VulnerabilityOccurrence", - "description": null, - "fields": [ - { - "name": "reachability", - "description": "The reachability of the vulnerability occurrence.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "VulnerabilityOccurrenceReachability", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "fixability", - "description": "The fixability of the vulnerability occurrence.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "VulnerabilityOccurrenceFixability", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "vulnerability", - "description": "The vulnerability.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Vulnerability", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "id", - "description": "The ID of the object", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "package", - "description": "The package associated with the vulnerability occurrence.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Package", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "packageVersion", - "description": "The package version associated with the vulnerability occurrence.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PackageVersion", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "MaskPrimaryKeyNode", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "VulnerabilityOccurrenceReachability", - "description": "\n The reachability type of the vulnerability occurrence\n ", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "REACHABLE", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "UNREACHABLE", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "UNKNOWN", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "VulnerabilityOccurrenceFixability", - "description": "\n The fixability type of the vulnerability occurrence\n ", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "ERROR", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "UNFIXABLE", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "GENERATING_FIX", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "POSSIBLY_FIXABLE", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "MANUALLY_FIXABLE", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "AUTO_FIXABLE", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Vulnerability", - "description": null, - "fields": [ - { - "name": "cvssV2Vector", - "description": "CVSS v2 vector", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "cvssV2BaseScore", - "description": "CVSS v2 base score", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Float", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "cvssV2Severity", - "description": "Severity based on the CVSSv2 base score.", - "args": [], - "type": { - "kind": "ENUM", - "name": "VulnerabilitySeverity", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "cvssV3Vector", - "description": "CVSS v3 vector", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "cvssV3BaseScore", - "description": "CVSS v3 base score", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Float", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "cvssV3Severity", - "description": "Severity based on the CVSSv3 base score.", - "args": [], - "type": { - "kind": "ENUM", - "name": "VulnerabilitySeverity", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "cvssV4Vector", - "description": "CVSS v4 vector", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "cvssV4BaseScore", - "description": "CVSS v4 base score", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Float", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "cvssV4Severity", - "description": "Severity based on the CVSSv4 base score.", - "args": [], - "type": { - "kind": "ENUM", - "name": "VulnerabilitySeverity", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "severity", - "description": "Overall implied severity.", - "args": [], - "type": { - "kind": "ENUM", - "name": "VulnerabilitySeverity", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "identifier", - "description": "The identifier of the vulnerability", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "aliases", - "description": "The aliases of the vulnerability", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "summary", - "description": "The summary of the vulnerability", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "details", - "description": "The details of the vulnerability", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "publishedAt", - "description": "The time when the vulnerability was published", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "updatedAt", - "description": "The time when the vulnerability was updated", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "withdrawnAt", - "description": "The time when the vulnerability was withdrawn", - "args": [], - "type": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "epssScore", - "description": "The EPSS score of the vulnerability", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Float", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "epssPercentile", - "description": "The EPSS percentile of the vulnerability", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Float", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "introducedVersions", - "description": "Introduced versions.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "fixedVersions", - "description": "Fixed versions.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "id", - "description": "The ID of the object", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "referenceUrls", - "description": "Reference URLs.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "MaskPrimaryKeyNode", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "VulnerabilitySeverity", - "description": "The severity of the vulnerability.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "NONE", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "LOW", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "MEDIUM", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "HIGH", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "CRITICAL", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Package", - "description": null, - "fields": [ - { - "name": "ecosystem", - "description": "The ecosystem of the package.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "Ecosystem", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "Name of the package", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "purl", - "description": "The package URL", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "id", - "description": "The ID of the object", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "MaskPrimaryKeyNode", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "Ecosystem", - "description": null, - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "NPM", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "PYPI", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "MAVEN", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "GO", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "RUBYGEMS", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "NUGET", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "PACKAGIST", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "CRATES_IO", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "PackageVersion", - "description": null, - "fields": [ - { - "name": "version", - "description": "Version of the package", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "versionType", - "description": "The type of the package version.", - "args": [], - "type": { - "kind": "ENUM", - "name": "PackageVersionType", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "id", - "description": "The ID of the object", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "MaskPrimaryKeyNode", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "PackageVersionType", - "description": "The type of the package version.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "SEMVER", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ECOSYSTEM", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "GIT", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "RepositoryTarget", - "description": "A SCA target in a repository.", - "fields": [ - { - "name": "ecosystem", - "description": "The ecosystem of the target.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "Ecosystem", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "packageManager", - "description": "The package manager of the target.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "PackageManager", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "manifestPath", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "lockfilePath", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "source", - "description": "The source of the target.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "RepositoryTargetSource", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isActivated", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "id", - "description": "The ID of the object", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "MaskPrimaryKeyNode", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "PackageManager", - "description": "\n Package managers supported by DeepSource\n ", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "REQUIREMENTS_TXT", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "POETRY", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "PIPFILE", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "PDM", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "UV", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "NPM", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "YARN", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "PNPM", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "BUN", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "GRADLE", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "MAVEN", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "GO_MOD", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "RUBY_GEMS", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "NUGET", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "PACKAGIST", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "CARGO", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "RepositoryTargetSource", - "description": "\n The source of the target.\n ", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "AUTO", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "CUSTOM", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "RepositoryTargetConnection", - "description": null, - "fields": [ - { - "name": "pageInfo", - "description": "Pagination data for this connection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PageInfo", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "edges", - "description": "Contains the nodes in this connection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "RepositoryTargetEdge", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "totalCount", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "RepositoryTargetEdge", - "description": "A Relay edge containing a `RepositoryTarget` and its cursor.", - "fields": [ - { - "name": "node", - "description": "The item at the end of the edge", - "args": [], - "type": { - "kind": "OBJECT", - "name": "RepositoryTarget", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "cursor", - "description": "A cursor for use in pagination", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "RepositoryReportsNamespace", - "description": "Namespace containing all the reports available for an `Repository`", - "fields": [ - { - "name": "owaspTop10", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "OwaspTop10Report", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "sansTop25", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "SansTop25Report", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "misraC", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "MisraCReport", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "codeHealthTrend", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "CodeHealthTrendReport", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "issueDistribution", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "IssueDistributionReport", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "issuesPrevented", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "IssuesPreventedReport", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "issuesAutofixed", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "IssuesAutofixedReport", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "IgnoreRuleConnection", - "description": null, - "fields": [ - { - "name": "pageInfo", - "description": "Pagination data for this connection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PageInfo", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "edges", - "description": "Contains the nodes in this connection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "IgnoreRuleEdge", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "totalCount", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "IgnoreRuleEdge", - "description": "A Relay edge containing a `IgnoreRule` and its cursor.", - "fields": [ - { - "name": "node", - "description": "The item at the end of the edge", - "args": [], - "type": { - "kind": "OBJECT", - "name": "IgnoreRule", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "cursor", - "description": "A cursor for use in pagination", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "IgnoreRule", - "description": "An `IgnoreRule` defines the condition on which to suppress an `Issue`'s `Occurrence`s in a `Repository`.", - "fields": [ - { - "name": "createdAt", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "id", - "description": "The ID of the object", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "level", - "description": "Ignore level of the rule.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "IgnoreRuleLevel", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": "Ignore type of the rule.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "IgnoreRuleType", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "issue", - "description": "The `Issue` to ignore in the rule.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Issue", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "filePath", - "description": "File path if rule is on `FILE` level.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "globPattern", - "description": "Glob pattern if rule is of `PATTERN` type.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "MaskPrimaryKeyNode", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "IgnoreRuleLevel", - "description": "Represents the level of an `IgnoreRule`.\n- `REPOSITORY`: suppress the issue for all files in the repository.\n- `FILE`: suppress the issue for the given file path in the repository.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "REPOSITORY", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FILE", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "IgnoreRuleType", - "description": "Represents the type of an `IgnoreRule`.\n- `FOREVER`: suppress the issue in the repository always.\n- `PATTERN`: suppress the issue occurrences matching the given glob pattern in the repository.\n- `TEST_PATTERN`: suppress the issue occurrences matching the repository's specified test patterns in the repository.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "FOREVER", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "PATTERN", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "TEST_PATTERN", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "IssueCategorySetting", - "description": "Configuration for an `IssueCategory` in a `Repository`. Also known as Quality Gates.", - "fields": [ - { - "name": "category", - "description": "An `IssueCategory`.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "IssueCategory", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isReported", - "description": "Whether issues of given category are enabled for reporting in the repository.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "canFailCheck", - "description": "Whether to fail checks when occurrence(s) of issues of given category are found in the repository.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "IssuePrioritySetting", - "description": "Configuration for an `IssuePriorityType` in a `Repository`.", - "fields": [ - { - "name": "priorityType", - "description": "A `IssuePriority`.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "IssuePriorityType", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isReported", - "description": "Whether issues of given priority are enabled for reporting in the repository.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "canFailCheck", - "description": "Whether to fail checks when occurrence(s) of issues of given priority are found in the repository.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "IssuePriorityType", - "description": "Enum for issue priority type.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "LOW", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "MEDIUM", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "HIGH", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "MetricSetting", - "description": "Configuration for a `Metric` in a `Repository`. Also known as Quality Gates.", - "fields": [ - { - "name": "metricShortcode", - "description": "The metric's unique identifier.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "MetricShortcode", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isReported", - "description": "Whether the metric is enabled for reporting in the repository.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isThresholdEnforced", - "description": "Whether to fail checks when the metric's thresholds are not met in the repository.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "TeamMemberConnection", - "description": null, - "fields": [ - { - "name": "pageInfo", - "description": "Pagination data for this connection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PageInfo", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "edges", - "description": "Contains the nodes in this connection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "TeamMemberEdge", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "totalCount", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "TeamMemberEdge", - "description": "A Relay edge containing a `TeamMember` and its cursor.", - "fields": [ - { - "name": "node", - "description": "The item at the end of the edge", - "args": [], - "type": { - "kind": "OBJECT", - "name": "TeamMember", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "cursor", - "description": "A cursor for use in pagination", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "TeamMember", - "description": "Represents a user within a team.", - "fields": [ - { - "name": "id", - "description": "The ID of the object", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "user", - "description": "The User instance.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "User", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "role", - "description": "The role this user has in the team.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "TeamMemberRole", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isOwner", - "description": "Whether this user is the owner of the team.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "joinedAt", - "description": "The time when this user joined the team.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "MaskPrimaryKeyNode", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "TeamMemberRole", - "description": "An enumeration.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "ADMIN", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "MEMBER", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "CONTRIBUTOR", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "AccountSubscription", - "description": "Subscription and billing details of an `Account`.", - "fields": [ - { - "name": "plan", - "description": "The plan associated with this account's subscription.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "AccountSubscriptionPlan", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "AccountSubscriptionPlan", - "description": "Represents DeepSource's subscription plans.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "FREE", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "STARTER", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "BUSINESS", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ENTERPRISE", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "TeamSuppressedIssueConnection", - "description": null, - "fields": [ - { - "name": "pageInfo", - "description": "Pagination data for this connection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PageInfo", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "edges", - "description": "Contains the nodes in this connection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "TeamSuppressedIssueEdge", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "totalCount", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "TeamSuppressedIssueEdge", - "description": "A Relay edge containing a `TeamSuppressedIssue` and its cursor.", - "fields": [ - { - "name": "node", - "description": "The item at the end of the edge", - "args": [], - "type": { - "kind": "OBJECT", - "name": "TeamSuppressedIssue", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "cursor", - "description": "A cursor for use in pagination", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "TeamSuppressedIssue", - "description": "A `TeamSuppressedIssue` represents an issue from an analyzer that has been suppressed on the team level. This is\na global suppression that affects all repositories in the team.", - "fields": [ - { - "name": "createdAt", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "id", - "description": "The ID of the object", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "issue", - "description": "The `Issue` that is suppressed.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Issue", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "user", - "description": "The user who suppressed the issue.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "User", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "MaskPrimaryKeyNode", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "IDESubscription", - "description": "Subscription details of an DeepSource IDE subscription.", - "fields": [ - { - "name": "plan", - "description": "The plan of this subscription.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "IDESubscriptionPlan", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "IDESubscriptionPlan", - "description": "Represents DeepSource's IDE subscription plans.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "FREE", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "PRO", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SPONSORED", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Transformer", - "description": "A transformer on DeepSource.", - "fields": [ - { - "name": "analyzer", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "Analyzer", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "exampleConfig", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "Name of the tool.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "shortcode", - "description": "Unique identifier for this tool globally.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": "Verbose description, written in Markdown.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "id", - "description": "The ID of the object", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "logo", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "MaskPrimaryKeyNode", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "TransformerConnection", - "description": null, - "fields": [ - { - "name": "pageInfo", - "description": "Pagination data for this connection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PageInfo", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "edges", - "description": "Contains the nodes in this connection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "TransformerEdge", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "totalCount", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "TransformerEdge", - "description": "A Relay edge containing a `Transformer` and its cursor.", - "fields": [ - { - "name": "node", - "description": "The item at the end of the edge", - "args": [], - "type": { - "kind": "OBJECT", - "name": "Transformer", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "cursor", - "description": "A cursor for use in pagination", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Installation", - "description": "The DeepSource installation.", - "fields": [ - { - "name": "name", - "description": "The name of the installation.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "id", - "description": "The ID of the object", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "logo", - "description": "The logo URL of the installation.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "MaskPrimaryKeyNode", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CodeFormatter", - "description": "A code formatter on DeepSource.", - "fields": [ - { - "name": "analyzer", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "Analyzer", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "exampleConfig", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "Name of the tool.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "shortcode", - "description": "Unique identifier for this tool globally.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": "Verbose description, written in Markdown.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "id", - "description": "The ID of the object", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "logo", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "MaskPrimaryKeyNode", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CodeFormatterConnection", - "description": null, - "fields": [ - { - "name": "pageInfo", - "description": "Pagination data for this connection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PageInfo", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "edges", - "description": "Contains the nodes in this connection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "CodeFormatterEdge", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "totalCount", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CodeFormatterEdge", - "description": "A Relay edge containing a `CodeFormatter` and its cursor.", - "fields": [ - { - "name": "node", - "description": "The item at the end of the edge", - "args": [], - "type": { - "kind": "OBJECT", - "name": "CodeFormatter", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "cursor", - "description": "A cursor for use in pagination", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Mutation", - "description": null, - "fields": [ - { - "name": "suppressIssueForTeam", - "description": "Suppress an issue from an Analyzer on the team level, affecting all repositories.", - "args": [ - { - "name": "input", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "SuppressIssueForTeamInput", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "SuppressIssueForTeamPayload", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "unsuppressIssueForTeam", - "description": "Remove a suppressed issue from an Analyzer on the team level, affecting all repositories.", - "args": [ - { - "name": "input", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "UnsuppressIssueForTeamInput", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "UnsuppressIssueForTeamPayload", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "setRepositoryMetricThreshold", - "description": "Update the threshold for a metric in a repository.", - "args": [ - { - "name": "input", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "SetRepositoryMetricThresholdInput", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "SetRepositoryMetricThresholdPayload", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "regenerateRepositoryDSN", - "description": "Regenerate a repository's DSN.", - "args": [ - { - "name": "input", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "RegenerateRepositoryDSNInput", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "RegenerateRepositoryDSNPayload", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "updateRepositoryDefaultBranch", - "description": "Update a repository's default branch for baseline. If the repository is activated, this action will trigger a new analysis. Only available to users with `WRITE` permission on the repository.", - "args": [ - { - "name": "input", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "UpdateRepositoryDefaultBranchInput", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "UpdateRepositoryDefaultBranchPayload", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "updateRepositoryIssueCategorySetting", - "description": "Update the configuration for an issue category in a repository.", - "args": [ - { - "name": "input", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "UpdateRepositoryIssueCategorySettingInput", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "UpdateRepositoryIssueCategorySettingPayload", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "updateRepositoryIssuePrioritySetting", - "description": "Update the configuration for an issue priority in a repository.", - "args": [ - { - "name": "input", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "UpdateRepositoryIssuePrioritySettingInput", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "UpdateRepositoryIssuePrioritySettingPayload", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "updateRepositoryMetricSetting", - "description": "Update the configuration for a metric in a repository.", - "args": [ - { - "name": "input", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "UpdateRepositoryMetricSettingInput", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "UpdateRepositoryMetricSettingPayload", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "activateRepository", - "description": "Activate a repository. Only available to users with `WRITE` permission on the repository.", - "args": [ - { - "name": "input", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "ActivateRepositoryInput", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "ActivateRepositoryPayload", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "deactivateRepository", - "description": "Deactivate a repository. Only available to users with `WRITE` permission on the repository.", - "args": [ - { - "name": "input", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "DeactivateRepositoryInput", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "DeactivateRepositoryPayload", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "revokeToken", - "description": null, - "args": [ - { - "name": "refreshToken", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Revoke", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "verifyToken", - "description": null, - "args": [ - { - "name": "token", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Verify", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "refreshToken", - "description": null, - "args": [ - { - "name": "refreshToken", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Refresh", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "registerDevice", - "description": "Generates a unique device verification code and an end-user code that are\nvalid for a limited time.", - "args": [ - { - "name": "input", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "RegisterDeviceInput", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "RegisterDevicePayload", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "requestPatWithDeviceCode", - "description": "Validates the device code provided and responds with the user's PAT.\nIf there's no PAT associated with the user, create one. If the user\nhas no access, return an error. Otherwise, indicate the client to keep\npolling.", - "args": [ - { - "name": "input", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "RequestPATWithDeviceCodeInput", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "RequestPATWithDeviceCodePayload", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "refreshPat", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "RefreshPAT", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "revokePat", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "RevokePAT", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "SuppressIssueForTeamPayload", - "description": "Suppress an issue from an Analyzer on the team level, affecting all repositories.", - "fields": [ - { - "name": "ok", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "clientMutationId", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "SuppressIssueForTeamInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "issueShortcode", - "description": "The issue's shortcode.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "login", - "description": "The login or username of the account/team.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "vcsProvider", - "description": "The VCS provider of the account/team.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "VCSProvider", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "clientMutationId", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "UnsuppressIssueForTeamPayload", - "description": "Remove a suppressed issue from an Analyzer on the team level, affecting all repositories.", - "fields": [ - { - "name": "ok", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "clientMutationId", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "UnsuppressIssueForTeamInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "issueShortcode", - "description": "The issue's shortcode.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "login", - "description": "The login or username of the account/team.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "vcsProvider", - "description": "The VCS provider of the account/team.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "VCSProvider", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "clientMutationId", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "SetRepositoryMetricThresholdPayload", - "description": "Update the threshold for a metric in a repository.", - "fields": [ - { - "name": "ok", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "clientMutationId", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "SetRepositoryMetricThresholdInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "repositoryId", - "description": "GraphQL node ID of the repository.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "metricShortcode", - "description": "Metric shortcode to update the threshold for.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "MetricShortcode", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "metricKey", - "description": "The key of the metric you want to update the threshold for.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "MetricKey", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "thresholdValue", - "description": "Threshold value to set. Can be null.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "clientMutationId", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "RegenerateRepositoryDSNPayload", - "description": null, - "fields": [ - { - "name": "dsn", - "description": "The new DSN for the repository.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "clientMutationId", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "RegenerateRepositoryDSNInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "repositoryId", - "description": "GraphQL node ID of the repository.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "clientMutationId", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "UpdateRepositoryDefaultBranchPayload", - "description": null, - "fields": [ - { - "name": "ok", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "repository", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Repository", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "clientMutationId", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "UpdateRepositoryDefaultBranchInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "id", - "description": "GraphQL node ID of the repository.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "defaultBranchName", - "description": "Default branch for analysis on the repository.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "clientMutationId", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "UpdateRepositoryIssueCategorySettingPayload", - "description": null, - "fields": [ - { - "name": "ok", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "clientMutationId", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "UpdateRepositoryIssueCategorySettingInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "repositoryId", - "description": "The repository's ID.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "issueCategory", - "description": "The issue category you want to update.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "IssueCategory", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "isReported", - "description": "Whether issues of given category are enabled for reporting in the repository.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "canFailCheck", - "description": "Whether to fail checks when occurrence(s) of issues of given category are found in the repository. An issue category can only be marked to fail a check if it is enabled for reporting.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "clientMutationId", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "UpdateRepositoryIssuePrioritySettingPayload", - "description": null, - "fields": [ - { - "name": "ok", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "clientMutationId", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "UpdateRepositoryIssuePrioritySettingInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "repositoryId", - "description": "The repository's ID.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "issuePriorityType", - "description": "The issue priority you want to update.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "IssuePriorityType", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "isReported", - "description": "Whether issues of given priority are enabled for reporting in the repository.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "canFailCheck", - "description": "Whether to fail checks when occurrence(s) of issues of given priority are found in the repository.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "clientMutationId", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "UpdateRepositoryMetricSettingPayload", - "description": null, - "fields": [ - { - "name": "ok", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "clientMutationId", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "UpdateRepositoryMetricSettingInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "repositoryId", - "description": "The repository's ID.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "metricShortcode", - "description": "The metric to update.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "MetricShortcode", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "isReported", - "description": "Whether the metric is enabled for reporting in the repository.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "isThresholdEnforced", - "description": "Whether to fail checks when the metric does not meet the threshold.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "clientMutationId", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "ActivateRepositoryPayload", - "description": null, - "fields": [ - { - "name": "ok", - "description": "Whether the repository has been activated successfully", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "clientMutationId", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "ActivateRepositoryInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "repositoryId", - "description": "The repository's ID.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "clientMutationId", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "DeactivateRepositoryPayload", - "description": null, - "fields": [ - { - "name": "ok", - "description": "Whether the repository has been deactivated successfully", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "clientMutationId", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "DeactivateRepositoryInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "repositoryId", - "description": "The repository's ID.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "clientMutationId", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Revoke", - "description": null, - "fields": [ - { - "name": "revoked", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Verify", - "description": null, - "fields": [ - { - "name": "payload", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "GenericScalar", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "GenericScalar", - "description": "The `GenericScalar` scalar type represents a generic\nGraphQL scalar value that could be:\nString, Boolean, Int, Float, List or Object.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Refresh", - "description": null, - "fields": [ - { - "name": "payload", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "GenericScalar", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "refreshExpiresIn", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "token", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "refreshToken", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "RegisterDevicePayload", - "description": "Generates a unique device verification code and an end-user code that are\nvalid for a limited time.", - "fields": [ - { - "name": "deviceCode", - "description": "The device verification code.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "userCode", - "description": "The end-user verification code.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "verificationUri", - "description": "The end-user verification URI.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "verificationUriComplete", - "description": "A verification URI that includes the 'user_code'.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "expiresIn", - "description": "The lifetime in seconds of the 'device_code' and 'user_code'.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "interval", - "description": "The minimum amount of time in seconds that the client should wait between polling requests to the token endpoint.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "clientMutationId", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "RegisterDeviceInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "deviceType", - "description": null, - "type": { - "kind": "ENUM", - "name": "DeviceType", - "ofType": null - }, - "defaultValue": "CLI" - }, - { - "name": "clientMutationId", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "DeviceType", - "description": "The device type that is being registered.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "CLI", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "IDE", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "RequestPATWithDeviceCodePayload", - "description": "Validates the device code provided and responds with the user's PAT.\nIf there's no PAT associated with the user, create one. If the user\nhas no access, return an error. Otherwise, indicate the client to keep\npolling.", - "fields": [ - { - "name": "token", - "description": "The personal access token corresponding to the device_code", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "expiry", - "description": "Expiry of the token, in unix time", - "args": [], - "type": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "user", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "User", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "clientMutationId", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "RequestPATWithDeviceCodeInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "deviceCode", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "description", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "clientMutationId", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "RefreshPAT", - "description": null, - "fields": [ - { - "name": "token", - "description": "The personal access token corresponding to the device_code", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "expiry", - "description": "Expiry of the token, in unix time", - "args": [], - "type": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "user", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "User", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "RevokePAT", - "description": null, - "fields": [ - { - "name": "ok", - "description": "Indication whether revoking of personal access token was successful", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Schema", - "description": "A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.", - "fields": [ - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "types", - "description": "A list of all types supported by this server.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "queryType", - "description": "The type that query operations will be rooted at.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "mutationType", - "description": "If this server supports mutation, the type that mutation operations will be rooted at.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "subscriptionType", - "description": "If this server support subscription, the type that subscription operations will be rooted at.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "directives", - "description": "A list of all directives supported by this server.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Directive", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Type", - "description": "The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.", - "fields": [ - { - "name": "kind", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "__TypeKind", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "specifiedByURL", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "fields", - "description": null, - "args": [ - { - "name": "includeDeprecated", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": "false" - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Field", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "interfaces", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "possibleTypes", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "enumValues", - "description": null, - "args": [ - { - "name": "includeDeprecated", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": "false" - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__EnumValue", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "inputFields", - "description": null, - "args": [ - { - "name": "includeDeprecated", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": "false" - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__InputValue", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ofType", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "__TypeKind", - "description": "An enum describing what kind of type a given `__Type` is.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "SCALAR", - "description": "Indicates this type is a scalar.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "OBJECT", - "description": "Indicates this type is an object. `fields` and `interfaces` are valid fields.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INTERFACE", - "description": "Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "UNION", - "description": "Indicates this type is a union. `possibleTypes` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ENUM", - "description": "Indicates this type is an enum. `enumValues` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INPUT_OBJECT", - "description": "Indicates this type is an input object. `inputFields` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "LIST", - "description": "Indicates this type is a list. `ofType` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "NON_NULL", - "description": "Indicates this type is a non-null. `ofType` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Field", - "description": "Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.", - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "args", - "description": null, - "args": [ - { - "name": "includeDeprecated", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": "false" - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__InputValue", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isDeprecated", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "deprecationReason", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__InputValue", - "description": "Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.", - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "defaultValue", - "description": "A GraphQL-formatted string representing the default value for this input value.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isDeprecated", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "deprecationReason", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__EnumValue", - "description": "One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.", - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isDeprecated", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "deprecationReason", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Directive", - "description": "A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.", - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isRepeatable", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "locations", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "__DirectiveLocation", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "args", - "description": null, - "args": [ - { - "name": "includeDeprecated", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": "false" - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__InputValue", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "__DirectiveLocation", - "description": "A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "QUERY", - "description": "Location adjacent to a query operation.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "MUTATION", - "description": "Location adjacent to a mutation operation.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SUBSCRIPTION", - "description": "Location adjacent to a subscription operation.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FIELD", - "description": "Location adjacent to a field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FRAGMENT_DEFINITION", - "description": "Location adjacent to a fragment definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FRAGMENT_SPREAD", - "description": "Location adjacent to a fragment spread.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INLINE_FRAGMENT", - "description": "Location adjacent to an inline fragment.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "VARIABLE_DEFINITION", - "description": "Location adjacent to a variable definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SCHEMA", - "description": "Location adjacent to a schema definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SCALAR", - "description": "Location adjacent to a scalar definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "OBJECT", - "description": "Location adjacent to an object type definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FIELD_DEFINITION", - "description": "Location adjacent to a field definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ARGUMENT_DEFINITION", - "description": "Location adjacent to an argument definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INTERFACE", - "description": "Location adjacent to an interface definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "UNION", - "description": "Location adjacent to a union definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ENUM", - "description": "Location adjacent to an enum definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ENUM_VALUE", - "description": "Location adjacent to an enum value definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INPUT_OBJECT", - "description": "Location adjacent to an input object type definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INPUT_FIELD_DEFINITION", - "description": "Location adjacent to an input object field definition.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - } - ], - "directives": [ - { - "name": "include", - "description": "Directs the executor to include this field or fragment only when the `if` argument is true.", - "locations": [ - "FIELD", - "FRAGMENT_SPREAD", - "INLINE_FRAGMENT" - ], - "args": [ - { - "name": "if", - "description": "Included when true.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "defaultValue": null - } - ] - }, - { - "name": "skip", - "description": "Directs the executor to skip this field or fragment when the `if` argument is true.", - "locations": [ - "FIELD", - "FRAGMENT_SPREAD", - "INLINE_FRAGMENT" - ], - "args": [ - { - "name": "if", - "description": "Skipped when true.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "defaultValue": null - } - ] - }, - { - "name": "deprecated", - "description": "Marks an element of a GraphQL schema as no longer supported.", - "locations": [ - "FIELD_DEFINITION", - "ARGUMENT_DEFINITION", - "INPUT_FIELD_DEFINITION", - "ENUM_VALUE" - ], - "args": [ - { - "name": "reason", - "description": "Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": "\"No longer supported\"" - } - ] - }, - { - "name": "specifiedBy", - "description": "Exposes a URL that specifies the behavior of this scalar.", - "locations": [ - "SCALAR" - ], - "args": [ - { - "name": "url", - "description": "The URL that specifies the behavior of this scalar.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - } - ] - } - ] - } - } -} \ No newline at end of file diff --git a/justfile b/justfile index c199699f..aa64139e 100644 --- a/justfile +++ b/justfile @@ -14,14 +14,6 @@ build-local: test: go test -v -coverprofile=coverage.out -count=1 ./... -# Clone test fixtures and prepare test environment -test-setup: - mkdir -p $CODE_PATH - cd $CODE_PATH && ls -A1 | xargs rm -rf - git clone https://github.com/DeepSourceCorp/july $CODE_PATH - chmod +x /tmp/deepsource - cp ./command/report/tests/golden_files/python_coverage.xml /tmp - # Remove build artifacts and coverage files clean: rm -rf /tmp/deepsource coverage.out dist/ diff --git a/schema.graphql b/schema.graphql deleted file mode 100644 index 8f92dabf..00000000 --- a/schema.graphql +++ /dev/null @@ -1,2676 +0,0 @@ -"""An issue occurrence found during code analysis.""" -type AnalysisIssue { - """Unique identifier for this issue occurrence.""" - id: ID! - - """Source of this issue.""" - source: AnalysisIssueSource! - - """File path where the issue was found.""" - path: String! - - """Severity of the issue.""" - severity: IssueSeverity! - - """Category of the issue.""" - category: IssueCategory! - - """Description of the issue.""" - title: String - - """Detailed explanation of the issue.""" - explanation: String - - """Whether this issue is suppressed.""" - isSuppressed: Boolean! - - """Starting line number.""" - beginLine: Int! - - """Starting column number.""" - beginColumn: Int! - - """Ending line number.""" - endLine: Int! - - """Ending column number.""" - endColumn: Int! - - """Time when the issue was first detected.""" - createdAt: DateTime! - - """Time when the issue was last modified.""" - modifiedAt: DateTime! - - """Issue shortcode. Null for AI issues.""" - shortcode: String - - """The issue definition. Null for AI issues.""" - issue: Issue -} - -"""Source of an analysis issue.""" -enum AnalysisIssueSource { - STATIC - AI -} - -"""An enumeration.""" -enum IssueSeverity { - CRITICAL - MAJOR - MINOR -} - -"""An enumeration.""" -enum IssueCategory { - ANTI_PATTERN - BUG_RISK - PERFORMANCE - SECURITY - COVERAGE - TYPECHECK - STYLE - DOCUMENTATION - SECRETS -} - -""" -The `DateTime` scalar type represents a DateTime -value as specified by -[iso8601](https://en.wikipedia.org/wiki/ISO_8601). -""" -scalar DateTime - -type ComplianceReport implements Report { - """The key of the report.""" - key: ReportKey - - """The title of the report.""" - title: String - - """The current value of the report.""" - currentValue: Int - - """The status of the report.""" - status: ReportStatus - - """The historical values for this report.""" - historicalValues(startDate: Date!, endDate: Date!): [HistoricalValueItem] - - """The trends associated with this report.""" - trends: [Trend] - - """The compliance issue stats associated with this report.""" - complianceIssueStats: [ComplianceIssueStat] -} - -interface Report { - """The key of the report.""" - key: ReportKey - - """The title of the report.""" - title: String - - """The current value of the report.""" - currentValue: Int - - """The status of the report.""" - status: ReportStatus - - """The historical values for this report.""" - historicalValues(startDate: Date!, endDate: Date!): [HistoricalValueItem] - - """The trends associated with this report.""" - trends: [Trend] -} - -"""All possible report keys.""" -enum ReportKey { - OWASP_TOP_10 - SANS_TOP_25 - MISRA_C - CODE_COVERAGE - CODE_HEALTH_TREND - ISSUE_DISTRIBUTION - ISSUES_PREVENTED - ISSUES_AUTOFIXED -} - -"""The different statuses possible for a report.""" -enum ReportStatus { - PASSING - FAILING - NOOP -} - -type HistoricalValueItem { - """The date of the historical value.""" - date: Date - - """The values associated with this item.""" - values: [HistoricalValue] -} - -""" -The `Date` scalar type represents a Date -value as specified by -[iso8601](https://en.wikipedia.org/wiki/ISO_8601). -""" -scalar Date - -type HistoricalValue { - """The key associated with the value.""" - key: String - - """The value.""" - value: Int -} - -"""Represents a trend for a report.""" -type Trend { - """The label associated with the trend.""" - label: String - - """The value of the trend.""" - value: Int - - """The percentage change in the trend.""" - rate: Float @deprecated(reason: "Deprecated in favor of `changePercentage`.") - - """The percentage change in the trend.""" - changePercentage: Float -} - -type ComplianceIssueStat { - """The key for this stat.""" - key: String - - """The title for this stat.""" - title: String - - """The occurrence count of the compliance issue.""" - occurrence: ComplianceIssueOccurrenceCount -} - -type ComplianceIssueOccurrenceCount { - """The count of critical severity issues.""" - critical: Int - - """The count of major severity issues.""" - major: Int - - """The count of minor severity issues.""" - minor: Int - - """The total count of issues.""" - total: Int -} - -type InsightReport implements Report { - """The key of the report.""" - key: ReportKey - - """The title of the report.""" - title: String - - """The current value of the report.""" - currentValue: Int - - """The status of the report.""" - status: ReportStatus - - """The historical values for this report.""" - historicalValues(startDate: Date!, endDate: Date!): [HistoricalValueItem] - - """The trends associated with this report.""" - trends: [Trend] -} - -type Issue implements MaskPrimaryKeyNode { - shortcode: String! - title: String! - analyzer: Analyzer! - autofixAvailable: Boolean! - autofixAiAvailable: Boolean - isRecommended: Boolean! - - """The ID of the object""" - id: ID! - - """Category of the issue.""" - category: IssueCategory! - - """Severity of the issue.""" - severity: IssueSeverity! - - """The description of the issue in markdown.""" - description: String! - - """A short description of the issue.""" - shortDescription: String! - - """A list of tags associated with the issue.""" - tags: [String]! -} - -"""Custom node class to prevent leaking primary keys as integers""" -interface MaskPrimaryKeyNode { - """The ID of the object""" - id: ID! -} - -"""A DeepSource Analyzer.""" -type Analyzer implements MaskPrimaryKeyNode { - """Version of the image used for this analyzer.""" - version: String! - - """Unique identifier for this analyzer globally.""" - shortcode: String! - - """Human-friendly name for this analyzer.""" - name: String! - - """Verbose description, written in Markdown.""" - description: String! - - """ - Schema of the meta fields accepted by the analyzer in .deepsource.toml. - """ - metaSchema: JSONString! - exampleConfig: String - - """The ID of the object""" - id: ID! - logo: String - numIssues: Int - issues(offset: Int, before: String, after: String, first: Int, last: Int): IssueConnection - - """Get a specific issue by its shortcode.""" - issue( - """Shortcode of the issue.""" - shortcode: String! - ): Issue - issueDistribution: [IssueDistributionItem] - type: AnalyzerType -} - -""" -Allows use of a JSON String for input / output from the GraphQL schema. - -Use of this type is *not recommended* as you lose the benefits of having a defined, static -schema (one of the key benefits of GraphQL). -""" -scalar JSONString - -type IssueConnection { - """Pagination data for this connection.""" - pageInfo: PageInfo! - - """Contains the nodes in this connection.""" - edges: [IssueEdge]! - totalCount: Int -} - -""" -The Relay compliant `PageInfo` type, containing data necessary to paginate this connection. -""" -type PageInfo { - """When paginating forwards, are there more items?""" - hasNextPage: Boolean! - - """When paginating backwards, are there more items?""" - hasPreviousPage: Boolean! - - """When paginating backwards, the cursor to continue.""" - startCursor: String - - """When paginating forwards, the cursor to continue.""" - endCursor: String -} - -"""A Relay edge containing a `Issue` and its cursor.""" -type IssueEdge { - """The item at the end of the edge""" - node: Issue - - """A cursor for use in pagination""" - cursor: String! -} - -type IssueDistributionItem { - category: IssueCategory! - title: String! - count: Int! -} - -"""An enumeration.""" -enum AnalyzerType { - CORE - COMMUNITY - CUSTOM -} - -type IssueDistributionReport implements Report { - """The key of the report.""" - key: ReportKey! - - """The title of the report.""" - title: String! - - """The current value of the report.""" - currentValue: Int - - """The status of the report.""" - status: ReportStatus @deprecated(reason: "Report doesn't have a status.") - - """The historical values for this report.""" - historicalValues(startDate: Date!, endDate: Date!): [HistoricalValueItem] @deprecated(reason: "Deprecated in favor of `values`.") - - """The trends associated with this report.""" - trends: [Trend]! - - """The report values for this report.""" - values( - """The start date to get the report values.""" - startDate: Date! - - """The start date to get the report values.""" - endDate: Date! - ): [ReportValueItem]! - issueDistributionByAnalyzer: [IssueDistribution] - issueDistributionByCategory: [IssueDistribution] -} - -"""Represents the values recorded on a specific date.""" -type ReportValueItem { - """The date when the values were recorded.""" - date: Date! - - """The values recorded on the given date.""" - values: [ReportValue] -} - -"""Represents a value recorded for a report.""" -type ReportValue { - """The key associated with the value.""" - key: String! - - """The value.""" - value: Int! -} - -type IssueDistribution { - key: String - value: Int -} - -"""A metric tracked by an analyzer.""" -type Metric implements MaskPrimaryKeyNode & MetricDefinition { - """The ID of the object""" - id: ID! - - """The metric's name.""" - name: String! - - """The metric's unique identifier.""" - shortcode: MetricShortcode! - - """The metric's description in markdown format.""" - description: String! - - """Direction which can be considered positive for the metric.""" - positiveDirection: Direction! - - """Unit suffix to apply to the metric value.""" - unit: String - - """Lower bound for the metric value.""" - minValueAllowed: Int - - """Upper bound for the metric value.""" - maxValueAllowed: Int -} - -"""A metric's definition.""" -interface MetricDefinition { - """The metric's name.""" - name: String! - - """The metric's unique identifier.""" - shortcode: MetricShortcode! - - """The metric's description in markdown format.""" - description: String! - - """Direction which can be considered positive for the metric.""" - positiveDirection: Direction! - - """Unit suffix to apply to the metric value.""" - unit: String - - """Lower bound for the metric value.""" - minValueAllowed: Int - - """Upper bound for the metric value.""" - maxValueAllowed: Int -} - -"""Represents the various metric types.""" -enum MetricShortcode { - BCV - CCV - DCV - DDP - LCV - CPCV - NLCV - NBCV - NCCV - NCPCV -} - -"""Represents the direction of a value.""" -enum Direction { - UPWARD - DOWNWARD -} - -""" -Statistics pertaining to the changeset (of a commit or PR), as analyzed by an `AnalysisRun`. -""" -type ChangesetStats { - """Stats for number of lines in the changeset.""" - lines: ChangesetStatsCounts! - - """Stats for number of branches in the changeset.""" - branches: ChangesetStatsCounts! - - """Stats for number of conditions in the changeset.""" - conditions: ChangesetStatsCounts! -} - -""" -Overall and newly added number of lines (or branches or conditions) in a changeset. -""" -type ChangesetStatsCounts { - "\n Overall number of lines (or branches or conditions) across the repository.\n Note: `0` depicts no lines (or branches or conditions) were found whereas `None` depicts the information is not available.\n " - overall: Int - - "\n Overall number of lines (or branches or conditions) that are covered across the repository.\",\n Note: `0` depicts no lines (or branches or conditions) were found whereas `None` depicts the information is not available.\n " - overallCovered: Int - - "Newly added number of lines (or branches or conditions) in the changeset.\nNote: `0` depicts no lines (or branches or conditions) were found whereas `None` depicts the information is not available.\n " - new: Int - - "\n Newly added number of lines (or branches or conditions) that are covered in the changeset.\n Note: `0` depicts no lines (or branches or conditions) were found whereas `None` depicts the information is not available.\n " - newCovered: Int -} - -"""A Pull Request on DeepSource.""" -type PullRequest implements MaskPrimaryKeyNode { - createdAt: DateTime! - baseBranch: String - branch: String - number: Int - title: String - - """The ID of the object""" - id: ID! - - """Current state of this pull request (open/closed)""" - state: PRState! - - """URL of the PR on the VCS provider's website""" - vcsUrl: String! - - """Summary of issues and vulnerabilities for this PR""" - summary: PRSummary! - - """Latest analysis run on this pull request""" - latestAnalysisRun: AnalysisRun - - """All issue occurrences from the latest analysis run on this PR""" - issueOccurrences(offset: Int, before: String, after: String, first: Int, last: Int, analyzerIn: [String]): OccurrenceConnection! - - """All vulnerability occurrences from the latest analysis run on this PR""" - vulnerabilityOccurrences(offset: Int, before: String, after: String, first: Int, last: Int): VulnerabilityOccurrenceConnection! - - """List of DeepSource metrics captured in the latest run""" - metrics: [RepositoryMetric!] -} - -"""State of a pull request.""" -enum PRState { - OPEN - CLOSED -} - -"""Summary counts for a pull request.""" -type PRSummary { - """Total issues raised by this pull request""" - issuesRaised: Int - - """Total issues resolved by this pull request""" - issuesResolved: Int - - """Total issues suppressed in this pull request""" - issuesSuppressed: Int - - """Total vulnerabilities raised by this pull request""" - vulnerabilitiesRaised: Int -} - -type AnalysisRun implements MaskPrimaryKeyNode { - createdAt: DateTime! - branchName: String - baseOid: String - commitOid: String - finishedAt: DateTime - repository: Repository! - - """The ID of the object""" - id: ID! - - """UID of this AnalysisRun.""" - runUid: UUID! - - """The current status of the run.""" - status: AnalysisRunStatus! - - """Summary of the analysis run""" - summary: AnalysisRunSummary! - - """Time when the analysis run was last modified""" - updatedAt: DateTime! - - """Analyzer checks in the analysis run.""" - checks(offset: Int, before: String, after: String, first: Int, last: Int, analyzerIn: [String]): CheckConnection - - """ - Statistics pertaining to the changeset (of a commit or PR) in the analysis run. - """ - changesetStats: ChangesetStats - - """Report Card for the Run with quality dimension grades and scores""" - reportCard: RunReport - - """SCA checks for OSS dependency analysis in this run.""" - scaChecks(offset: Int, before: String, after: String, first: Int, last: Int): SCACheckConnection -} - -type Repository implements MaskPrimaryKeyNode { - """The name of this repository.""" - name: String! - - """Object ID of the latest commit on the default branch.""" - latestCommitOid: String - isPrivate: Boolean! - isActivated: Boolean! - - """The ID of the object""" - id: ID! - - """The account under which this repository exists.""" - account: Account! - - """Past analysis runs for the repository""" - analysisRuns(offset: Int, before: String, after: String, first: Int, last: Int): AnalysisRunConnection - - """ - The `.deepsource.toml` config of the repository represented as a JSON object. - """ - configJson: JSON - - """The default base branch of the repository on DeepSource.""" - defaultBranch: String - - """The DSN for this repository.""" - dsn: String - - """Get all the analyzers enabled in this repository.""" - enabledAnalyzers(offset: Int, before: String, after: String, first: Int, last: Int): AnalyzerConnection - - """ - Get all issues raised in the default branch of this repository. Specifying a path would only return those issues whose occurrences are present in the file at path. - """ - issues( - """Show issues for this path only.""" - path: String - offset: Int - before: String - after: String - first: Int - last: Int - tags: [String] - analyzerIn: [String] - ): RepositoryIssueConnection - - """All issue occurrences in the default branch.""" - issueOccurrences(offset: Int, before: String, after: String, first: Int, last: Int, analyzerIn: [String]): OccurrenceConnection - - """List of dependency vulnerability occurrences in the default branch.""" - dependencyVulnerabilityOccurrences(offset: Int, before: String, after: String, first: Int, last: Int): VulnerabilityOccurrenceConnection - - """Get a dependency vulnerability occurrence by its ID.""" - dependencyVulnerabilityOccurrence(id: ID!): VulnerabilityOccurrence! - - """Get a specific pull request by its number on the VCS provider""" - pullRequest( - """Pull request number on the VCS provider""" - number: Int! - ): PullRequest - - """Get a specific repository target.""" - target(id: ID!): RepositoryTarget! - - """List of repository targets for this repository.""" - targets(offset: Int, before: String, after: String, first: Int, last: Int): RepositoryTargetConnection! - - """Get a report associated with this repository""" - report( - """Get the report associated with the report key""" - key: ReportKey! - ): Report! @deprecated(reason: "Deprecated in favor of `reports`.") - - """Namespace containing all available reports.""" - reports: RepositoryReportsNamespace! - - """VCS Provider of the repository.""" - vcsProvider: VCSProvider! - - """URL of the repository on the VCS.""" - vcsUrl: String! - - """List of all DeepSource metrics.""" - metrics( - """List of metric shortcodes to filter on.""" - shortcodeIn: [MetricShortcode] - ): [RepositoryMetric!]! - - """List of `IgnoreRule`s that exist for the repository.""" - ignoreRules(offset: Int, before: String, after: String, first: Int, last: Int, issueShortcode: String, filePath: String): IgnoreRuleConnection - - """Issue categories configuration for the repository.""" - issueCategorySettings: [IssueCategorySetting!]! - - """Issue priority configuration for the repository.""" - issuePrioritySettings: [IssuePrioritySetting!]! - - """Metric settings for the repository.""" - metricSettings: [MetricSetting!]! - - """ - Whether the account has allowed Autofix AI to run on private repositories. - """ - allowAutofixAi: Boolean! - - """Whether to use the legacy autofix engine.""" - useLegacyAutofix: Boolean! -} - -type Account implements MaskPrimaryKeyNode { - """The ID of the object""" - id: ID! - - """The unique identifier (or username) of the account.""" - login: String! - - """The account type (individual or team).""" - type: AccountType! - - """VCS Provider of the account.""" - vcsProvider: VCSProvider! - - """Whether the account is a beta tester""" - isBetaTester: Boolean! - - """URL for the account's public avatar.""" - avatarUrl: String - - """Get a report associated with this account""" - report( - """Get the report associated with the report key""" - key: ReportKey! - ): Report! @deprecated(reason: "Deprecated in favor of `reports`.") - - """Namespace containing all available reports.""" - reports: AccountReportsNamespace! - - """URL for the account on the VCS Provider.""" - vcsUrl: String - - """ - Get all repositories accessible to the current user under the given account. - """ - repositories(offset: Int, before: String, after: String, first: Int, last: Int): RepositoryConnection! - - """Members of the team. This is an empty list for an individual account.""" - members(offset: Int, before: String, after: String, first: Int, last: Int): TeamMemberConnection! - - """Subscription and billing details of the account.""" - subscription: AccountSubscription! - - """Suppressed issues on the account/team.""" - suppressedIssues(offset: Int, before: String, after: String, first: Int, last: Int, issueShortcode: String): TeamSuppressedIssueConnection! -} - -enum AccountType { - """A individual account.""" - INDIVIDUAL - - """A team account.""" - TEAM -} - -"""An enumeration.""" -enum VCSProvider { - GITHUB - GITLAB - BITBUCKET - BITBUCKET_DATACENTER - GITHUB_ENTERPRISE - GSR - ADS -} - -"""Namespace containing all the reports available for an `Account`""" -type AccountReportsNamespace { - owaspTop10: OwaspTop10Report! - sansTop25: SansTop25Report! - misraC: MisraCReport! - codeCoverage: CodeCoverageReport! - codeHealthTrend: CodeHealthTrendReport! - issueDistribution: IssueDistributionReport! - issuesPrevented: IssuesPreventedReport! - issuesAutofixed: IssuesAutofixedReport! -} - -"""The OWASP Top 10 report.""" -type OwaspTop10Report { - """The key of the report.""" - key: ReportKey! - - """The title of the report.""" - title: String! - - """The current value of the report.""" - currentValue: Int - - """The report values for this report.""" - values( - """The start date to get the report values.""" - startDate: Date! - - """The start date to get the report values.""" - endDate: Date! - ): [ReportValueItem]! - - """The trends associated with this report.""" - trends: [Trend]! - - """The status of the report.""" - status: ReportStatus! - - """The compliance issue stats associated with this report.""" - securityIssueStats: [SecurityIssueStat]! -} - -type SecurityIssueStat { - """The key for this stat.""" - key: String! - - """The title for this stat.""" - title: String! - - """The severity distribution for this stat.""" - occurrence: SeverityDistribution! -} - -"""Distribution of severity count.""" -type SeverityDistribution { - """The count of critical severity issues.""" - critical: Int - - """The count of major severity issues.""" - major: Int - - """The count of minor severity issues.""" - minor: Int - - """The total count of issues.""" - total: Int -} - -"""The SANS Top 25 report.""" -type SansTop25Report { - """The key of the report.""" - key: ReportKey! - - """The title of the report.""" - title: String! - - """The current value of the report.""" - currentValue: Int - - """The report values for this report.""" - values( - """The start date to get the report values.""" - startDate: Date! - - """The start date to get the report values.""" - endDate: Date! - ): [ReportValueItem]! - - """The trends associated with this report.""" - trends: [Trend]! - - """The status of the report.""" - status: ReportStatus! - - """The compliance issue stats associated with this report.""" - securityIssueStats: [SecurityIssueStat]! -} - -"""The MISRA-C report.""" -type MisraCReport { - """The key of the report.""" - key: ReportKey! - - """The title of the report.""" - title: String! - - """The current value of the report.""" - currentValue: Int - - """The report values for this report.""" - values( - """The start date to get the report values.""" - startDate: Date! - - """The start date to get the report values.""" - endDate: Date! - ): [ReportValueItem]! - - """The trends associated with this report.""" - trends: [Trend]! - - """The status of the report.""" - status: ReportStatus! - - """The compliance issue stats associated with this report.""" - securityIssueStats: [SecurityIssueStat]! -} - -"""The Code Coverage report.""" -type CodeCoverageReport { - """The key of the report.""" - key: ReportKey! - - """The title of the report.""" - title: String! - - """The list of repositories.""" - repositories( - """The query string to search for repositories.""" - q: String - - """The sort key to sort the repositories results by.""" - sortKey: CodeCoverageReportRepositorySortKey - offset: Int - before: String - after: String - first: Int - last: Int - ): CodeCoverageReportRepositoryConnection -} - -type CodeCoverageReportRepositoryConnection { - """Pagination data for this connection.""" - pageInfo: PageInfo! - - """Contains the nodes in this connection.""" - edges: [CodeCoverageReportRepositoryEdge]! - totalCount: Int -} - -""" -A Relay edge containing a `CodeCoverageReportRepository` and its cursor. -""" -type CodeCoverageReportRepositoryEdge { - """The item at the end of the edge""" - node: CodeCoverageReportRepository - - """A cursor for use in pagination""" - cursor: String! -} - -"""Representation of a `Repository` in the Code Coverage report.""" -type CodeCoverageReportRepository implements MaskPrimaryKeyNode { - """The name of this repository.""" - name: String! - - """The ID of the object""" - id: ID! - - """The LCV metric value for this repository.""" - lcvMetricValue: Float - - """The BCV metric value for this repository.""" - bcvMetricValue: Float - - """Whether the LCV value is passing.""" - isLcvPassing: Boolean - - """Whether the BCV value is passing.""" - isBcvPassing: Boolean -} - -""" -Possible options to sort the list of repositories in the Code Coverage report. -""" -enum CodeCoverageReportRepositorySortKey { - LCV_ASCENDING - LCV_DESCENDING - BCV_ASCENDING - BCV_DESCENDING -} - -"""The Code Health Trend report.""" -type CodeHealthTrendReport { - """The key of the report.""" - key: ReportKey! - - """The title of the report.""" - title: String! - - """The current value of the report.""" - currentValue: Int - - """The report values for this report.""" - values( - """The start date to get the report values.""" - startDate: Date! - - """The start date to get the report values.""" - endDate: Date! - ): [ReportValueItem]! - - """The trends associated with this report.""" - trends: [Trend]! -} - -"""The Issues Prevented report.""" -type IssuesPreventedReport { - """The key of the report.""" - key: ReportKey! - - """The title of the report.""" - title: String! - - """The current value of the report.""" - currentValue: Int - - """The report values for this report.""" - values( - """The start date to get the report values.""" - startDate: Date! - - """The start date to get the report values.""" - endDate: Date! - ): [ReportValueItem]! - - """The trends associated with this report.""" - trends: [Trend]! -} - -"""The Issues Autofixed report.""" -type IssuesAutofixedReport { - """The key of the report.""" - key: ReportKey! - - """The title of the report.""" - title: String! - - """The current value of the report.""" - currentValue: Int - - """The report values for this report.""" - values( - """The start date to get the report values.""" - startDate: Date! - - """The start date to get the report values.""" - endDate: Date! - ): [ReportValueItem]! - - """The trends associated with this report.""" - trends: [Trend]! -} - -type RepositoryConnection { - """Pagination data for this connection.""" - pageInfo: PageInfo! - - """Contains the nodes in this connection.""" - edges: [RepositoryEdge]! - totalCount: Int -} - -"""A Relay edge containing a `Repository` and its cursor.""" -type RepositoryEdge { - """The item at the end of the edge""" - node: Repository - - """A cursor for use in pagination""" - cursor: String! -} - -type TeamMemberConnection { - """Pagination data for this connection.""" - pageInfo: PageInfo! - - """Contains the nodes in this connection.""" - edges: [TeamMemberEdge]! - totalCount: Int -} - -"""A Relay edge containing a `TeamMember` and its cursor.""" -type TeamMemberEdge { - """The item at the end of the edge""" - node: TeamMember - - """A cursor for use in pagination""" - cursor: String! -} - -"""Represents a user within a team.""" -type TeamMember implements MaskPrimaryKeyNode { - """The ID of the object""" - id: ID! - - """The User instance.""" - user: User! - - """The role this user has in the team.""" - role: TeamMemberRole! - - """Whether this user is the owner of the team.""" - isOwner: Boolean! - - """The time when this user joined the team.""" - joinedAt: DateTime! -} - -type User implements MaskPrimaryKeyNode { - firstName: String! - lastName: String! - email: String! - - """The ID of the object""" - id: ID! - - """ - All the accounts associated with the user. This includes the team accounts the user is part of and the individual accounts they have added on DeepSource. - """ - accounts(offset: Int, before: String, after: String, first: Int, last: Int): AccountConnection - - """The anonymous ID used for analytics and tracking.""" - analyticsId: String! - - """Whether the user is a beta tester.""" - isBetaTester: Boolean! - - """The IDE subscription associated with the user.""" - ideSubscription: IDESubscription -} - -type AccountConnection { - """Pagination data for this connection.""" - pageInfo: PageInfo! - - """Contains the nodes in this connection.""" - edges: [AccountEdge]! - totalCount: Int -} - -"""A Relay edge containing a `Account` and its cursor.""" -type AccountEdge { - """The item at the end of the edge""" - node: Account - - """A cursor for use in pagination""" - cursor: String! -} - -"""Subscription details of an DeepSource IDE subscription.""" -type IDESubscription { - """The plan of this subscription.""" - plan: IDESubscriptionPlan! -} - -"""Represents DeepSource's IDE subscription plans.""" -enum IDESubscriptionPlan { - FREE - PRO - SPONSORED -} - -"""An enumeration.""" -enum TeamMemberRole { - ADMIN - MEMBER - CONTRIBUTOR -} - -"""Subscription and billing details of an `Account`.""" -type AccountSubscription { - """The plan associated with this account's subscription.""" - plan: AccountSubscriptionPlan! -} - -"""Represents DeepSource's subscription plans.""" -enum AccountSubscriptionPlan { - FREE - STARTER - BUSINESS - ENTERPRISE -} - -type TeamSuppressedIssueConnection { - """Pagination data for this connection.""" - pageInfo: PageInfo! - - """Contains the nodes in this connection.""" - edges: [TeamSuppressedIssueEdge]! - totalCount: Int -} - -"""A Relay edge containing a `TeamSuppressedIssue` and its cursor.""" -type TeamSuppressedIssueEdge { - """The item at the end of the edge""" - node: TeamSuppressedIssue - - """A cursor for use in pagination""" - cursor: String! -} - -""" -A `TeamSuppressedIssue` represents an issue from an analyzer that has been suppressed on the team level. This is -a global suppression that affects all repositories in the team. -""" -type TeamSuppressedIssue implements MaskPrimaryKeyNode { - createdAt: DateTime! - - """The ID of the object""" - id: ID! - - """The `Issue` that is suppressed.""" - issue: Issue! - - """The user who suppressed the issue.""" - user: User -} - -type AnalysisRunConnection { - """Pagination data for this connection.""" - pageInfo: PageInfo! - - """Contains the nodes in this connection.""" - edges: [AnalysisRunEdge]! - totalCount: Int -} - -"""A Relay edge containing a `AnalysisRun` and its cursor.""" -type AnalysisRunEdge { - """The item at the end of the edge""" - node: AnalysisRun - - """A cursor for use in pagination""" - cursor: String! -} - -"""A JSON object.""" -scalar JSON - -type AnalyzerConnection { - """Pagination data for this connection.""" - pageInfo: PageInfo! - - """Contains the nodes in this connection.""" - edges: [AnalyzerEdge]! - totalCount: Int -} - -"""A Relay edge containing a `Analyzer` and its cursor.""" -type AnalyzerEdge { - """The item at the end of the edge""" - node: Analyzer - - """A cursor for use in pagination""" - cursor: String! -} - -type RepositoryIssueConnection { - """Pagination data for this connection.""" - pageInfo: PageInfo! - - """Contains the nodes in this connection.""" - edges: [RepositoryIssueEdge]! - totalCount: Int -} - -"""A Relay edge containing a `RepositoryIssue` and its cursor.""" -type RepositoryIssueEdge { - """The item at the end of the edge""" - node: RepositoryIssue - - """A cursor for use in pagination""" - cursor: String! -} - -type RepositoryIssue implements MaskPrimaryKeyNode { - """The ID of the object""" - id: ID! - - """Definition of the issue that has been raised.""" - issue: Issue! - - """All occurrences of this issue in the default branch.""" - occurrences(offset: Int, before: String, after: String, first: Int, last: Int, analyzerIn: [String]): OccurrenceConnection - - """The repository for which this issue has been raised.""" - repository: Repository! -} - -type OccurrenceConnection { - """Pagination data for this connection.""" - pageInfo: PageInfo! - - """Contains the nodes in this connection.""" - edges: [OccurrenceEdge]! - totalCount: Int -} - -"""A Relay edge containing a `Occurrence` and its cursor.""" -type OccurrenceEdge { - """The item at the end of the edge""" - node: Occurrence - - """A cursor for use in pagination""" - cursor: String! -} - -type Occurrence implements MaskPrimaryKeyNode { - path: String! - beginLine: Int! - beginColumn: Int! - endLine: Int! - endColumn: Int! - - """The ID of the object""" - id: ID! - - """The definition of the issue which has been raised.""" - issue: Issue! - - """Title describing the issue which has been raised here.""" - title: String! -} - -type VulnerabilityOccurrenceConnection { - """Pagination data for this connection.""" - pageInfo: PageInfo! - - """Contains the nodes in this connection.""" - edges: [VulnerabilityOccurrenceEdge]! - totalCount: Int -} - -"""A Relay edge containing a `VulnerabilityOccurrence` and its cursor.""" -type VulnerabilityOccurrenceEdge { - """The item at the end of the edge""" - node: VulnerabilityOccurrence - - """A cursor for use in pagination""" - cursor: String! -} - -type VulnerabilityOccurrence implements MaskPrimaryKeyNode { - """The reachability of the vulnerability occurrence.""" - reachability: VulnerabilityOccurrenceReachability! - - """The fixability of the vulnerability occurrence.""" - fixability: VulnerabilityOccurrenceFixability! - - """The vulnerability.""" - vulnerability: Vulnerability! - - """The ID of the object""" - id: ID! - - """The package associated with the vulnerability occurrence.""" - package: Package! - - """The package version associated with the vulnerability occurrence.""" - packageVersion: PackageVersion! -} - -"\n The reachability type of the vulnerability occurrence\n " -enum VulnerabilityOccurrenceReachability { - REACHABLE - UNREACHABLE - UNKNOWN -} - -"\n The fixability type of the vulnerability occurrence\n " -enum VulnerabilityOccurrenceFixability { - ERROR - UNFIXABLE - GENERATING_FIX - POSSIBLY_FIXABLE - MANUALLY_FIXABLE - AUTO_FIXABLE -} - -type Vulnerability implements MaskPrimaryKeyNode { - """CVSS v2 vector""" - cvssV2Vector: String - - """CVSS v2 base score""" - cvssV2BaseScore: Float - - """Severity based on the CVSSv2 base score.""" - cvssV2Severity: VulnerabilitySeverity - - """CVSS v3 vector""" - cvssV3Vector: String - - """CVSS v3 base score""" - cvssV3BaseScore: Float - - """Severity based on the CVSSv3 base score.""" - cvssV3Severity: VulnerabilitySeverity - - """CVSS v4 vector""" - cvssV4Vector: String - - """CVSS v4 base score""" - cvssV4BaseScore: Float - - """Severity based on the CVSSv4 base score.""" - cvssV4Severity: VulnerabilitySeverity - - """Overall implied severity.""" - severity: VulnerabilitySeverity - - """The identifier of the vulnerability""" - identifier: String! - - """The aliases of the vulnerability""" - aliases: [String!]! - - """The summary of the vulnerability""" - summary: String - - """The details of the vulnerability""" - details: String - - """The time when the vulnerability was published""" - publishedAt: DateTime! - - """The time when the vulnerability was updated""" - updatedAt: DateTime! - - """The time when the vulnerability was withdrawn""" - withdrawnAt: DateTime - - """The EPSS score of the vulnerability""" - epssScore: Float - - """The EPSS percentile of the vulnerability""" - epssPercentile: Float - - """Introduced versions.""" - introducedVersions: [String]! - - """Fixed versions.""" - fixedVersions: [String]! - - """The ID of the object""" - id: ID! - - """Reference URLs.""" - referenceUrls: [String]! -} - -"""The severity of the vulnerability.""" -enum VulnerabilitySeverity { - NONE - LOW - MEDIUM - HIGH - CRITICAL -} - -type Package implements MaskPrimaryKeyNode { - """The ecosystem of the package.""" - ecosystem: Ecosystem! - - """Name of the package""" - name: String! - - """The package URL""" - purl: String - - """The ID of the object""" - id: ID! -} - -enum Ecosystem { - NPM - PYPI - MAVEN - GO - RUBYGEMS - NUGET - PACKAGIST - CRATES_IO -} - -type PackageVersion implements MaskPrimaryKeyNode { - """Version of the package""" - version: String! - - """The type of the package version.""" - versionType: PackageVersionType - - """The ID of the object""" - id: ID! -} - -"""The type of the package version.""" -enum PackageVersionType { - SEMVER - ECOSYSTEM - GIT -} - -"""A SCA target in a repository.""" -type RepositoryTarget implements MaskPrimaryKeyNode { - """The ecosystem of the target.""" - ecosystem: Ecosystem! - - """The package manager of the target.""" - packageManager: PackageManager! - manifestPath: String - lockfilePath: String! - - """The source of the target.""" - source: RepositoryTargetSource! - isActivated: Boolean! - - """The ID of the object""" - id: ID! -} - -"\n Package managers supported by DeepSource\n " -enum PackageManager { - REQUIREMENTS_TXT - POETRY - PIPFILE - PDM - UV - NPM - YARN - PNPM - BUN - GRADLE - MAVEN - GO_MOD - RUBY_GEMS - NUGET - PACKAGIST - CARGO -} - -"\n The source of the target.\n " -enum RepositoryTargetSource { - AUTO - CUSTOM -} - -type RepositoryTargetConnection { - """Pagination data for this connection.""" - pageInfo: PageInfo! - - """Contains the nodes in this connection.""" - edges: [RepositoryTargetEdge]! - totalCount: Int -} - -"""A Relay edge containing a `RepositoryTarget` and its cursor.""" -type RepositoryTargetEdge { - """The item at the end of the edge""" - node: RepositoryTarget - - """A cursor for use in pagination""" - cursor: String! -} - -"""Namespace containing all the reports available for an `Repository`""" -type RepositoryReportsNamespace { - owaspTop10: OwaspTop10Report! - sansTop25: SansTop25Report! - misraC: MisraCReport! - codeHealthTrend: CodeHealthTrendReport! - issueDistribution: IssueDistributionReport! - issuesPrevented: IssuesPreventedReport! - issuesAutofixed: IssuesAutofixedReport! -} - -"""A Metric's manifestation specific to a repository.""" -type RepositoryMetric implements MetricDefinition { - """The metric's name.""" - name: String! - - """The metric's unique identifier.""" - shortcode: MetricShortcode! - - """The metric's description in markdown format.""" - description: String! - - """Direction which can be considered positive for the metric.""" - positiveDirection: Direction! - - """Unit suffix to apply to the metric value.""" - unit: String - - """Lower bound for the metric value.""" - minValueAllowed: Int - - """Upper bound for the metric value.""" - maxValueAllowed: Int - - """Whether this metric is enabled for reporting in the repository.""" - isReported: Boolean! - - """ - Whether to fail checks when thresholds are not met for the metric in the repository. - """ - isThresholdEnforced: Boolean! - - """Items in the repository metric.""" - items: [RepositoryMetricItem!]! -} - -"""An item in the `RepositoryMetric`.""" -type RepositoryMetricItem implements MaskPrimaryKeyNode { - """The ID of the object""" - id: ID! - - """Distinct key representing the metric in the repository.""" - key: MetricKey! - - """ - Threshold value for the metric, customizable by the user. Null if no threshold is set. - """ - threshold: Int - - """ - Latest value captured for this metric on the repository's default branch. - """ - latestValue: Float - - """ - Latest value captured for this metric on the repository's default branch. Suffixed with the unit and returned as a human-readable string. - """ - latestValueDisplay: String - - """ - The status of the threshold condition for the latest metric value on the repository's default branch. - """ - thresholdStatus: MetricThresholdStatus - - """ - All values captured for this metric in the repository's default branch. - """ - values(offset: Int, before: String, after: String, first: Int, last: Int, commitOidIn: [String]): MetricValueConnection -} - -"""Represents the key for which the metric is recorded in a repository.""" -enum MetricKey { - AGGREGATE - C_AND_CPP - CSHARP - GO - JAVA - JAVASCRIPT - PHP - PYTHON - RUBY - RUST - SCALA - KOTLIN - SWIFT -} - -""" -Represents the status of the threshold condition for a particular metric value. -""" -enum MetricThresholdStatus { - PASSING - FAILING -} - -type MetricValueConnection { - """Pagination data for this connection.""" - pageInfo: PageInfo! - - """Contains the nodes in this connection.""" - edges: [MetricValueEdge]! - totalCount: Int -} - -"""A Relay edge containing a `MetricValue` and its cursor.""" -type MetricValueEdge { - """The item at the end of the edge""" - node: MetricValue - - """A cursor for use in pagination""" - cursor: String! -} - -"""An individual value captured for a RepositoryMetric.""" -type MetricValue implements MaskPrimaryKeyNode { - """The ID of the object""" - id: ID! - - """Metric value reported by the analyzer.""" - value: Float! - - """Value suffixed with the unit of the metric.""" - valueDisplay: String! - - """ - Threshold value for the metric when this value was reported. Null if no threshold was set. - """ - threshold: Int - - """The status of the threshold condition for the metric value.""" - thresholdStatus: MetricThresholdStatus - - """Commit SHA for which this value was recorded on the repository.""" - commitOid: String! - - """The time at which the value was captured.""" - createdAt: DateTime! -} - -type IgnoreRuleConnection { - """Pagination data for this connection.""" - pageInfo: PageInfo! - - """Contains the nodes in this connection.""" - edges: [IgnoreRuleEdge]! - totalCount: Int -} - -"""A Relay edge containing a `IgnoreRule` and its cursor.""" -type IgnoreRuleEdge { - """The item at the end of the edge""" - node: IgnoreRule - - """A cursor for use in pagination""" - cursor: String! -} - -""" -An `IgnoreRule` defines the condition on which to suppress an `Issue`'s `Occurrence`s in a `Repository`. -""" -type IgnoreRule implements MaskPrimaryKeyNode { - createdAt: DateTime! - - """The ID of the object""" - id: ID! - - """Ignore level of the rule.""" - level: IgnoreRuleLevel! - - """Ignore type of the rule.""" - type: IgnoreRuleType! - - """The `Issue` to ignore in the rule.""" - issue: Issue! - - """File path if rule is on `FILE` level.""" - filePath: String - - """Glob pattern if rule is of `PATTERN` type.""" - globPattern: String -} - -""" -Represents the level of an `IgnoreRule`. -- `REPOSITORY`: suppress the issue for all files in the repository. -- `FILE`: suppress the issue for the given file path in the repository. -""" -enum IgnoreRuleLevel { - REPOSITORY - FILE -} - -""" -Represents the type of an `IgnoreRule`. -- `FOREVER`: suppress the issue in the repository always. -- `PATTERN`: suppress the issue occurrences matching the given glob pattern in the repository. -- `TEST_PATTERN`: suppress the issue occurrences matching the repository's specified test patterns in the repository. -""" -enum IgnoreRuleType { - FOREVER - PATTERN - TEST_PATTERN -} - -""" -Configuration for an `IssueCategory` in a `Repository`. Also known as Quality Gates. -""" -type IssueCategorySetting { - """An `IssueCategory`.""" - category: IssueCategory! - - """ - Whether issues of given category are enabled for reporting in the repository. - """ - isReported: Boolean! - - """ - Whether to fail checks when occurrence(s) of issues of given category are found in the repository. - """ - canFailCheck: Boolean! -} - -"""Configuration for an `IssuePriorityType` in a `Repository`.""" -type IssuePrioritySetting { - """A `IssuePriority`.""" - priorityType: IssuePriorityType! - - """ - Whether issues of given priority are enabled for reporting in the repository. - """ - isReported: Boolean! - - """ - Whether to fail checks when occurrence(s) of issues of given priority are found in the repository. - """ - canFailCheck: Boolean! -} - -"""Enum for issue priority type.""" -enum IssuePriorityType { - LOW - MEDIUM - HIGH -} - -""" -Configuration for a `Metric` in a `Repository`. Also known as Quality Gates. -""" -type MetricSetting { - """The metric's unique identifier.""" - metricShortcode: MetricShortcode! - - """Whether the metric is enabled for reporting in the repository.""" - isReported: Boolean! - - """ - Whether to fail checks when the metric's thresholds are not met in the repository. - """ - isThresholdEnforced: Boolean! -} - -""" -Leverages the internal Python implementation of UUID (uuid.UUID) to provide native UUID objects -in fields, resolvers and input. -""" -scalar UUID - -"""An enumeration.""" -enum AnalysisRunStatus { - PENDING - SUCCESS - FAILURE - TIMEOUT - CANCEL - READY - SKIPPED -} - -type AnalysisRunSummary { - """Number of issues introduced during this analysis run""" - occurrencesIntroduced: Int - - """Number of issues marked as resolved in this analysis run""" - occurrencesResolved: Int - - """Number of issues marked as suppressed in this analysis run""" - occurrencesSuppressed: Int - - """Number of vulnerabilities introduced in this run""" - vulnerabilitiesIntroduced: Int - occurrenceDistributionByAnalyzer: [OccurrenceDistributionByAnalyzer] - occurrenceDistributionByCategory: [OccurrenceDistributionByCategory] -} - -type OccurrenceDistributionByAnalyzer { - """Shortcode of the analyzer""" - analyzerShortcode: String! - - """Number of issues detected by the analyzer""" - introduced: Int! -} - -type OccurrenceDistributionByCategory { - """Category of the issue""" - category: IssueCategory! - - """Number of issues detected that belong to this category""" - introduced: Int! -} - -type CheckConnection { - """Pagination data for this connection.""" - pageInfo: PageInfo! - - """Contains the nodes in this connection.""" - edges: [CheckEdge]! - totalCount: Int -} - -"""A Relay edge containing a `Check` and its cursor.""" -type CheckEdge { - """The item at the end of the edge""" - node: Check - - """A cursor for use in pagination""" - cursor: String! -} - -"""A single analyzer check as part of an analysis run.""" -type Check implements MaskPrimaryKeyNode { - """The ID of the object""" - id: ID! - - """Sequence number of the check in the analysis run it belongs to.""" - sequence: Int! - - """The current status of the check.""" - status: CheckStatus! - - """The analyzer related to the check.""" - analyzer: Analyzer! - - """Time when the check was created.""" - createdAt: DateTime! - - """Time when the check was last modified.""" - updatedAt: DateTime! - - """Time when the check finished.""" - finishedAt: DateTime - - """Summary of the check.""" - summary: CheckSummary! - - """Issue occurrences found in the check.""" - occurrences(offset: Int, before: String, after: String, first: Int, last: Int, analyzerIn: [String]): OccurrenceConnection! @deprecated(reason: "Use 'issues' field instead. The 'issues' field returns both static analysis and AI review issues with filtering support.") - - """List of DeepSource metrics captured in the check.""" - metrics: [RepositoryMetric!] - - """All issues found in this check.""" - issues( - source: AnalysisIssueSource - category: IssueCategory - severity: IssueSeverity - - """Filter by shortcode. Only applies to STATIC issues.""" - q: String - before: String - after: String - first: Int - last: Int - ): AnalysisIssueConnection -} - -"""An enumeration.""" -enum CheckStatus { - WAITING - PENDING - SUCCESS - FAILURE - TIMEOUT - CANCEL - READY - NEUTRAL - ARTIFACT_TIMEOUT - SKIPPED -} - -"""Summary of a check.""" -type CheckSummary { - """Number of issues introduced in the check.""" - occurrencesIntroduced: Int - - """Number of issues resolved in the check.""" - occurrencesResolved: Int - - """Number of issues marked as suppressed in the check.""" - occurrencesSuppressed: Int - - """The issue category distribution for the check.""" - occurrenceDistributionByCategory: [OccurrenceDistributionByCategory] -} - -"""Connection for paginated analysis issues.""" -type AnalysisIssueConnection { - """Pagination data for this connection.""" - pageInfo: PageInfo! - - """Contains the nodes in this connection.""" - edges: [AnalysisIssueEdge]! - - """Total number of issues matching the filter.""" - totalCount: Int -} - -"""A Relay edge containing a `AnalysisIssue` and its cursor.""" -type AnalysisIssueEdge { - """The item at the end of the edge""" - node: AnalysisIssue - - """A cursor for use in pagination""" - cursor: String! -} - -"""Code quality report card for an analysis run.""" -type RunReport implements MaskPrimaryKeyNode { - """The ID of the object""" - id: ID! - createdAt: DateTime! - modifiedAt: DateTime! - - """Current status of the report.""" - status: RunReportStatus! - - """Security dimension score.""" - security: RunReportDimension - - """Reliability dimension score.""" - reliability: RunReportDimension - - """Complexity dimension score.""" - complexity: RunReportDimension - - """Code hygiene dimension score.""" - hygiene: RunReportDimension - - """Test coverage metrics.""" - coverage: RunReportCoverage - - """Aggregate score across all dimensions.""" - aggregate: RunReportAggregate - - """Analysis run metadata.""" - meta: RunReportMetadata - - """Suggested focus area for improvement.""" - focusArea: RunReportFocusArea -} - -"""Status of the Run Report""" -enum RunReportStatus { - IN_PROGRESS - RECOMPUTE - COMPLETED - PENDING -} - -"""A code quality dimension score (e.g., security, reliability).""" -type RunReportDimension { - """Letter grade (A, B, C, or D).""" - grade: RunReportGrade! - - """Numeric score (0-100).""" - score: Int! - - """Number of issues in this dimension.""" - issuesCount: Int! - - """Human-readable summary of the dimension.""" - summary: String -} - -"""Letter grade for a report dimension""" -enum RunReportGrade { - A - B - C - D -} - -"""Test coverage metrics for an analysis run.""" -type RunReportCoverage { - """Letter grade (A, B, C, or D).""" - grade: RunReportGrade - - """Numeric coverage score (0-100).""" - score: Int - - """Percentage of lines covered by tests.""" - lineCoverage: Float - - """Percentage of branches covered by tests.""" - branchCoverage: Float -} - -"""Aggregate code quality score across all dimensions.""" -type RunReportAggregate { - """Overall letter grade (A, B, C, or D).""" - grade: RunReportGrade! - - """Overall numeric score (0-100).""" - score: Int! -} - -"""Metadata about the analysis run scope and limits.""" -type RunReportMetadata { - """Number of lines analyzed.""" - linesChanged: Int! - - """Number of files analyzed.""" - filesChanged: Int! - - """ - Whether the aggregate grade was capped due to critical or security issues. - """ - capped: Boolean! - - """Reason for grade capping.""" - capReason: String -} - -"""Suggested area to focus on for code quality improvement.""" -type RunReportFocusArea { - """The dimension to focus on improving.""" - dimension: String - - """Recommended action to take.""" - action: String -} - -type SCACheckConnection { - """Pagination data for this connection.""" - pageInfo: PageInfo! - - """Contains the nodes in this connection.""" - edges: [SCACheckEdge]! - totalCount: Int -} - -"""A Relay edge containing a `SCACheck` and its cursor.""" -type SCACheckEdge { - """The item at the end of the edge""" - node: SCACheck - - """A cursor for use in pagination""" - cursor: String! -} - -""" -A single SCA (Software Composition Analysis) check as part of an analysis run. -""" -type SCACheck implements MaskPrimaryKeyNode { - """The ID of the object""" - id: ID! - - """Sequence number of the SCA check in the analysis run it belongs to.""" - sequence: Int! - - """The current status of the SCA check.""" - status: SCACheckStatus! - - """The repository target for which this SCA check was performed.""" - target: RepositoryTarget - - """Time when the SCA check was created.""" - createdAt: DateTime! - - """Time when the SCA check was last modified.""" - updatedAt: DateTime! - - """Time when the SCA check finished.""" - finishedAt: DateTime - - """Summary of the SCA check.""" - summary: SCACheckSummary! - - """Vulnerability occurrences found in the SCA check.""" - vulnerabilityOccurrences(offset: Int, before: String, after: String, first: Int, last: Int): VulnerabilityOccurrenceConnection! -} - -"""An enumeration.""" -enum SCACheckStatus { - WAITING - PENDING - SUCCESS - FAILURE - TIMEOUT - CANCEL - READY - NEUTRAL - ARTIFACT_TIMEOUT - SKIPPED -} - -"""Summary of an SCA check.""" -type SCACheckSummary { - """Number of vulnerabilities introduced in the check.""" - vulnerabilitiesIntroduced: Int -} - -type Query { - """The currently authenticated user.""" - viewer: User - - """Lookup a transformer by its shortcode.""" - transformer( - """Shortcode of the transformer.""" - shortcode: String! - ): Transformer @deprecated(reason: "Use `codeFormatter` instead") - - """List all transformers with optional filtering.""" - transformers(offset: Int, before: String, after: String, first: Int, last: Int, name_Icontains: String): TransformerConnection @deprecated(reason: "Use `codeFormatters` instead") - - """Lookup a repository on DeepSource using it's name and VCS provider.""" - repository( - """The name of the repository to lookup.""" - name: String! - - """ - The login or username of the account under which the repository exists. - """ - login: String! - - """VCS Provider of the repository.""" - vcsProvider: VCSProvider! - ): Repository - - """The DeepSource installation.""" - installation: Installation - - """Lookup a code formatter by its shortcode.""" - codeFormatter( - """Shortcode of the code formatter.""" - shortcode: String! - ): CodeFormatter - - """List all code formatters with optional filtering.""" - codeFormatters(offset: Int, before: String, after: String, first: Int, last: Int, name_Icontains: String): CodeFormatterConnection - - """Get an analyzer from its shortcode.""" - analyzer( - """Shortcode of the analyzer you'd like to get.""" - shortcode: String! - ): Analyzer - - """Get all analyzers available on DeepSource.""" - analyzers(offset: Int, before: String, after: String, first: Int, last: Int): AnalyzerConnection - - """Fetch an AnalysisRun object from it's UID or commit OID.""" - run( - """UID of the Analysis Run you want to get.""" - runUid: UUID - - """Commit OID of the Analysis Run you want to get.""" - commitOid: String - ): AnalysisRun! - - """ - An account on DeepSource (individual or team). A user can add multiple accounts from multiple VCS providers. - """ - account( - """The login or username to lookup the account by.""" - login: String! - - """VCS Provider of the account.""" - vcsProvider: VCSProvider! - ): Account - node( - """The ID of the object""" - id: ID! - ): MaskPrimaryKeyNode -} - -"""A transformer on DeepSource.""" -type Transformer implements MaskPrimaryKeyNode { - analyzer: Analyzer - exampleConfig: String - - """Name of the tool.""" - name: String! - - """Unique identifier for this tool globally.""" - shortcode: String! - - """Verbose description, written in Markdown.""" - description: String! - - """The ID of the object""" - id: ID! - logo: String -} - -type TransformerConnection { - """Pagination data for this connection.""" - pageInfo: PageInfo! - - """Contains the nodes in this connection.""" - edges: [TransformerEdge]! - totalCount: Int -} - -"""A Relay edge containing a `Transformer` and its cursor.""" -type TransformerEdge { - """The item at the end of the edge""" - node: Transformer - - """A cursor for use in pagination""" - cursor: String! -} - -"""The DeepSource installation.""" -type Installation implements MaskPrimaryKeyNode { - """The name of the installation.""" - name: String! - - """The ID of the object""" - id: ID! - - """The logo URL of the installation.""" - logo: String! -} - -"""A code formatter on DeepSource.""" -type CodeFormatter implements MaskPrimaryKeyNode { - analyzer: Analyzer - exampleConfig: String - - """Name of the tool.""" - name: String! - - """Unique identifier for this tool globally.""" - shortcode: String! - - """Verbose description, written in Markdown.""" - description: String! - - """The ID of the object""" - id: ID! - logo: String -} - -type CodeFormatterConnection { - """Pagination data for this connection.""" - pageInfo: PageInfo! - - """Contains the nodes in this connection.""" - edges: [CodeFormatterEdge]! - totalCount: Int -} - -"""A Relay edge containing a `CodeFormatter` and its cursor.""" -type CodeFormatterEdge { - """The item at the end of the edge""" - node: CodeFormatter - - """A cursor for use in pagination""" - cursor: String! -} - -type Mutation { - """ - Suppress an issue from an Analyzer on the team level, affecting all repositories. - """ - suppressIssueForTeam(input: SuppressIssueForTeamInput!): SuppressIssueForTeamPayload - - """ - Remove a suppressed issue from an Analyzer on the team level, affecting all repositories. - """ - unsuppressIssueForTeam(input: UnsuppressIssueForTeamInput!): UnsuppressIssueForTeamPayload - - """Update the threshold for a metric in a repository.""" - setRepositoryMetricThreshold(input: SetRepositoryMetricThresholdInput!): SetRepositoryMetricThresholdPayload - - """Regenerate a repository's DSN.""" - regenerateRepositoryDSN(input: RegenerateRepositoryDSNInput!): RegenerateRepositoryDSNPayload - - """ - Update a repository's default branch for baseline. If the repository is activated, this action will trigger a new analysis. Only available to users with `WRITE` permission on the repository. - """ - updateRepositoryDefaultBranch(input: UpdateRepositoryDefaultBranchInput!): UpdateRepositoryDefaultBranchPayload - - """Update the configuration for an issue category in a repository.""" - updateRepositoryIssueCategorySetting(input: UpdateRepositoryIssueCategorySettingInput!): UpdateRepositoryIssueCategorySettingPayload - - """Update the configuration for an issue priority in a repository.""" - updateRepositoryIssuePrioritySetting(input: UpdateRepositoryIssuePrioritySettingInput!): UpdateRepositoryIssuePrioritySettingPayload - - """Update the configuration for a metric in a repository.""" - updateRepositoryMetricSetting(input: UpdateRepositoryMetricSettingInput!): UpdateRepositoryMetricSettingPayload - - """ - Activate a repository. Only available to users with `WRITE` permission on the repository. - """ - activateRepository(input: ActivateRepositoryInput!): ActivateRepositoryPayload - - """ - Deactivate a repository. Only available to users with `WRITE` permission on the repository. - """ - deactivateRepository(input: DeactivateRepositoryInput!): DeactivateRepositoryPayload - revokeToken(refreshToken: String): Revoke - verifyToken(token: String): Verify - refreshToken(refreshToken: String): Refresh - - """ - Generates a unique device verification code and an end-user code that are - valid for a limited time. - """ - registerDevice(input: RegisterDeviceInput!): RegisterDevicePayload - - """ - Validates the device code provided and responds with the user's PAT. - If there's no PAT associated with the user, create one. If the user - has no access, return an error. Otherwise, indicate the client to keep - polling. - """ - requestPatWithDeviceCode(input: RequestPATWithDeviceCodeInput!): RequestPATWithDeviceCodePayload - refreshPat: RefreshPAT - revokePat: RevokePAT -} - -""" -Suppress an issue from an Analyzer on the team level, affecting all repositories. -""" -type SuppressIssueForTeamPayload { - ok: Boolean - clientMutationId: String -} - -input SuppressIssueForTeamInput { - """The issue's shortcode.""" - issueShortcode: String! - - """The login or username of the account/team.""" - login: String! - - """The VCS provider of the account/team.""" - vcsProvider: VCSProvider! - clientMutationId: String -} - -""" -Remove a suppressed issue from an Analyzer on the team level, affecting all repositories. -""" -type UnsuppressIssueForTeamPayload { - ok: Boolean - clientMutationId: String -} - -input UnsuppressIssueForTeamInput { - """The issue's shortcode.""" - issueShortcode: String! - - """The login or username of the account/team.""" - login: String! - - """The VCS provider of the account/team.""" - vcsProvider: VCSProvider! - clientMutationId: String -} - -"""Update the threshold for a metric in a repository.""" -type SetRepositoryMetricThresholdPayload { - ok: Boolean - clientMutationId: String -} - -input SetRepositoryMetricThresholdInput { - """GraphQL node ID of the repository.""" - repositoryId: ID! - - """Metric shortcode to update the threshold for.""" - metricShortcode: MetricShortcode! - - """The key of the metric you want to update the threshold for.""" - metricKey: MetricKey! - - """Threshold value to set. Can be null.""" - thresholdValue: Int - clientMutationId: String -} - -type RegenerateRepositoryDSNPayload { - """The new DSN for the repository.""" - dsn: String! - clientMutationId: String -} - -input RegenerateRepositoryDSNInput { - """GraphQL node ID of the repository.""" - repositoryId: ID! - clientMutationId: String -} - -type UpdateRepositoryDefaultBranchPayload { - ok: Boolean! - repository: Repository! - clientMutationId: String -} - -input UpdateRepositoryDefaultBranchInput { - """GraphQL node ID of the repository.""" - id: ID! - - """Default branch for analysis on the repository.""" - defaultBranchName: String! - clientMutationId: String -} - -type UpdateRepositoryIssueCategorySettingPayload { - ok: Boolean! - clientMutationId: String -} - -input UpdateRepositoryIssueCategorySettingInput { - """The repository's ID.""" - repositoryId: ID! - - """The issue category you want to update.""" - issueCategory: IssueCategory! - - """ - Whether issues of given category are enabled for reporting in the repository. - """ - isReported: Boolean! - - """ - Whether to fail checks when occurrence(s) of issues of given category are found in the repository. An issue category can only be marked to fail a check if it is enabled for reporting. - """ - canFailCheck: Boolean! - clientMutationId: String -} - -type UpdateRepositoryIssuePrioritySettingPayload { - ok: Boolean! - clientMutationId: String -} - -input UpdateRepositoryIssuePrioritySettingInput { - """The repository's ID.""" - repositoryId: ID! - - """The issue priority you want to update.""" - issuePriorityType: IssuePriorityType! - - """ - Whether issues of given priority are enabled for reporting in the repository. - """ - isReported: Boolean! - - """ - Whether to fail checks when occurrence(s) of issues of given priority are found in the repository. - """ - canFailCheck: Boolean! - clientMutationId: String -} - -type UpdateRepositoryMetricSettingPayload { - ok: Boolean! - clientMutationId: String -} - -input UpdateRepositoryMetricSettingInput { - """The repository's ID.""" - repositoryId: ID! - - """The metric to update.""" - metricShortcode: MetricShortcode! - - """Whether the metric is enabled for reporting in the repository.""" - isReported: Boolean! - - """Whether to fail checks when the metric does not meet the threshold.""" - isThresholdEnforced: Boolean! - clientMutationId: String -} - -type ActivateRepositoryPayload { - """Whether the repository has been activated successfully""" - ok: Boolean! - clientMutationId: String -} - -input ActivateRepositoryInput { - """The repository's ID.""" - repositoryId: ID! - clientMutationId: String -} - -type DeactivateRepositoryPayload { - """Whether the repository has been deactivated successfully""" - ok: Boolean! - clientMutationId: String -} - -input DeactivateRepositoryInput { - """The repository's ID.""" - repositoryId: ID! - clientMutationId: String -} - -type Revoke { - revoked: Int! -} - -type Verify { - payload: GenericScalar! -} - -""" -The `GenericScalar` scalar type represents a generic -GraphQL scalar value that could be: -String, Boolean, Int, Float, List or Object. -""" -scalar GenericScalar - -type Refresh { - payload: GenericScalar! - refreshExpiresIn: Int! - token: String! - refreshToken: String! -} - -""" -Generates a unique device verification code and an end-user code that are -valid for a limited time. -""" -type RegisterDevicePayload { - """The device verification code.""" - deviceCode: String - - """The end-user verification code.""" - userCode: String - - """The end-user verification URI.""" - verificationUri: String - - """A verification URI that includes the 'user_code'.""" - verificationUriComplete: String - - """The lifetime in seconds of the 'device_code' and 'user_code'.""" - expiresIn: Int - - """ - The minimum amount of time in seconds that the client should wait between polling requests to the token endpoint. - """ - interval: Int - clientMutationId: String -} - -input RegisterDeviceInput { - deviceType: DeviceType = CLI - clientMutationId: String -} - -"""The device type that is being registered.""" -enum DeviceType { - CLI - IDE -} - -""" -Validates the device code provided and responds with the user's PAT. -If there's no PAT associated with the user, create one. If the user -has no access, return an error. Otherwise, indicate the client to keep -polling. -""" -type RequestPATWithDeviceCodePayload { - """The personal access token corresponding to the device_code""" - token: String - - """Expiry of the token, in unix time""" - expiry: DateTime - user: User - clientMutationId: String -} - -input RequestPATWithDeviceCodeInput { - deviceCode: String! - description: String - clientMutationId: String -} - -type RefreshPAT { - """The personal access token corresponding to the device_code""" - token: String - - """Expiry of the token, in unix time""" - expiry: DateTime - user: User -} - -type RevokePAT { - """Indication whether revoking of personal access token was successful""" - ok: Boolean -} \ No newline at end of file