import { Storage } from '@google-cloud/storage' ; import { logger } from 'gcf-utils' ; const storage = new Storage ( ) ; export interface ApiLabel { api_shortname : string ; region_tag_prefix : string ; title : string ; github_label : string ; } export interface ApiLabels { products : Array < ApiLabel > ; } export const getApiLabels = async ( dataBucket ) : Promise < ApiLabels > => { const apis = await storage . bucket ( dataBucket ) . file ( 'products.json' ) . download ( ) ; const parsedResponse = JSON . parse ( apis [ 0 ] . toString ( ) ) as ApiLabels ; logger . debug ( { apiLabels : parsedResponse } ) ; return parsedResponse ; } ;