mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-10 08:05:14 +02:00
fix(telemetry): read package info via getKtxCliPackageInfo to satisfy boundary check
This commit is contained in:
parent
2532d4db56
commit
cdcadca1e1
3 changed files with 5 additions and 8 deletions
|
|
@ -4,7 +4,7 @@ import { tmpdir } from 'node:os';
|
|||
import { join, resolve } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { randomBytes } from 'node:crypto';
|
||||
import type { KtxCliIo } from './cli-runtime.js';
|
||||
import { getKtxCliPackageInfo, type KtxCliIo } from './cli-runtime.js';
|
||||
|
||||
interface DemoProjectResult {
|
||||
projectDir: string;
|
||||
|
|
@ -152,7 +152,7 @@ export async function ensureDemoProject(options: EnsureDemoProjectOptions): Prom
|
|||
name: 'connection_added',
|
||||
projectDir,
|
||||
io: options.io,
|
||||
packageInfo: { name: '@kaelio/ktx', version: options.cliVersion ?? '0.0.0' },
|
||||
packageInfo: { ...getKtxCliPackageInfo(), version: options.cliVersion ?? getKtxCliPackageInfo().version },
|
||||
fields: {
|
||||
driver: 'sqlite',
|
||||
isDemoConnection: true,
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ async function recordSetupStep(input: {
|
|||
name: 'setup_step',
|
||||
projectDir: input.projectDir,
|
||||
io: input.io,
|
||||
packageInfo: { name: '@kaelio/ktx', version: input.cliVersion ?? getKtxCliPackageInfo().version },
|
||||
packageInfo: { ...getKtxCliPackageInfo(), version: input.cliVersion ?? getKtxCliPackageInfo().version },
|
||||
fields: {
|
||||
step: input.step,
|
||||
outcome: setupTelemetryOutcome(input.status),
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type { KtxCliIo, KtxCliPackageInfo } from '../cli-runtime.js';
|
||||
import { getKtxCliPackageInfo, type KtxCliIo, type KtxCliPackageInfo } from '../cli-runtime.js';
|
||||
import { loadKtxProject } from '../context/project/project.js';
|
||||
import {
|
||||
beginCommandSpan,
|
||||
|
|
@ -81,10 +81,7 @@ export async function emitTelemetryEvent<Name extends TelemetryEventName>(input:
|
|||
return;
|
||||
}
|
||||
|
||||
const packageInfo = input.packageInfo ?? {
|
||||
name: '@kaelio/ktx',
|
||||
version: process.env.npm_package_version ?? '0.0.0',
|
||||
};
|
||||
const packageInfo = input.packageInfo ?? getKtxCliPackageInfo();
|
||||
|
||||
const projectId = input.projectDir ? computeTelemetryProjectId(identity.installId, input.projectDir) : undefined;
|
||||
await trackTelemetryEvent({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue