123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427 |
- import type {Theme} from '@emotion/react';
- import type {FocusTrap} from 'focus-trap';
- import type {exportedGlobals} from 'sentry/bootstrap/exportGlobals';
- import type {ParntershipAgreementType} from 'sentry/types/hooks';
- import type {User} from './user';
- export enum SentryInitRenderReactComponent {
- INDICATORS = 'Indicators',
- SETUP_WIZARD = 'SetupWizard',
- SYSTEM_ALERTS = 'SystemAlerts',
- U2F_SIGN = 'U2fSign',
- SU_STAFF_ACCESS_FORM = 'SuperuserStaffAccessForm',
- }
- export type OnSentryInitConfiguration =
- | {
- element: string;
- input: string;
- name: 'passwordStrength';
- }
- | {
- component: SentryInitRenderReactComponent;
- container: string;
- name: 'renderReact';
- props?: Record<string, any>;
- }
- | {
- name: 'onReady';
- onReady: (globals: typeof exportedGlobals) => void;
- };
- declare global {
- interface Window {
- /**
- * Primary entrypoint for rendering the sentry app. This is typically
- * called in the django templates, or in the case of the EXPERIMENTAL_SPA,
- * after config hydration.
- */
- SentryRenderApp: () => void;
- /**
- * Used to close tooltips for testing purposes.
- */
- __closeAllTooltips: () => void;
- /**
- * The config object provided by the backend.
- */
- __initialData: Config;
- /**
- * This allows our server-rendered templates to push configuration that should be
- * run after we render our main application.
- *
- * An example of this is dynamically importing the `passwordStrength` module only
- * on the organization login page.
- */
- __onSentryInit:
- | OnSentryInitConfiguration[]
- | {
- push: (config: OnSentryInitConfiguration) => void;
- };
- /**
- * Used to open tooltips for testing purposes.
- */
- __openAllTooltips: () => void;
- /**
- * Pipeline
- */
- __pipelineInitialData: PipelineInitialData;
- /**
- * Assets public location
- */
- __sentryGlobalStaticPrefix: string;
- /**
- * Is populated with promises/strings of commonly used data.
- */
- __sentry_preload: Record<string, any>;
- // typing currently used for demo add on
- // TODO: improve typing
- SentryApp?: {
- ConfigStore: any;
- HookStore: any;
- Modal: any;
- getModalPortal: () => HTMLElement;
- modalFocusTrap?: {
- current?: FocusTrap;
- };
- };
- /**
- * Is the UI running as dev-ui proxy.
- * Used by webpack-devserver + html-webpack
- */
- __SENTRY_DEV_UI?: boolean;
- /**
- * Sentrys version string
- */
- __SENTRY__VERSION?: string;
- /**
- * Set to true if adblock could be installed.
- * See sentry/js/ads.js for how this global is disabled.
- */
- adblockSuspected?: boolean;
- /**
- * The CSRF cookie used on the backend
- */
- csrfCookieName?: string;
- sentryEmbedCallback?: ((embed: any) => void) | null;
- /**
- * The domain of which the superuser cookie is set onto.
- */
- superUserCookieDomain?: string;
- /**
- * The superuser cookie used on the backend
- */
- superUserCookieName?: string;
- }
- }
- export interface Region {
- name: string;
- url: string;
- }
- interface CustomerDomain {
- organizationUrl: string | undefined;
- sentryUrl: string;
- subdomain: string;
- }
- export interface Config {
- apmSampling: number;
- csrfCookieName: string;
- customerDomain: CustomerDomain | null;
- demoMode: boolean;
- disableU2FForSUForm: boolean;
- distPrefix: string;
- dsn: string;
- enableAnalytics: boolean;
- features: Set<string>;
- gravatarBaseUrl: string;
- initialTrace: {
- baggage: string;
- sentry_trace: string;
- };
- invitesEnabled: boolean;
- isAuthenticated: boolean;
- // Maintain isOnPremise key for backcompat (plugins?).
- isOnPremise: boolean;
- isSelfHosted: boolean;
- isSelfHostedErrorsOnly: boolean;
- languageCode: string;
- lastOrganization: string | null;
- links: {
- organizationUrl: string | undefined;
- regionUrl: string | undefined;
- sentryUrl: string;
- superuserUrl?: string;
- };
- // A list of regions that the user has membership in.
- memberRegions: Region[];
- /**
- * This comes from django (django.contrib.messages)
- */
- messages: {level: keyof Theme['alert']; message: string}[];
- needsUpgrade: boolean;
- privacyUrl: string | null;
- // The list of regions the user has has access to.
- regions: Region[];
- sentryConfig: {
- allowUrls: string[];
- dsn: string;
- release: string;
- tracePropagationTargets: string[];
- environment?: string;
- profilesSampleRate?: number;
- };
- shouldPreloadData: boolean;
- singleOrganization: boolean;
- superUserCookieDomain: string | null;
- superUserCookieName: string;
- supportEmail: string;
- termsUrl: string | null;
- theme: 'light' | 'dark';
- urlPrefix: string;
- /**
- * The user should not be accessible directly except during
- * app initialization. Use `useUser` or ConfigStore instead.
- * @deprecated
- */
- user: User;
- userIdentity: {
- email: string;
- id: string;
- ip_address: string;
- isStaff: boolean;
- };
- validateSUForm: boolean;
- version: {
- build: string;
- current: string;
- latest: string;
- upgradeAvailable: boolean;
- };
- partnershipAgreementPrompt?: {
- agreements: Array<ParntershipAgreementType>;
- partnerDisplayName: string;
- } | null;
- relocationConfig?: {
- selectableRegions: string[];
- };
- shouldShowBeaconConsentPrompt?: boolean;
- statuspage?: {
- api_host: string;
- id: string;
- };
- }
- export type PipelineInitialData = {
- name: string;
- props: Record<string, any>;
- };
- export type Broadcast = {
- cta: string;
- dateCreated: string;
- dateExpires: string;
- hasSeen: boolean;
- id: string;
- isActive: boolean;
- link: string;
- message: string;
- title: string;
- };
- // XXX(epurkhiser): The components list can be generated using jq
- //
- // curl -s https://status.sentry.io/api/v2/components.json \
- // | jq -r '
- // .components
- // | map({key: (.name | gsub( "[^a-zA-Z]"; "_") | ascii_upcase ), value:.id})
- // | map("\(.key) = \"\(.value)\",")
- // | .[]'
- // | sort
- /**
- * Mapping of components to IDs
- *
- * Should be kept in sync with https://status.sentry.io/api/v2/components.json
- */
- export const enum StatusPageComponent {
- ALERTING = 'sykq5vtjw8zx',
- API = 'qywmfv7jr0pd',
- AUTHENTICATION_SERVICES = 'f5rs5z9q0dtk',
- AZURE_DEVOPS = 'tn9py6p7f85x',
- CUSTOM_METRICS = '7wrqyj84ltw7',
- DASHBOARD = 'khtl9dcky3lb',
- ELECTRON_SYMBOL_SERVER = '3jzzl28504tq',
- EMAIL = 'tjmyq3lb26w0',
- EU_ATTACHMENT_INGESTION = 'ztwsc8ff50v9',
- EU_CRON_MONITORING = 'qnj485gffb6v',
- EU_ERRORS = 'yqdr3zmyjv12',
- EU_ERROR_INGESTION = '1yf02ms0qsl7',
- EU_INGESTION = 'xmpnd79f7t51',
- EU_PROFILE_INGESTION = 'xbljnbzl9c77',
- EU_REPLAY_INGESTION = '3zhbl35gmbp0',
- EU_SPAN_INGESTION = '7rv05jl5qp0w',
- EU_TRANSACTION_INGESTION = 'tlkrt7x46b52',
- GITHUB = 'lqps2hvc2400',
- GOOGLE = 'bprcc4mhbhmm',
- HEROKU = '6g5bq169xp2s',
- INTEGRATION_PIPELINE = '6gtdt9t60dl0',
- MICROSOFT_SYMBOL_SERVER = '216356jwwrxq',
- MICROSOFT_TEAMS = 'z57k9q3r5jsh',
- NOTIFICATION_DELIVERY = 'rmq51qyvxfjh',
- PAGERDUTY = 'jd3tvjnx5l1f',
- PASSWORD_BASED = 'ml2wmx3hzlnn',
- SAML_BASED_SINGLE_SIGN_ON = 'hsbnk3hxcckr',
- SLACK = 'jkpcsxvvv2hf',
- STRIPE = '87stwrsyk6ls',
- THIRD_PARTY_INTEGRATIONS = 'yhfrrcmppvgh',
- US_ATTACHMENT_INGESTION = 'cycj4r32g25w',
- US_CRON_MONITORING = '6f1r28lydc6h',
- US_ERRORS = 'bctv81yt9s6w',
- US_ERROR_INGESTION = '51yszynm4xyv',
- US_INGESTION = '76x1wwzzfj5c',
- US_PROFILE_INGESTION = '52t4t3ww2qcn',
- US_REPLAY_INGESTION = 'zxkxxtspk64g',
- US_SPAN_INGESTION = 'qd7tzrk5q8xm',
- US_TRANSACTION_INGESTION = 'bdg4djkxjxmk',
- }
- export type StatusPageServiceStatus =
- | 'operational'
- | 'degraded_performance'
- | 'major_outage'
- | 'partial_outage';
- export interface StatusPageIncidentComponent {
- /**
- * ISO 8601 component creation time
- */
- created_at: string;
- description: string;
- group: boolean;
- group_id: string;
- id: StatusPageComponent;
- name: string;
- only_show_if_degraded: boolean;
- page_id: string;
- position: number;
- showcase: boolean;
- /**
- * Date of the component becoming active
- */
- start_date: string;
- status: StatusPageServiceStatus;
- /**
- * ISO 8601 component update time
- */
- updated_at: string;
- }
- export interface StatusPageAffectedComponent {
- code: StatusPageComponent;
- name: string;
- new_status: StatusPageServiceStatus;
- old_status: StatusPageServiceStatus;
- }
- export interface StatusPageIncidentUpdate {
- /**
- * Components affected by the update
- */
- affected_components: StatusPageAffectedComponent[];
- /**
- * Message to display for this update
- */
- body: string;
- /**
- * ISO Update creation time
- */
- created_at: string;
- /**
- * ISO Update display time
- */
- display_at: string;
- /**
- * Unique ID of the incident
- */
- id: string;
- /**
- * Unique ID of the incident
- */
- incident_id: string;
- /**
- * Status of the incident for tihs update
- */
- status: 'resolved' | 'monitoring' | 'investigating';
- /**
- * ISO Update update time
- */
- updated_at: string;
- }
- // See: https://doers.statuspage.io/api/v2/incidents/
- export interface StatuspageIncident {
- /**
- * Components related to this incident
- */
- components: StatusPageIncidentComponent[];
- /**
- * ISO 8601 created time
- */
- created_at: string;
- /**
- * Unique ID of the incident
- */
- id: string;
- /**
- * The impact of the incident
- */
- impact: 'none' | 'minor' | 'major';
- /**
- * Updates for this incident
- */
- incident_updates: StatusPageIncidentUpdate[];
- /**
- * ISO 8601 time monitoring began
- */
- monitoring_at: string | undefined;
- /**
- * Name of the incident
- */
- name: string;
- /**
- * The status page page ID
- */
- page_id: string;
- /**
- * ISO 8601 last updated time
- */
- resolved_at: string | undefined;
- /**
- * Short URL of the incident
- */
- shortlink: string;
- /**
- * ISO 8601 incident start time
- */
- started_at: string | undefined;
- /**
- * Current status of the incident
- */
- status: 'resolved' | 'unresolved';
- /**
- * ISO 8601 last updated time
- */
- updated_at: string | undefined;
- }
- export type PromptActivity = {
- dismissedTime?: number;
- snoozedTime?: number;
- };
|