{"version":3,"sources":["../src/cli/commands/annotations/get.ts"],"sourcesContent":["import chalk from \"chalk\";\nimport ora from \"ora\";\nimport { AnnotationsApiService } from \"@/client-sdk/services/annotations/annotations-api.service\";\nimport { checkApiKey } from \"../../utils/apiKey\";\nimport { failSpinner } from \"../../utils/spinnerError\";\n\nexport const getAnnotationCommand = async (id: string, options?: { format?: string }): Promise<void> => {\n  checkApiKey();\n\n  const service = new AnnotationsApiService();\n  const spinner = ora(`Fetching annotation \"${id}\"...`).start();\n\n  try {\n    const annotation = await service.get(id);\n    spinner.succeed(`Found annotation \"${id}\"`);\n\n    if (options?.format === \"json\") {\n      console.log(JSON.stringify(annotation, null, 2));\n      return;\n    }\n\n    console.log();\n    console.log(chalk.bold.cyan(`Annotation ${annotation.id ?? id}`));\n    console.log(chalk.gray(\"─\".repeat(40)));\n    console.log(`  ${chalk.gray(\"ID:\")}        ${annotation.id ?? \"—\"}`);\n    console.log(`  ${chalk.gray(\"Trace ID:\")} ${annotation.traceId ?? \"—\"}`);\n    console.log(\n      `  ${chalk.gray(\"Rating:\")}   ${annotation.isThumbsUp === true ? \"👍 Thumbs Up\" : annotation.isThumbsUp === false ? \"👎 Thumbs Down\" : \"—\"}`,\n    );\n    if (annotation.email) {\n      console.log(`  ${chalk.gray(\"Email:\")}    ${annotation.email}`);\n    }\n    if (annotation.createdAt) {\n      console.log(\n        `  ${chalk.gray(\"Created:\")}  ${new Date(annotation.createdAt).toLocaleString()}`,\n      );\n    }\n    if (annotation.updatedAt) {\n      console.log(\n        `  ${chalk.gray(\"Updated:\")}  ${new Date(annotation.updatedAt).toLocaleString()}`,\n      );\n    }\n\n    if (annotation.comment) {\n      console.log();\n      console.log(chalk.bold(\"  Comment:\"));\n      console.log(`    ${annotation.comment}`);\n    }\n\n    console.log();\n  } catch (error) {\n    failSpinner({ spinner, error, action: \"fetch annotation\" });\n    process.exit(1);\n  }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,OAAO,WAAW;AAClB,OA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