eventEntry.ts 812 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import {Image as ImageFixture} from 'sentry-fixture/image';
  2. import {
  3. type Entry as TEntry,
  4. type EntryDebugMeta as TEntryDebugMeta,
  5. type EntryRequest as TEntryRequest,
  6. EntryType,
  7. } from 'sentry/types';
  8. export function EventEntry(params = {}): TEntry {
  9. return {
  10. type: EntryType.MESSAGE,
  11. data: {
  12. formatted: 'Blocked script',
  13. },
  14. ...params,
  15. };
  16. }
  17. export function EntryRequest(params: Partial<TEntryRequest> = {}): TEntryRequest {
  18. return {
  19. type: EntryType.REQUEST,
  20. data: {
  21. apiTarget: null,
  22. method: 'GET',
  23. url: '/index',
  24. },
  25. ...params,
  26. };
  27. }
  28. export function EntryDebugMeta(params: Partial<TEntryDebugMeta> = {}): TEntryDebugMeta {
  29. return {
  30. type: EntryType.DEBUGMETA,
  31. data: {
  32. images: [ImageFixture()],
  33. },
  34. ...params,
  35. };
  36. }