Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(platform-core): Add TypeScript definitions for CLI telemetry data v2 #2300

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/violet-dolphins-itch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@aws-amplify/platform-core': patch
---

Add TypeScript definitions for CLI telemetry usage data v2
63 changes: 63 additions & 0 deletions packages/platform-core/src/usage-data/cli_telemetry_data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// Core Identifiers
export type CoreIdentifiersDetails = {
sessionUuid: string;
eventId: string;
timestamp: string;
localProjectId: string;
accountId?: string;
payloadVersion: string;
awsRegion?: string;
};

// Command Details
export type EventDetails = {
success: boolean;
command: {
path: string[];
parameters: string[];
};
};

// Environment Details
export type EnvironmentDetails = {
osRelease: string;
shell: string;
npmUserAgent: string;
ci: boolean;
memory: {
total: number;
free: number;
};
};

// Latency (Optional)
export type LatencyDetails = {
init?: number;
synthesis?: number;
deployment?: number;
hotSwap?: number;
total: number;
};

// Error Details (Optional)
export type ErrorDetails = {
name: string;
message: string;
stack: string;
cause?: ErrorDetails;
};

// Project Details
export type ProjectDetails = {
dependencies: Array<{ name: string; version: string }>;
};

// Main Telemetry Data Structure
export type AmplifyCliTelemetryData = {
identifiers: CoreIdentifiersDetails;
event: EventDetails;
environment: EnvironmentDetails;
project: ProjectDetails;
latency: LatencyDetails;
error?: ErrorDetails;
};
Loading