feat: export base URLs

old-agentic-v1^2
Philipp Burckhardt 2023-06-09 10:09:05 -04:00
rodzic b7244883e0
commit 0f17f53fcf
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: A2C3BCA4F31D1DDD
3 zmienionych plików z 9 dodań i 3 usunięć

Wyświetl plik

@ -1,5 +1,7 @@
import ky from 'ky'
export const METAPHOR_BASE_URL = 'https://api.metaphor.systems'
export type MetaphorSearchResult = {
author: string | null
dateCreated: string | null
@ -18,7 +20,7 @@ export class MetaphorClient {
constructor({
apiKey = process.env.METAPHOR_API_KEY,
baseUrl = 'https://api.metaphor.systems'
baseUrl = METAPHOR_BASE_URL
}: {
apiKey?: string
baseUrl?: string

Wyświetl plik

@ -1,5 +1,7 @@
import ky from 'ky'
export const NOVU_BASE_URL = 'https://api.novu.co/v1'
export type NovuSubscriber = {
subscriberId: string
email?: string
@ -22,7 +24,7 @@ export class NovuClient {
constructor({
apiKey = process.env.NOVU_API_KEY,
baseUrl = 'https://api.novu.co/v1'
baseUrl = NOVU_BASE_URL
}: {
apiKey?: string
baseUrl?: string

Wyświetl plik

@ -11,6 +11,8 @@ export interface SerpAPIClientOptions extends Partial<SerpAPIParams> {
baseUrl?: string
}
export const SERPAPI_BASE_URL = 'https://serpapi.com'
/**
* Lightweight wrapper around SerpAPI that only supports Google search.
*
@ -23,7 +25,7 @@ export class SerpAPIClient {
constructor({
apiKey = process.env.SERPAPI_API_KEY ?? process.env.SERP_API_KEY,
baseUrl = 'https://serpapi.com',
baseUrl = SERPAPI_BASE_URL,
...params
}: SerpAPIClientOptions = {}) {
if (!apiKey) {