kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
fix: zoominfo re-authentication bug
rodzic
6a67e3dcf6
commit
4916374e45
|
@ -13,8 +13,8 @@ import { z } from 'zod'
|
||||||
export namespace zoominfo {
|
export namespace zoominfo {
|
||||||
export const API_BASE_URL = 'https://api.zoominfo.com'
|
export const API_BASE_URL = 'https://api.zoominfo.com'
|
||||||
|
|
||||||
// Access tokens expire after 60 minutes, so renew them every 55 minutes.
|
// Access tokens expire after 60 minutes, so renew them every 57 minutes.
|
||||||
export const ACCESS_TOKEN_EXPIRATION_MS = 55 * 60 * 1000
|
export const ACCESS_TOKEN_EXPIRATION_MS = 57 * 60 * 1000
|
||||||
|
|
||||||
// Allow up to 1500 requests per minute by default.
|
// Allow up to 1500 requests per minute by default.
|
||||||
// https://api-docs.zoominfo.com/#rate-and-usage-limits
|
// https://api-docs.zoominfo.com/#rate-and-usage-limits
|
||||||
|
@ -247,6 +247,7 @@ export namespace zoominfo {
|
||||||
export interface EnrichCompanyResult {
|
export interface EnrichCompanyResult {
|
||||||
input: Partial<EnrichCompanyOptions>
|
input: Partial<EnrichCompanyOptions>
|
||||||
data: EnrichedCompany[]
|
data: EnrichedCompany[]
|
||||||
|
matchStatus?: MatchStatus
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface EnrichedCompany {
|
export interface EnrichedCompany {
|
||||||
|
@ -1186,7 +1187,7 @@ export class ZoomInfoClient extends AIFunctionsProvider {
|
||||||
if (
|
if (
|
||||||
!force &&
|
!force &&
|
||||||
this.accessToken &&
|
this.accessToken &&
|
||||||
this.accessTokenDateMS! + zoominfo.ACCESS_TOKEN_EXPIRATION_MS < Date.now()
|
this.accessTokenDateMS! + zoominfo.ACCESS_TOKEN_EXPIRATION_MS > Date.now()
|
||||||
) {
|
) {
|
||||||
// Access token is still valid.
|
// Access token is still valid.
|
||||||
return
|
return
|
||||||
|
|
Ładowanie…
Reference in New Issue