UNPKG

pastoralist

Version:

A tool to watch over node module resolutions and overrides

83 lines (82 loc) 5.34 kB
import type { DependabotAlert, PromptChoice, ProviderConfig, SecurityAlert, SetupSecurityProvider, Severity } from "./types"; export declare const DEFAULT_CLI_TIMEOUT = 30000; export declare const DEFAULT_INSTALL_TIMEOUT = 120000; export declare const DEFAULT_PROMPT_TIMEOUT = 60000; export declare const DEFAULT_FETCH_TIMEOUT = 30000; export declare const DEFAULT_GH_CLI_TIMEOUT = 60000; export declare const DEFAULT_SNYK_SCAN_TIMEOUT = 60000; export declare const DEFAULT_AUDIT_TIMEOUT = 120000; export declare const PROMPT_SELECT_MAX_ATTEMPTS = 5; export declare const OSV_DETAIL_CONCURRENCY = 5; export declare const OSV_CACHE_MAX_ENTRIES = 500; export declare const GITHUB_TOKEN_URL = "https://github.com/settings/tokens"; export declare const SNYK_TOKEN_URL = "https://app.snyk.io/account"; export declare const SOCKET_TOKEN_URL = "https://socket.dev/dashboard/api-keys"; export declare const SPEKTION_TOKEN_URL = "https://spektion.com"; export declare const AUTH_MESSAGES: { readonly GITHUB_CLI_NOT_FOUND: "GitHub CLI not found and no GITHUB_TOKEN provided. Please install gh CLI or set GITHUB_TOKEN environment variable. Create a token at: https://github.com/settings/tokens"; readonly SNYK_AUTH_REQUIRED: "Snyk requires authentication. Set SNYK_TOKEN or provide --securityProviderToken. Create a token at: https://app.snyk.io/account"; readonly SOCKET_AUTH_REQUIRED: "Socket requires authentication. Set SOCKET_SECURITY_API_KEY or provide --securityProviderToken. Create an API key at: https://socket.dev/dashboard/api-keys"; readonly SPEKTION_AUTH_REQUIRED: "Spektion requires authentication. Set SPEKTION_API_KEY or provide --securityProviderToken. Get an API key at: https://spektion.com"; }; export declare const KNOWN_PROVIDERS: readonly ["github", "snyk", "socket", "osv", "npm", "spektion"]; export declare const PROVIDER_CONFIGS: Record<SetupSecurityProvider, ProviderConfig>; export declare const SETUP_MESSAGES: { readonly OSV_NO_SETUP: "OSV requires no setup - you're good to go!"; readonly TOKEN_VALID: "Token is valid!"; readonly TOKEN_VALIDATION_FAILED: "Token validation failed."; readonly VALIDATING: "Validating token..."; readonly NO_TOKEN: "No token provided"; readonly BROWSER_OPENED: "Browser opened. Create your token there."; readonly TOKEN_TIP: "Tip: The token will be hidden as you type for security."; readonly SAVE_PROMPT: "Save token to your shell profile for future use?"; readonly PLAINTEXT_WARNING: "Note: This saves the token as plaintext in your shell profile."; readonly SESSION_ONLY: "Token set for this session. Set {envVar} in your environment to persist."; readonly SAVED_TO_PROFILE: "Token saved to shell profile. Restart your terminal or run 'source ~/.zshrc' to use it globally."; readonly CHECK_ITEMS: readonly ["The token was copied correctly", "The token has the required permissions"]; }; export declare const GH_MESSAGES: { readonly READY: "GitHub CLI is installed and authenticated!"; readonly USING_CLI: "Using GitHub CLI for authentication"; readonly NOT_AUTHED: "GitHub CLI is installed but not authenticated."; readonly AUTH_PROMPT: "Would you like to authenticate with GitHub CLI? (recommended)"; readonly NOT_INSTALLED: "GitHub CLI (gh) is not installed."; readonly HOW_TO_AUTH: "How would you like to authenticate with GitHub?"; readonly OPT_INSTALL: "Install GitHub CLI (recommended)"; readonly OPT_TOKEN: "Use a Personal Access Token"; readonly OPT_SKIP: "Skip setup"; readonly SKIPPED: "Setup skipped"; readonly STARTING: "Starting GitHub CLI authentication..."; readonly BROWSER_INFO: "This will open a browser for you to authenticate."; readonly SUCCESS: "GitHub CLI authenticated successfully!"; readonly VIA_CLI: "Authenticated via GitHub CLI"; readonly INCOMPLETE: "GitHub CLI authentication did not complete."; readonly FAILED: "GitHub CLI auth failed"; readonly INSTALLING: "Installing GitHub CLI..."; readonly BREW_CMD: "Running: brew install gh"; readonly INSTALLED: "GitHub CLI installed!"; readonly INSTALL_FAILED: "Failed to install GitHub CLI automatically."; readonly MANUAL_INSTALL: `Install manually: ${string}`; readonly LINUX_INSTALL: `Install manually: ${string}`; }; export declare const VALIDATION_ENDPOINTS: { readonly github: "https://api.github.com/user"; readonly snyk: "https://api.snyk.io/rest/self"; readonly socket: "https://api.socket.dev/v0/organizations"; }; export declare const OSV_API: { readonly BASE: "https://api.osv.dev/v1"; readonly QUERY: "https://api.osv.dev/v1/query"; readonly QUERY_BATCH: "https://api.osv.dev/v1/querybatch"; readonly VULN: (id: string) => string; }; export declare const OSV_IRL_FIX_ALERT: SecurityAlert; export declare const OSV_IRL_CATCH_ALERT: SecurityAlert; export declare const SPEKTION_API: { readonly SCAN: "https://api.spektion.com/v1/scan"; }; export declare const SEVERITY_MAP: Record<string, Severity>; export declare const CONFIDENCE_WEIGHTS: Record<"confirmed" | "possible", number>; export declare const SECURITY_SUMMARY_SEVERITIES: readonly ["critical", "high", "medium", "low"]; export declare const SECURITY_ACTION_CHOICES: PromptChoice[]; export declare const GITHUB_DEFAULT_MOCK_ALERTS: DependabotAlert[];