1 | import * as Config from '@oclif/config';
|
2 | import deps from './deps';
|
3 | export interface AnalyticsJSONCommand {
|
4 | command: string;
|
5 | completion: number;
|
6 | version: string;
|
7 | plugin: string;
|
8 | plugin_version: string;
|
9 | os: string;
|
10 | shell: string;
|
11 | language: string;
|
12 | valid: true;
|
13 | }
|
14 | export interface AnalyticsJSON {
|
15 | schema: 1;
|
16 | commands: AnalyticsJSONCommand[];
|
17 | }
|
18 | export interface AnalyticsJSONPost {
|
19 | schema: 1;
|
20 | commands: AnalyticsJSONCommand[];
|
21 | install: string;
|
22 | cli: string;
|
23 | user: string;
|
24 | }
|
25 | export interface RecordOpts {
|
26 | Command: Config.Command.Class;
|
27 | argv: string[];
|
28 | }
|
29 | export default class AnalyticsCommand {
|
30 | config: Config.IConfig;
|
31 | userConfig: typeof deps.UserConfig.prototype;
|
32 | http: typeof deps.HTTP;
|
33 | constructor(config: Config.IConfig);
|
34 | _initialAnalyticsJSON(): AnalyticsJSON;
|
35 | record(opts: RecordOpts): Promise<void>;
|
36 | submit(): Promise<void>;
|
37 | readonly url: string;
|
38 | readonly analyticsPath: string;
|
39 | readonly usingHerokuAPIKey: boolean;
|
40 | readonly netrcLogin: string | undefined;
|
41 | readonly user: string | undefined;
|
42 | _readJSON(): Promise<AnalyticsJSON>;
|
43 | _writeJSON(analyticsJSON: AnalyticsJSON): Promise<void>;
|
44 | _acAnalytics(): Promise<number>;
|
45 | private init();
|
46 | }
|