forked from MadKudu/node-hubspot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
98 lines (86 loc) · 2.6 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
// Type definitions for hubspot 1.3.0
// Project: https://github.com/MadKudu/node-hubspot
import { RequestCallback } from 'request'
import { RequestPromise } from 'request-promise'
import { Company } from './lib/typescript/company'
import { Contact } from './lib/typescript/contact'
import { Page } from './lib/typescript/page'
import { OAuth } from './lib/typescript/oauth'
import { Deal } from './lib/typescript/deal'
import { Engagement } from './lib/typescript/engagement'
import { Integrations } from './lib/typescript/integrations'
import { Owner } from './lib/typescript/owner'
import { Pipeline } from './lib/typescript/pipeline'
import { List } from './lib/typescript/list'
import { File } from './lib/typescript/file'
import { Subscription } from './lib/typescript/subscription'
import { Campaign } from './lib/typescript/campaign'
import { Broadcast } from './lib/typescript/broadcast'
import { CRM } from './lib/typescript/crm'
import { Emails } from './lib/typescript/emails'
import { Form } from './lib/typescript/form'
import { Workflow } from './lib/typescript/workflow';
interface BaseOptions {
baseUrl?: string
}
export interface BottleneckOptions {
maxConcurrent?: number | null;
minTime?: number;
highWater?: number | null;
reservoir?: number | null;
reservoirRefreshInterval?: number | null;
reservoirRefreshAmount?: number | null;
reservoirIncreaseInterval?: number | null;
reservoirIncreaseAmount?: number | null;
reservoirIncreaseMaximum?: number | null;
[key: string]: any;
}
export interface LimiterOptions {
limiter?: BottleneckOptions
}
export interface ApiOptions extends BaseOptions, LimiterOptions {
apiKey: string
}
export interface AccessTokenOptions extends BaseOptions, LimiterOptions {
accessToken: string
}
export interface AccessTokenResponse {
refresh_token: string;
access_token: string;
expires_in: number;
}
export interface AppOptions extends BaseOptions {
clientId: string
clientSecret: string
redirectUri: string
refreshToken: string
}
export interface HubspotError {
status: string
message: string
correlationId: string
requestId: string
}
declare class Hubspot {
constructor(options?: ApiOptions | AccessTokenOptions | AppOptions)
refreshAccessToken(): Promise<AccessTokenResponse>
companies: Company
contacts: Contact
pages: Page
deals: Deal
engagements: Engagement
integrations: Integrations
owners: Owner
oauth: OAuth
pipelines: Pipeline
lists: List
files: File
subscriptions: Subscription
campaigns: Campaign
broadcasts: Broadcast
crm: CRM
emails: Emails
forms: Form
workflows: Workflow
}
export default Hubspot