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
26 lines
645 B
Plaintext
26 lines
645 B
Plaintext
import { createEnvelope } from './envelope.js';
|
|
import { dateTimestampInSeconds } from './time.js';
|
|
|
|
/**
|
|
* Creates client report envelope
|
|
* @param discarded_events An array of discard events
|
|
* @param dsn A DSN that can be set on the header. Optional.
|
|
*/
|
|
function createClientReportEnvelope(
|
|
discarded_events,
|
|
dsn,
|
|
timestamp,
|
|
) {
|
|
const clientReportItem = [
|
|
{ type: 'client_report' },
|
|
{
|
|
timestamp: timestamp || dateTimestampInSeconds(),
|
|
discarded_events,
|
|
},
|
|
];
|
|
return createEnvelope(dsn ? { dsn } : {}, [clientReportItem]);
|
|
}
|
|
|
|
export { createClientReportEnvelope };
|
|
//# sourceMappingURL=clientreport.js.map
|