* Fetches the Desktop-specific features that are enabled for the user. * * @returns An array of strings with the feature flags enabled for the user.
()
| 2096 | * @returns An array of strings with the feature flags enabled for the user. |
| 2097 | */ |
| 2098 | public async fetchFeatureFlags(): Promise<ReadonlyArray<string> | undefined> { |
| 2099 | try { |
| 2100 | const response = await this.ghRequest('GET', '/desktop_internal/features') |
| 2101 | const featuresResponse = await parsedResponse<IUserFeaturesResponse>( |
| 2102 | response |
| 2103 | ) |
| 2104 | return featuresResponse.features |
| 2105 | } catch (e) { |
| 2106 | log.warn(`fetchFeatureFlags: failed with endpoint ${this.endpoint}`, e) |
| 2107 | return undefined |
| 2108 | } |
| 2109 | } |
| 2110 | |
| 2111 | /** |
| 2112 | * Fetches the Copilot info related to the user (license and API endpoint). |