UNPKG

@supernovaio/cli

Version:

Supernova.io Command Line Interface

22 lines (20 loc) 1 kB
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="811b6a96-53b7-518d-b29e-ec209fd91fa0")}catch(e){}}(); import * as Sentry from "@sentry/node"; import { VaultService } from "../../services/index.js"; import { getTargetEnv } from "../../types/index.js"; const hook = async function (opts) { const span = Sentry.getActiveSpan(); if (span) { span.setAttribute("command", opts.Command.id); span.updateName(opts.Command.id); const vaultService = new VaultService(); const user = await vaultService.getLoggedInUserSub(getTargetEnv()); if (user) { Sentry.setUser({ id: user }); span.setAttribute("user", user); } } }; export default hook; //# sourceMappingURL=sentry.js.map //# debugId=811b6a96-53b7-518d-b29e-ec209fd91fa0