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
1 line
1.6 KiB
Plaintext
1 line
1.6 KiB
Plaintext
{"version":3,"sources":["../../../../src/utilities/telemetry/events/adminInit.ts"],"sourcesContent":["import type { Payload } from '../../../index.js'\nimport type { PayloadRequest } from '../../../types/index.js'\n\nimport { sendEvent } from '../index.js'\nimport { oneWayHash } from '../oneWayHash.js'\n\nexport type AdminInitEvent = {\n domainID?: string\n type: 'admin-init'\n userID?: string\n}\n\ntype Args = {\n headers: Request['headers']\n payload: Payload\n user: PayloadRequest['user']\n}\nexport const adminInit = ({ headers, payload, user }: Args): void => {\n const host = headers.get('host')\n\n let domainID: string\n let userID: string\n\n if (host) {\n domainID = oneWayHash(host, payload.secret)\n }\n\n if (user?.id) {\n userID = oneWayHash(String(user.id), payload.secret)\n }\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n sendEvent({\n event: {\n type: 'admin-init',\n domainID: domainID!,\n userID: userID!,\n },\n payload,\n })\n}\n"],"names":["sendEvent","oneWayHash","adminInit","headers","payload","user","host","get","domainID","userID","secret","id","String","event","type"],"mappings":"AAGA,SAASA,SAAS,QAAQ,cAAa;AACvC,SAASC,UAAU,QAAQ,mBAAkB;AAa7C,OAAO,MAAMC,YAAY,CAAC,EAAEC,OAAO,EAAEC,OAAO,EAAEC,IAAI,EAAQ;IACxD,MAAMC,OAAOH,QAAQI,GAAG,CAAC;IAEzB,IAAIC;IACJ,IAAIC;IAEJ,IAAIH,MAAM;QACRE,WAAWP,WAAWK,MAAMF,QAAQM,MAAM;IAC5C;IAEA,IAAIL,MAAMM,IAAI;QACZF,SAASR,WAAWW,OAAOP,KAAKM,EAAE,GAAGP,QAAQM,MAAM;IACrD;IAEA,mEAAmE;IACnEV,UAAU;QACRa,OAAO;YACLC,MAAM;YACNN,UAAUA;YACVC,QAAQA;QACV;QACAL;IACF;AACF,EAAC"} |