"Fossies" - the Fresh Open Source Software Archive

Member "cli-1.1280.1/src/lib/feature-flags/fetchFeatureFlag.ts" (20 Feb 2024, 633 Bytes) of package /linux/misc/snyk-cli-1.1280.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) TypeScript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 import { makeRequest } from '../request';
    2 import { getAuthHeader } from '../api-token';
    3 import config from '../config';
    4 import { assembleQueryString } from '../snyk-test/common';
    5 import { OrgFeatureFlagResponse } from './types';
    6 
    7 export async function fetchFeatureFlag(
    8   featureFlag: string,
    9   org,
   10 ): Promise<OrgFeatureFlagResponse> {
   11   const response = await makeRequest({
   12     method: 'GET',
   13     headers: {
   14       Authorization: getAuthHeader(),
   15     },
   16     qs: assembleQueryString({ org }),
   17     url: `${config.API}/cli-config/feature-flags/${featureFlag}`,
   18     gzip: true,
   19     json: true,
   20   });
   21 
   22   return (response as any).body;
   23 }