{"version":3,"sources":["../../src/utilities/index.ts"],"sourcesContent":["/**\n * Copyright 2024 Bloom Labs Inc\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { GenkitError } from '@genkit-ai/core';\nimport { StatusName } from '@genkit-ai/core/lib/statusTypes';\n\nimport { PluginOptions } from '../interfaces';\n\nimport { ERROR_INVALID_ARGUMENT, ERROR_NO_API_KEY } from '../constants';\n\nexport const throwError = (status: StatusName, message: string) => {\n  throw new GenkitError({\n    status,\n    message,\n  });\n};\n\nexport const checkApiKey = (pluginOptions: PluginOptions) => {\n  const { apiKey } = pluginOptions;\n  if (!apiKey) return throwError(ERROR_INVALID_ARGUMENT, ERROR_NO_API_KEY);\n};\n"],"mappings":"AAgBA,SAAS,mBAAmB;AAK5B,SAAS,wBAAwB,wBAAwB;AAElD,MAAM,aAAa,CAAC,QAAoB,YAAoB;AACjE,QAAM,IAAI,YAAY;AAAA,IACpB;AAAA,IACA;AAAA,EACF,CAAC;AACH;AAEO,MAAM,cAAc,CAAC,kBAAiC;AAC3D,QAAM,EAAE,OAAO,IAAI;AACnB,MAAI,CAAC,OAAQ,QAAO,WAAW,wBAAwB,gBAAgB;AACzE;","names":[]}