Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
44 lines
927 B
Plaintext
44 lines
927 B
Plaintext
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
|
const currentScopes = require('./currentScopes.js');
|
|
|
|
/**
|
|
* Send user feedback to Sentry.
|
|
*/
|
|
function captureFeedback(
|
|
params,
|
|
hint = {},
|
|
scope = currentScopes.getCurrentScope(),
|
|
) {
|
|
const { message, name, email, url, source, associatedEventId, tags } = params;
|
|
|
|
const feedbackEvent = {
|
|
contexts: {
|
|
feedback: {
|
|
contact_email: email,
|
|
name,
|
|
message,
|
|
url,
|
|
source,
|
|
associated_event_id: associatedEventId,
|
|
},
|
|
},
|
|
type: 'feedback',
|
|
level: 'info',
|
|
tags,
|
|
};
|
|
|
|
const client = scope?.getClient() || currentScopes.getClient();
|
|
|
|
if (client) {
|
|
client.emit('beforeSendFeedback', feedbackEvent, hint);
|
|
}
|
|
|
|
const eventId = scope.captureEvent(feedbackEvent, hint);
|
|
|
|
return eventId;
|
|
}
|
|
|
|
exports.captureFeedback = captureFeedback;
|
|
//# sourceMappingURL=feedback.js.map
|