@@ -6,7 +6,7 @@ import { version } from './package.js';
66import { getReuniteUrl } from '../reunite/api/index.js' ;
77
88import type { ExitCode } from './miscellaneous.js' ;
9- import type { ArazzoDefinition } from '@redocly/openapi-core' ;
9+ import type { ArazzoDefinition , Config } from '@redocly/openapi-core' ;
1010import type { ExtendedSecurity } from 'respect-core/src/types.js' ;
1111import type { Arguments } from 'yargs' ;
1212import type { CommandOptions } from '../types.js' ;
@@ -34,19 +34,17 @@ export type Analytics = {
3434} ;
3535
3636export async function sendTelemetry ( {
37- residency ,
37+ config ,
3838 argv,
3939 exit_code,
40- has_config,
4140 spec_version,
4241 spec_keyword,
4342 spec_full_version,
4443 respect_x_security_auth_types,
4544} : {
46- residency : string | undefined ;
45+ config : Config | undefined ;
4746 argv : Arguments | undefined ;
4847 exit_code : ExitCode ;
49- has_config : boolean | undefined ;
5048 spec_version : string | undefined ;
5149 spec_keyword : string | undefined ;
5250 spec_full_version : string | undefined ;
@@ -62,6 +60,8 @@ export async function sendTelemetry({
6260 ...args
6361 } = argv ;
6462 const event_time = new Date ( ) . toISOString ( ) ;
63+ const residency = ( argv . residency as string ) || config ?. rawConfig ?. residency ;
64+ const has_config = ! ! config ?. rawConfig ;
6565 const { RedoclyOAuthClient } = await import ( '../auth/oauth-client.js' ) ;
6666 const oauthClient = new RedoclyOAuthClient ( 'redocly-cli' , version ) ;
6767 const reuniteUrl = getReuniteUrl ( residency ) ;
0 commit comments