package.build.npm.cjs.userfeedback.js.map Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of browser Show documentation
Show all versions of browser Show documentation
Official Sentry SDK for browsers
{"version":3,"file":"userfeedback.js","sources":["../../../src/userfeedback.ts"],"sourcesContent":["import type { DsnComponents, EventEnvelope, SdkMetadata, UserFeedback, UserFeedbackItem } from '@sentry/types';\nimport { createEnvelope, dsnToString } from '@sentry/utils';\n\n/**\n * Creates an envelope from a user feedback.\n */\nexport function createUserFeedbackEnvelope(\n feedback: UserFeedback,\n {\n metadata,\n tunnel,\n dsn,\n }: {\n metadata: SdkMetadata | undefined;\n tunnel: string | undefined;\n dsn: DsnComponents | undefined;\n },\n): EventEnvelope {\n const headers: EventEnvelope[0] = {\n event_id: feedback.event_id,\n sent_at: new Date().toISOString(),\n ...(metadata &&\n metadata.sdk && {\n sdk: {\n name: metadata.sdk.name,\n version: metadata.sdk.version,\n },\n }),\n ...(!!tunnel && !!dsn && { dsn: dsnToString(dsn) }),\n };\n const item = createUserFeedbackEnvelopeItem(feedback);\n\n return createEnvelope(headers, [item]);\n}\n\nfunction createUserFeedbackEnvelopeItem(feedback: UserFeedback): UserFeedbackItem {\n const feedbackHeaders: UserFeedbackItem[0] = {\n type: 'user_report',\n };\n return [feedbackHeaders, feedback];\n}\n"],"names":["dsnToString","createEnvelope"],"mappings":";;;;AAGA;AACA;AACA;AACO,SAAS,0BAA0B;AAC1C,EAAE,QAAQ;AACV,EAAE;AACF,IAAI,QAAQ;AACZ,IAAI,MAAM;AACV,IAAI,GAAG;AACP,GAAG;;AAID;AACF,EAAiB;AACjB,EAAE,MAAM,OAAO,GAAqB;AACpC,IAAI,QAAQ,EAAE,QAAQ,CAAC,QAAQ;AAC/B,IAAI,OAAO,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;AACrC,IAAI,IAAI,QAAS;AACjB,MAAM,QAAQ,CAAC,GAAA,IAAO;AACtB,QAAQ,GAAG,EAAE;AACb,UAAU,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,IAAI;AACjC,UAAU,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,OAAO;AACvC,SAAS;AACT,OAAO;AACP,IAAI,IAAI,CAAC,CAAC,MAAO,IAAG,CAAC,CAAC,GAAA,IAAO,EAAE,GAAG,EAAEA,iBAAW,CAAC,GAAG,CAAA,EAAG;AACtD,GAAG,CAAA;AACH,EAAE,MAAM,IAAK,GAAE,8BAA8B,CAAC,QAAQ,CAAC,CAAA;AACvD;AACA,EAAE,OAAOC,oBAAc,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC,CAAA;AACxC,CAAA;AACA;AACA,SAAS,8BAA8B,CAAC,QAAQ,EAAkC;AAClF,EAAE,MAAM,eAAe,GAAwB;AAC/C,IAAI,IAAI,EAAE,aAAa;AACvB,GAAG,CAAA;AACH,EAAE,OAAO,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAA;AACpC;;;;"}