package.build.esm.feedback.js.map Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core Show documentation
Show all versions of core Show documentation
Base implementation for all Sentry JavaScript SDKs
{"version":3,"file":"feedback.js","sources":["../../src/feedback.ts"],"sourcesContent":["import type { EventHint, FeedbackEvent, SendFeedbackParams } from '@sentry/types';\nimport { dropUndefinedKeys } from '@sentry/utils';\nimport { getClient, getCurrentScope } from './currentScopes';\n\n/**\n * Send user feedback to Sentry.\n */\nexport function captureFeedback(\n params: SendFeedbackParams,\n hint: EventHint & { includeReplay?: boolean } = {},\n scope = getCurrentScope(),\n): string {\n const { message, name, email, url, source, associatedEventId, tags } = params;\n\n const feedbackEvent: FeedbackEvent = {\n contexts: {\n feedback: dropUndefinedKeys({\n contact_email: email,\n name,\n message,\n url,\n source,\n associated_event_id: associatedEventId,\n }),\n },\n type: 'feedback',\n level: 'info',\n tags,\n };\n\n const client = (scope && scope.getClient()) || getClient();\n\n if (client) {\n client.emit('beforeSendFeedback', feedbackEvent, hint);\n }\n\n const eventId = scope.captureEvent(feedbackEvent, hint);\n\n return eventId;\n}\n"],"names":[],"mappings":";;;AAIA;AACA;AACA;AACO,SAAS,eAAe;AAC/B,EAAE,MAAM;AACR,EAAE,IAAI,GAA4C,EAAE;AACpD,EAAE,KAAM,GAAE,eAAe,EAAE;AAC3B,EAAU;AACV,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,iBAAiB,EAAE,IAAK,EAAA,GAAI,MAAM,CAAA;AAC/E;AACA,EAAE,MAAM,aAAa,GAAkB;AACvC,IAAI,QAAQ,EAAE;AACd,MAAM,QAAQ,EAAE,iBAAiB,CAAC;AAClC,QAAQ,aAAa,EAAE,KAAK;AAC5B,QAAQ,IAAI;AACZ,QAAQ,OAAO;AACf,QAAQ,GAAG;AACX,QAAQ,MAAM;AACd,QAAQ,mBAAmB,EAAE,iBAAiB;AAC9C,OAAO,CAAC;AACR,KAAK;AACL,IAAI,IAAI,EAAE,UAAU;AACpB,IAAI,KAAK,EAAE,MAAM;AACjB,IAAI,IAAI;AACR,GAAG,CAAA;AACH;AACA,EAAE,MAAM,MAAA,GAAS,CAAC,SAAS,KAAK,CAAC,SAAS,EAAE,KAAK,SAAS,EAAE,CAAA;AAC5D;AACA,EAAE,IAAI,MAAM,EAAE;AACd,IAAI,MAAM,CAAC,IAAI,CAAC,oBAAoB,EAAE,aAAa,EAAE,IAAI,CAAC,CAAA;AAC1D,GAAE;AACF;AACA,EAAE,MAAM,OAAQ,GAAE,KAAK,CAAC,YAAY,CAAC,aAAa,EAAE,IAAI,CAAC,CAAA;AACzD;AACA,EAAE,OAAO,OAAO,CAAA;AAChB;;;;"}