kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
feat: export base URLs
rodzic
b7244883e0
commit
0f17f53fcf
|
@ -1,5 +1,7 @@
|
||||||
import ky from 'ky'
|
import ky from 'ky'
|
||||||
|
|
||||||
|
export const METAPHOR_BASE_URL = 'https://api.metaphor.systems'
|
||||||
|
|
||||||
export type MetaphorSearchResult = {
|
export type MetaphorSearchResult = {
|
||||||
author: string | null
|
author: string | null
|
||||||
dateCreated: string | null
|
dateCreated: string | null
|
||||||
|
@ -18,7 +20,7 @@ export class MetaphorClient {
|
||||||
|
|
||||||
constructor({
|
constructor({
|
||||||
apiKey = process.env.METAPHOR_API_KEY,
|
apiKey = process.env.METAPHOR_API_KEY,
|
||||||
baseUrl = 'https://api.metaphor.systems'
|
baseUrl = METAPHOR_BASE_URL
|
||||||
}: {
|
}: {
|
||||||
apiKey?: string
|
apiKey?: string
|
||||||
baseUrl?: string
|
baseUrl?: string
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
import ky from 'ky'
|
import ky from 'ky'
|
||||||
|
|
||||||
|
export const NOVU_BASE_URL = 'https://api.novu.co/v1'
|
||||||
|
|
||||||
export type NovuSubscriber = {
|
export type NovuSubscriber = {
|
||||||
subscriberId: string
|
subscriberId: string
|
||||||
email?: string
|
email?: string
|
||||||
|
@ -22,7 +24,7 @@ export class NovuClient {
|
||||||
|
|
||||||
constructor({
|
constructor({
|
||||||
apiKey = process.env.NOVU_API_KEY,
|
apiKey = process.env.NOVU_API_KEY,
|
||||||
baseUrl = 'https://api.novu.co/v1'
|
baseUrl = NOVU_BASE_URL
|
||||||
}: {
|
}: {
|
||||||
apiKey?: string
|
apiKey?: string
|
||||||
baseUrl?: string
|
baseUrl?: string
|
||||||
|
|
|
@ -11,6 +11,8 @@ export interface SerpAPIClientOptions extends Partial<SerpAPIParams> {
|
||||||
baseUrl?: string
|
baseUrl?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const SERPAPI_BASE_URL = 'https://serpapi.com'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Lightweight wrapper around SerpAPI that only supports Google search.
|
* Lightweight wrapper around SerpAPI that only supports Google search.
|
||||||
*
|
*
|
||||||
|
@ -23,7 +25,7 @@ export class SerpAPIClient {
|
||||||
|
|
||||||
constructor({
|
constructor({
|
||||||
apiKey = process.env.SERPAPI_API_KEY ?? process.env.SERP_API_KEY,
|
apiKey = process.env.SERPAPI_API_KEY ?? process.env.SERP_API_KEY,
|
||||||
baseUrl = 'https://serpapi.com',
|
baseUrl = SERPAPI_BASE_URL,
|
||||||
...params
|
...params
|
||||||
}: SerpAPIClientOptions = {}) {
|
}: SerpAPIClientOptions = {}) {
|
||||||
if (!apiKey) {
|
if (!apiKey) {
|
||||||
|
|
Ładowanie…
Reference in New Issue