@graph8/sdk 0.5.3 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -5
- package/dist/index.d.mts +608 -68
- package/dist/index.d.ts +608 -68
- package/dist/index.js +940 -907
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +930 -906
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +483 -52
- package/dist/react.d.ts +483 -52
- package/dist/react.js +910 -905
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +910 -905
- package/dist/react.mjs.map +1 -1
- package/package.json +24 -7
package/dist/react.d.mts
CHANGED
|
@@ -2,6 +2,314 @@ import * as _jitsu_js from '@jitsu/js';
|
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
4
|
|
|
5
|
+
interface Snippet {
|
|
6
|
+
write_key: string;
|
|
7
|
+
tracking_host: string;
|
|
8
|
+
domains: string[];
|
|
9
|
+
/** Ready-to-use React component import for @graph8/nextjs. */
|
|
10
|
+
react_snippet: string;
|
|
11
|
+
/** Vanilla JS script tag for non-React apps. */
|
|
12
|
+
script_tag: string;
|
|
13
|
+
/** Full configuration object (gtm/config.json). */
|
|
14
|
+
config: Record<string, unknown>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Snippet API — fetch your org's graph8 tracking snippet programmatically, to
|
|
18
|
+
* embed the tracker into an app or a customer's site (the write key, a React
|
|
19
|
+
* component, a vanilla `<script>` tag, allowed domains, and the full config).
|
|
20
|
+
* Requires an API key (server-side). Built on the hardened HTTP core, so it
|
|
21
|
+
* throws a typed `G8Error` on failure and retries transient errors.
|
|
22
|
+
*
|
|
23
|
+
* Backed by `GET /api/v1/snippet`.
|
|
24
|
+
*/
|
|
25
|
+
declare const createSnippetClient: (apiKey: string, apiUrl?: string) => {
|
|
26
|
+
/** Get your org's tracking snippet (write key + React/script-tag embeds + config). */
|
|
27
|
+
get(): Promise<Snippet>;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
interface MarketplaceProfile {
|
|
31
|
+
id: string;
|
|
32
|
+
email: string;
|
|
33
|
+
first_name?: string | null;
|
|
34
|
+
last_name?: string | null;
|
|
35
|
+
marketplace_role?: string | null;
|
|
36
|
+
country_code?: string | null;
|
|
37
|
+
monthly_rate_usd?: string | null;
|
|
38
|
+
per_meeting_rate_usd?: string | null;
|
|
39
|
+
availability_status?: string | null;
|
|
40
|
+
bio?: string | null;
|
|
41
|
+
is_complete: boolean;
|
|
42
|
+
}
|
|
43
|
+
interface MarketplaceOffer {
|
|
44
|
+
id: string;
|
|
45
|
+
org_id: string;
|
|
46
|
+
org_name?: string | null;
|
|
47
|
+
sdr_id: string;
|
|
48
|
+
status: string;
|
|
49
|
+
monthly_rate_usd?: string | null;
|
|
50
|
+
per_meeting_rate_usd?: string | null;
|
|
51
|
+
created_at?: string | null;
|
|
52
|
+
}
|
|
53
|
+
interface MarketplaceHiring {
|
|
54
|
+
id: string;
|
|
55
|
+
org_id: string;
|
|
56
|
+
sdr_id: string;
|
|
57
|
+
status: string;
|
|
58
|
+
sdr_name?: string | null;
|
|
59
|
+
sdr_role?: string | null;
|
|
60
|
+
sdr_email?: string | null;
|
|
61
|
+
monthly_rate_usd?: string | null;
|
|
62
|
+
per_meeting_rate_usd?: string | null;
|
|
63
|
+
started_at?: string | null;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Marketplace API — for SDR/AE talent on the graph8 marketplace. View your
|
|
67
|
+
* profile, see pending hire offers and respond to them, and list your active
|
|
68
|
+
* hirings. Requires a personal API key (server-side). Built on the hardened
|
|
69
|
+
* HTTP core, so every method throws a typed `G8Error` on failure and retries
|
|
70
|
+
* transient errors.
|
|
71
|
+
*
|
|
72
|
+
* Backed by `/api/v1/marketplace`.
|
|
73
|
+
*/
|
|
74
|
+
declare const createMarketplaceClient: (apiKey: string, apiUrl?: string) => {
|
|
75
|
+
/** Your own marketplace SDR profile. */
|
|
76
|
+
profile(): Promise<MarketplaceProfile>;
|
|
77
|
+
/** Pending hire offers you can accept or reject. */
|
|
78
|
+
offers(): Promise<{
|
|
79
|
+
offers: MarketplaceOffer[];
|
|
80
|
+
count: number;
|
|
81
|
+
}>;
|
|
82
|
+
/** Accept a pending hire offer (by hiring id). */
|
|
83
|
+
acceptOffer(hiringId: string): Promise<Record<string, unknown>>;
|
|
84
|
+
/** Reject a pending hire offer (by hiring id). */
|
|
85
|
+
rejectOffer(hiringId: string): Promise<Record<string, unknown>>;
|
|
86
|
+
/** Your active hiring contracts. */
|
|
87
|
+
hirings(): Promise<{
|
|
88
|
+
hirings: MarketplaceHiring[];
|
|
89
|
+
count: number;
|
|
90
|
+
}>;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
interface AgencyInfo {
|
|
94
|
+
agency_org_id: string;
|
|
95
|
+
agency_org_name: string | null;
|
|
96
|
+
is_agency: boolean;
|
|
97
|
+
client_count: number;
|
|
98
|
+
/** Request header to set when operating a client org (e.g. "X-Target-Org-Id"). */
|
|
99
|
+
target_header: string;
|
|
100
|
+
}
|
|
101
|
+
interface AgencyClient {
|
|
102
|
+
/** Pass this as the `X-Target-Org-Id` header to operate this client org. */
|
|
103
|
+
org_id: string;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Agency API — for agency-scoped API keys (minted with `is_agency: true`).
|
|
107
|
+
* Discover the agency credential and the client orgs it may operate. To act on a
|
|
108
|
+
* client org, set the `X-Target-Org-Id` header (see `target_header`) to that
|
|
109
|
+
* client's `org_id` on your subsequent requests. Requires an agency API key
|
|
110
|
+
* (server-side); a non-agency key gets a `403`.
|
|
111
|
+
*
|
|
112
|
+
* Built on the hardened HTTP core (typed `G8Error` + retries). Backed by
|
|
113
|
+
* `/api/v1/agency`.
|
|
114
|
+
*/
|
|
115
|
+
declare const createAgencyClient: (apiKey: string, apiUrl?: string) => {
|
|
116
|
+
/** Describe the agency credential: agency org + authorized client count. */
|
|
117
|
+
me(): Promise<AgencyInfo>;
|
|
118
|
+
/** List the client orgs this agency key may target via `X-Target-Org-Id`. */
|
|
119
|
+
clients(): Promise<{
|
|
120
|
+
data: AgencyClient[];
|
|
121
|
+
}>;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
/** Filter operators supported by open-data search. */
|
|
125
|
+
type SearchOperator = "any_of" | "contains" | "all_of" | "none_of" | "is_empty" | "is_not_empty" | "between" | "exists";
|
|
126
|
+
/** A single search filter condition (named to avoid colliding with enrich's `SearchFilter`). */
|
|
127
|
+
interface SearchCondition {
|
|
128
|
+
/** Field to filter on, e.g. "job_title", "country", "industry". */
|
|
129
|
+
field: string;
|
|
130
|
+
operator: SearchOperator;
|
|
131
|
+
/** Filter values (operator-dependent; e.g. `["VP", "Director"]` for any_of). */
|
|
132
|
+
value?: unknown[];
|
|
133
|
+
}
|
|
134
|
+
interface SearchParams {
|
|
135
|
+
/** Filter conditions, combined with AND. */
|
|
136
|
+
filters?: SearchCondition[];
|
|
137
|
+
/** Page number, 1-indexed (1-100). */
|
|
138
|
+
page?: number;
|
|
139
|
+
/** Results per page (1-100, default 25). */
|
|
140
|
+
limit?: number;
|
|
141
|
+
}
|
|
142
|
+
interface SearchSaveParams extends SearchParams {
|
|
143
|
+
/** Title for the new list the matched records are saved into. */
|
|
144
|
+
list_title: string;
|
|
145
|
+
/** Max records to save (1-10,000, default 1,000). */
|
|
146
|
+
max_results?: number;
|
|
147
|
+
}
|
|
148
|
+
interface SearchContactItem {
|
|
149
|
+
first_name?: string | null;
|
|
150
|
+
last_name?: string | null;
|
|
151
|
+
middle_name?: string | null;
|
|
152
|
+
work_email?: string | null;
|
|
153
|
+
personal_emails?: string | null;
|
|
154
|
+
direct_phone?: string | null;
|
|
155
|
+
mobile_phone?: string | null;
|
|
156
|
+
job_title?: string | null;
|
|
157
|
+
job_department?: string | null;
|
|
158
|
+
seniority_level?: string | null;
|
|
159
|
+
role?: string | null;
|
|
160
|
+
linkedin_url?: string | null;
|
|
161
|
+
linkedin_headline?: string | null;
|
|
162
|
+
city?: string | null;
|
|
163
|
+
state?: string | null;
|
|
164
|
+
country?: string | null;
|
|
165
|
+
company_name?: string | null;
|
|
166
|
+
company_domain?: string | null;
|
|
167
|
+
company_industry?: string | null;
|
|
168
|
+
company_employee_count?: string | null;
|
|
169
|
+
company_country?: string | null;
|
|
170
|
+
confidence_score?: number | null;
|
|
171
|
+
}
|
|
172
|
+
interface SearchCompanyItem {
|
|
173
|
+
name?: string | null;
|
|
174
|
+
domain?: string | null;
|
|
175
|
+
website?: string | null;
|
|
176
|
+
description?: string | null;
|
|
177
|
+
industry?: string | null;
|
|
178
|
+
industry_group?: string | null;
|
|
179
|
+
employee_count?: string | null;
|
|
180
|
+
revenue?: string | null;
|
|
181
|
+
founded_year?: number | null;
|
|
182
|
+
phone?: string | null;
|
|
183
|
+
address?: string | null;
|
|
184
|
+
city?: string | null;
|
|
185
|
+
state?: string | null;
|
|
186
|
+
country?: string | null;
|
|
187
|
+
zip?: number | null;
|
|
188
|
+
linkedin_url?: string | null;
|
|
189
|
+
linkedin_followers?: string | null;
|
|
190
|
+
facebook_url?: string | null;
|
|
191
|
+
twitter_url?: string | null;
|
|
192
|
+
crunchbase_url?: string | null;
|
|
193
|
+
logo_url?: string | null;
|
|
194
|
+
}
|
|
195
|
+
interface SearchSaveResult {
|
|
196
|
+
list_id: number;
|
|
197
|
+
list_title: string;
|
|
198
|
+
estimated_total: number;
|
|
199
|
+
status: string;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Search API — prospect the open-data graph for new contacts and companies by
|
|
203
|
+
* filter, and optionally save the matches straight into a list. Requires API
|
|
204
|
+
* key (server-side). Built on the hardened HTTP core, so every method throws a
|
|
205
|
+
* typed `G8Error` on failure and retries transient errors.
|
|
206
|
+
*
|
|
207
|
+
* Backed by `/api/v1/search`.
|
|
208
|
+
*/
|
|
209
|
+
declare const createSearchClient: (apiKey: string, apiUrl?: string) => {
|
|
210
|
+
/** Search open-data contacts by filter. */
|
|
211
|
+
contacts(params?: SearchParams): Promise<{
|
|
212
|
+
data: SearchContactItem[];
|
|
213
|
+
}>;
|
|
214
|
+
/** Search open-data companies by filter. */
|
|
215
|
+
companies(params?: SearchParams): Promise<{
|
|
216
|
+
data: SearchCompanyItem[];
|
|
217
|
+
}>;
|
|
218
|
+
/** Search contacts and save the matches into a new list. */
|
|
219
|
+
saveContacts(params: SearchSaveParams): Promise<SearchSaveResult>;
|
|
220
|
+
/** Search companies and save the matches into a new list. */
|
|
221
|
+
saveCompanies(params: SearchSaveParams): Promise<SearchSaveResult>;
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
/** Ad platform an audience can sync to. */
|
|
225
|
+
type AudienceSyncPlatform = "meta" | "linkedin" | "google" | "x";
|
|
226
|
+
/** Sync mode: full mirror, or only ever add members. */
|
|
227
|
+
type AudienceSyncMode = "mirror" | "append_only";
|
|
228
|
+
interface AudienceSync {
|
|
229
|
+
id: number;
|
|
230
|
+
audience_id: number;
|
|
231
|
+
platform: string;
|
|
232
|
+
platform_audience_name: string | null;
|
|
233
|
+
mode: string;
|
|
234
|
+
refresh_cadence_hours: number;
|
|
235
|
+
is_active: boolean;
|
|
236
|
+
status: string | null;
|
|
237
|
+
last_sync_at: string | null;
|
|
238
|
+
created_at: string | null;
|
|
239
|
+
}
|
|
240
|
+
interface AudienceSyncCreateParams {
|
|
241
|
+
/** Audience list ID to sync. */
|
|
242
|
+
audience_id: number;
|
|
243
|
+
platform: AudienceSyncPlatform;
|
|
244
|
+
platform_audience_name?: string;
|
|
245
|
+
/** Default "mirror". */
|
|
246
|
+
mode?: AudienceSyncMode;
|
|
247
|
+
/** Refresh cadence in hours (0-720; default 24). */
|
|
248
|
+
refresh_cadence_hours?: number;
|
|
249
|
+
/** Platform-specific config (OAuth creds, ad-account ids, etc.). */
|
|
250
|
+
platform_config?: Record<string, unknown>;
|
|
251
|
+
/** Audience list IDs whose members should be suppressed from the sync. */
|
|
252
|
+
suppression_list_ids?: number[];
|
|
253
|
+
}
|
|
254
|
+
interface AudienceSyncUpdateParams {
|
|
255
|
+
mode?: AudienceSyncMode;
|
|
256
|
+
refresh_cadence_hours?: number;
|
|
257
|
+
is_active?: boolean;
|
|
258
|
+
suppression_list_ids?: number[];
|
|
259
|
+
}
|
|
260
|
+
interface AudienceSyncRun {
|
|
261
|
+
id: number;
|
|
262
|
+
started_at: string | null;
|
|
263
|
+
finished_at: string | null;
|
|
264
|
+
status: string | null;
|
|
265
|
+
members_added: number | null;
|
|
266
|
+
members_removed: number | null;
|
|
267
|
+
total_members: number | null;
|
|
268
|
+
error_message: string | null;
|
|
269
|
+
}
|
|
270
|
+
interface AudienceSyncError {
|
|
271
|
+
id: number;
|
|
272
|
+
started_at: string | null;
|
|
273
|
+
error_message: string | null;
|
|
274
|
+
details: Record<string, unknown> | null;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Audiences API — sync an audience list to ad platforms (Meta, LinkedIn,
|
|
278
|
+
* Google, X). Requires API key (server-side). Built on the hardened HTTP core,
|
|
279
|
+
* so every method throws a typed `G8Error` on failure and retries transient
|
|
280
|
+
* 429/5xx/network errors.
|
|
281
|
+
*
|
|
282
|
+
* Backed by `/api/v1/audience-syncs`.
|
|
283
|
+
*/
|
|
284
|
+
declare const createAudiencesClient: (apiKey: string, apiUrl?: string) => {
|
|
285
|
+
/** List all audience syncs for the organization. */
|
|
286
|
+
list(): Promise<{
|
|
287
|
+
data: AudienceSync[];
|
|
288
|
+
}>;
|
|
289
|
+
/** Create a new audience sync to an ad platform. */
|
|
290
|
+
create(params: AudienceSyncCreateParams): Promise<AudienceSync>;
|
|
291
|
+
/** Get a single audience sync by ID. */
|
|
292
|
+
get(configId: number): Promise<AudienceSync>;
|
|
293
|
+
/** Update an audience sync (partial). */
|
|
294
|
+
update(configId: number, fields: AudienceSyncUpdateParams): Promise<AudienceSync>;
|
|
295
|
+
/** Delete an audience sync. */
|
|
296
|
+
delete(configId: number): Promise<{
|
|
297
|
+
data: Record<string, unknown>;
|
|
298
|
+
}>;
|
|
299
|
+
/** Trigger an immediate sync run for a config. */
|
|
300
|
+
trigger(configId: number): Promise<{
|
|
301
|
+
data: Record<string, unknown>;
|
|
302
|
+
}>;
|
|
303
|
+
/** List recent sync runs for a config (most recent first). */
|
|
304
|
+
runs(configId: number): Promise<{
|
|
305
|
+
data: AudienceSyncRun[];
|
|
306
|
+
}>;
|
|
307
|
+
/** List recent sync errors for a config. */
|
|
308
|
+
errors(configId: number): Promise<{
|
|
309
|
+
data: AudienceSyncError[];
|
|
310
|
+
}>;
|
|
311
|
+
};
|
|
312
|
+
|
|
5
313
|
interface MeetingAttendee {
|
|
6
314
|
name: string | null;
|
|
7
315
|
email: string;
|
|
@@ -587,7 +895,8 @@ interface WorkflowListParams {
|
|
|
587
895
|
}
|
|
588
896
|
/**
|
|
589
897
|
* Workflows API - automation workflows with nodes, connections, and execution lifecycle.
|
|
590
|
-
* Requires API key (server-side).
|
|
898
|
+
* Requires API key (server-side). On the hardened HTTP core: throws a typed
|
|
899
|
+
* `G8Error` on failure and retries transient errors.
|
|
591
900
|
*
|
|
592
901
|
* The graph8 workflow surface treats the whole workflow definition as a single
|
|
593
902
|
* record updated via `update()` — there are no per-node CRUD endpoints. To edit
|
|
@@ -652,9 +961,9 @@ declare const createWorkflowsClient: (apiKey: string, apiUrl?: string) => {
|
|
|
652
961
|
}>;
|
|
653
962
|
/** Execute a workflow immediately with a trigger payload. */
|
|
654
963
|
execute(workflowId: string, triggerPayload?: Record<string, unknown>): Promise<WorkflowExecution>;
|
|
655
|
-
/** Get the status +
|
|
964
|
+
/** Get the status + outputs of a single execution. */
|
|
656
965
|
getExecution(executionId: string): Promise<WorkflowExecution>;
|
|
657
|
-
/** Pause
|
|
966
|
+
/** Pause a running execution. */
|
|
658
967
|
pauseExecution(executionId: string): Promise<{
|
|
659
968
|
data: {
|
|
660
969
|
paused: boolean;
|
|
@@ -666,34 +975,32 @@ declare const createWorkflowsClient: (apiKey: string, apiUrl?: string) => {
|
|
|
666
975
|
resumed: boolean;
|
|
667
976
|
};
|
|
668
977
|
}>;
|
|
669
|
-
/** Stop an execution
|
|
978
|
+
/** Stop an execution. */
|
|
670
979
|
stopExecution(executionId: string): Promise<{
|
|
671
980
|
data: {
|
|
672
981
|
stopped: boolean;
|
|
673
982
|
};
|
|
674
983
|
}>;
|
|
675
|
-
/** Get the status
|
|
984
|
+
/** Get the trigger status (e.g. schedule / webhook wiring) for a workflow. */
|
|
676
985
|
getTriggerStatus(workflowId: string): Promise<{
|
|
677
986
|
data: {
|
|
678
987
|
status: string;
|
|
679
988
|
details: Record<string, unknown>;
|
|
680
989
|
};
|
|
681
990
|
}>;
|
|
682
|
-
/** Reset
|
|
991
|
+
/** Reset a workflow's trigger cursor / state. */
|
|
683
992
|
resetTrigger(workflowId: string): Promise<{
|
|
684
993
|
data: {
|
|
685
994
|
reset: boolean;
|
|
686
995
|
};
|
|
687
996
|
}>;
|
|
688
|
-
/**
|
|
689
|
-
* List available node types with schemas. Pass a `type` param to fetch one type's full schema.
|
|
690
|
-
*/
|
|
997
|
+
/** Catalog of available workflow node types with config + output schemas. */
|
|
691
998
|
nodeTypes(params?: {
|
|
692
999
|
type?: string;
|
|
693
1000
|
}): Promise<{
|
|
694
1001
|
data: NodeTypeSchema[];
|
|
695
1002
|
}>;
|
|
696
|
-
/** Slack
|
|
1003
|
+
/** Slack users available to workflow nodes. */
|
|
697
1004
|
listSlackUsers(): Promise<{
|
|
698
1005
|
data: Array<{
|
|
699
1006
|
id: string;
|
|
@@ -701,7 +1008,7 @@ declare const createWorkflowsClient: (apiKey: string, apiUrl?: string) => {
|
|
|
701
1008
|
email: string | null;
|
|
702
1009
|
}>;
|
|
703
1010
|
}>;
|
|
704
|
-
/** Slack channels. */
|
|
1011
|
+
/** Slack channels available to workflow nodes. */
|
|
705
1012
|
listSlackChannels(): Promise<{
|
|
706
1013
|
data: Array<{
|
|
707
1014
|
id: string;
|
|
@@ -709,7 +1016,7 @@ declare const createWorkflowsClient: (apiKey: string, apiUrl?: string) => {
|
|
|
709
1016
|
is_private: boolean;
|
|
710
1017
|
}>;
|
|
711
1018
|
}>;
|
|
712
|
-
/** Roam
|
|
1019
|
+
/** Roam users available to workflow nodes. */
|
|
713
1020
|
listRoamUsers(): Promise<{
|
|
714
1021
|
data: Array<{
|
|
715
1022
|
id: string;
|
|
@@ -717,14 +1024,14 @@ declare const createWorkflowsClient: (apiKey: string, apiUrl?: string) => {
|
|
|
717
1024
|
email: string | null;
|
|
718
1025
|
}>;
|
|
719
1026
|
}>;
|
|
720
|
-
/** Roam
|
|
1027
|
+
/** Roam groups available to workflow nodes. */
|
|
721
1028
|
listRoamGroups(): Promise<{
|
|
722
1029
|
data: Array<{
|
|
723
1030
|
id: string;
|
|
724
1031
|
name: string;
|
|
725
1032
|
}>;
|
|
726
1033
|
}>;
|
|
727
|
-
/**
|
|
1034
|
+
/** MCP servers available to workflow nodes. */
|
|
728
1035
|
listMcpServers(): Promise<{
|
|
729
1036
|
data: Array<{
|
|
730
1037
|
id: string;
|
|
@@ -732,14 +1039,14 @@ declare const createWorkflowsClient: (apiKey: string, apiUrl?: string) => {
|
|
|
732
1039
|
url: string;
|
|
733
1040
|
}>;
|
|
734
1041
|
}>;
|
|
735
|
-
/**
|
|
1042
|
+
/** Disposition options available to workflow nodes. */
|
|
736
1043
|
listDispositions(): Promise<{
|
|
737
1044
|
data: Array<{
|
|
738
1045
|
id: string;
|
|
739
1046
|
label: string;
|
|
740
1047
|
}>;
|
|
741
1048
|
}>;
|
|
742
|
-
/** Form field
|
|
1049
|
+
/** Form field definitions for a given form (used by form-trigger nodes). */
|
|
743
1050
|
listFormFields(formId: string): Promise<{
|
|
744
1051
|
data: Array<{
|
|
745
1052
|
name: string;
|
|
@@ -822,7 +1129,8 @@ interface PipelineSuggestion {
|
|
|
822
1129
|
}
|
|
823
1130
|
/**
|
|
824
1131
|
* Stage Checklist Pipelines API - workflow pipelines with evidence + scripts.
|
|
825
|
-
* Requires API key (server-side).
|
|
1132
|
+
* Requires API key (server-side). On the hardened HTTP core: throws a typed
|
|
1133
|
+
* `G8Error` on failure and retries transient errors.
|
|
826
1134
|
*
|
|
827
1135
|
* Backed by:
|
|
828
1136
|
* GET /api/v1/pipelines
|
|
@@ -965,7 +1273,9 @@ interface PaginationMeta$2 {
|
|
|
965
1273
|
has_next: boolean;
|
|
966
1274
|
}
|
|
967
1275
|
/**
|
|
968
|
-
* Quotes API - quote-to-cash lifecycle. Requires API key (server-side).
|
|
1276
|
+
* Quotes API - quote-to-cash lifecycle. Requires API key (server-side). On the
|
|
1277
|
+
* hardened HTTP core: throws a typed `G8Error` on failure and retries transient
|
|
1278
|
+
* errors.
|
|
969
1279
|
*
|
|
970
1280
|
* Backed by:
|
|
971
1281
|
* GET /api/v1/quotes
|
|
@@ -1118,7 +1428,9 @@ interface InboxSendResult {
|
|
|
1118
1428
|
}
|
|
1119
1429
|
/**
|
|
1120
1430
|
* Inbox API — read + reply to multi-channel inbox threads (email, SMS, LinkedIn/HeyReach).
|
|
1121
|
-
* Requires API key (server-side).
|
|
1431
|
+
* Requires API key (server-side). On the hardened HTTP core: throws a typed
|
|
1432
|
+
* `G8Error` on failure (e.g. 402 when an AI draft exceeds your credit balance)
|
|
1433
|
+
* and retries transient errors.
|
|
1122
1434
|
*
|
|
1123
1435
|
* Backed by:
|
|
1124
1436
|
* GET /api/v1/inbox
|
|
@@ -1325,7 +1637,8 @@ interface SetFieldValueParams {
|
|
|
1325
1637
|
}
|
|
1326
1638
|
/**
|
|
1327
1639
|
* Fields API - manage custom fields (columns) on contacts and companies.
|
|
1328
|
-
* Requires API key (server-side).
|
|
1640
|
+
* Requires API key (server-side). On the hardened HTTP core: throws a typed
|
|
1641
|
+
* `G8Error` on failure and retries transient errors.
|
|
1329
1642
|
*
|
|
1330
1643
|
* Backed by:
|
|
1331
1644
|
* GET /api/v1/fields — list contact fields
|
|
@@ -1719,8 +2032,11 @@ declare const createContactsClient: (apiKey: string, apiUrl?: string) => {
|
|
|
1719
2032
|
}>;
|
|
1720
2033
|
/** Get a single contact by ID. */
|
|
1721
2034
|
get(contactId: number): Promise<Contact>;
|
|
1722
|
-
/**
|
|
1723
|
-
|
|
2035
|
+
/**
|
|
2036
|
+
* Create a new contact. Pass `idempotencyKey` to make a retry safe — the
|
|
2037
|
+
* same key returns the first result instead of creating a duplicate (A6).
|
|
2038
|
+
*/
|
|
2039
|
+
create(contact: ContactCreateParams, idempotencyKey?: string): Promise<Contact>;
|
|
1724
2040
|
/** Update a contact (partial). */
|
|
1725
2041
|
update(contactId: number, fields: ContactUpdateParams): Promise<{
|
|
1726
2042
|
updated: number;
|
|
@@ -1737,18 +2053,44 @@ declare const createContactsClient: (apiKey: string, apiUrl?: string) => {
|
|
|
1737
2053
|
createColumn(params: ContactColumnCreateParams): Promise<ContactColumn>;
|
|
1738
2054
|
};
|
|
1739
2055
|
|
|
1740
|
-
type WebhookEvent = "reply_received" | "meeting_booked" | "contact_enriched" | "contact_created" | "sequence_completed" | "sequence_replied" | "campaign_launched" | "form_submitted" | "visitor_identified";
|
|
1741
|
-
type WebhookCallback = (data: Record<string, unknown>) => void;
|
|
1742
2056
|
/**
|
|
1743
|
-
*
|
|
2057
|
+
* Known graph8 webhook event types.
|
|
1744
2058
|
*
|
|
1745
|
-
*
|
|
2059
|
+
* Source of truth is the backend ``WEBHOOK_EVENTS`` catalog
|
|
2060
|
+
* (campaign_builder/services/webhook_service.py). Keep in sync when the backend
|
|
2061
|
+
* adds events. ``WebhookEvent`` also accepts any string so a newly-added
|
|
2062
|
+
* backend event never breaks a client that hasn't upgraded.
|
|
1746
2063
|
*/
|
|
1747
|
-
declare const
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
2064
|
+
declare const KNOWN_WEBHOOK_EVENTS: readonly ["campaign.created", "campaign.updated", "campaign.deleted", "campaign.launched", "campaign.paused", "campaign.completed", "campaign.status_changed", "campaign.content_ready", "document.generated", "document.failed", "intelligence.completed", "intelligence.failed", "company.enriched", "company_intelligence.completed", "audience.ready", "audience.failed", "sequence.deployed", "sequence.started", "sequence.paused", "sequence.completed", "engagement.email_sent", "engagement.email_replied", "engagement.email_bounced", "engagement.email_skipped", "engagement.call_dispatched", "engagement.sms_sent", "engagement.sms_replied", "engagement.whatsapp_sent", "engagement.linkedin_connection_sent", "engagement.linkedin_message_sent", "engagement.linkedin_inmail_sent", "engagement.linkedin_reply_received", "engagement.linkedin_connection_accepted", "meeting.booked", "meeting.cancelled", "meeting.rescheduled"];
|
|
2065
|
+
type WebhookEvent = (typeof KNOWN_WEBHOOK_EVENTS)[number] | (string & {});
|
|
2066
|
+
/** The decoded body graph8 delivers to a webhook endpoint. */
|
|
2067
|
+
interface WebhookEventPayload {
|
|
2068
|
+
event: WebhookEvent;
|
|
2069
|
+
timestamp: string;
|
|
2070
|
+
data: Record<string, unknown>;
|
|
2071
|
+
org_id: string;
|
|
2072
|
+
/** Stable per-delivery id (present once the backend adds it; for consumer dedup). */
|
|
2073
|
+
id?: string;
|
|
2074
|
+
}
|
|
2075
|
+
interface ConstructEventOptions {
|
|
2076
|
+
/**
|
|
2077
|
+
* Reject events whose ``X-Studio-Timestamp`` is older (or newer) than this
|
|
2078
|
+
* many seconds — replay protection. Disabled when 0/undefined.
|
|
2079
|
+
*/
|
|
2080
|
+
toleranceSeconds?: number;
|
|
2081
|
+
}
|
|
2082
|
+
/**
|
|
2083
|
+
* Webhooks client (server-side). graph8 webhooks are PUSH — graph8 POSTs to your
|
|
2084
|
+
* endpoint; you verify each delivery with {@link constructEvent}. (The previous
|
|
2085
|
+
* polling implementation hit a feed endpoint that never existed and is removed.)
|
|
2086
|
+
*/
|
|
2087
|
+
declare const createWebhooksClient: (_apiKey: string, apiUrl?: string) => {
|
|
2088
|
+
/** Base URL the webhook subscription API lives under. */
|
|
2089
|
+
baseUrl: string;
|
|
2090
|
+
/** Known event types (for autocomplete / validation). */
|
|
2091
|
+
knownEvents: readonly ["campaign.created", "campaign.updated", "campaign.deleted", "campaign.launched", "campaign.paused", "campaign.completed", "campaign.status_changed", "campaign.content_ready", "document.generated", "document.failed", "intelligence.completed", "intelligence.failed", "company.enriched", "company_intelligence.completed", "audience.ready", "audience.failed", "sequence.deployed", "sequence.started", "sequence.paused", "sequence.completed", "engagement.email_sent", "engagement.email_replied", "engagement.email_bounced", "engagement.email_skipped", "engagement.call_dispatched", "engagement.sms_sent", "engagement.sms_replied", "engagement.whatsapp_sent", "engagement.linkedin_connection_sent", "engagement.linkedin_message_sent", "engagement.linkedin_inmail_sent", "engagement.linkedin_reply_received", "engagement.linkedin_connection_accepted", "meeting.booked", "meeting.cancelled", "meeting.rescheduled"];
|
|
2092
|
+
/** Verify an incoming webhook's HMAC signature and return the parsed event. */
|
|
2093
|
+
constructEvent(payload: string, signature: string, timestamp: string | number, secret: string, opts?: ConstructEventOptions): WebhookEventPayload;
|
|
1752
2094
|
};
|
|
1753
2095
|
|
|
1754
2096
|
interface LandingPage {
|
|
@@ -1759,7 +2101,9 @@ interface LandingPage {
|
|
|
1759
2101
|
published_url: string | null;
|
|
1760
2102
|
}
|
|
1761
2103
|
/**
|
|
1762
|
-
* Landing pages - clone, create, publish. Requires API key (server-side).
|
|
2104
|
+
* Landing pages - clone, create, publish. Requires API key (server-side). On the
|
|
2105
|
+
* hardened HTTP core: throws a typed `G8Error` on failure and retries transient
|
|
2106
|
+
* errors.
|
|
1763
2107
|
*/
|
|
1764
2108
|
declare const createPagesClient: (apiKey: string, apiUrl?: string) => {
|
|
1765
2109
|
/** Clone a landing page from any URL. */
|
|
@@ -2117,6 +2461,12 @@ interface AnalyticsOverview {
|
|
|
2117
2461
|
}
|
|
2118
2462
|
/**
|
|
2119
2463
|
* Analytics - dashboard data and metrics. Requires API key (server-side).
|
|
2464
|
+
*
|
|
2465
|
+
* On the hardened HTTP core: throws a typed `G8Error` on failure and retries
|
|
2466
|
+
* transient errors. Note the deliberate behavior change vs the preview client —
|
|
2467
|
+
* a non-2xx response now **throws** instead of silently returning an all-zeros
|
|
2468
|
+
* overview, so callers can distinguish genuinely-zero activity from an auth/5xx
|
|
2469
|
+
* failure.
|
|
2120
2470
|
*/
|
|
2121
2471
|
declare const createAnalyticsClient: (apiKey: string, apiUrl?: string) => {
|
|
2122
2472
|
overview(config?: {
|
|
@@ -2149,7 +2499,9 @@ interface Integration {
|
|
|
2149
2499
|
connected_at: string | null;
|
|
2150
2500
|
}
|
|
2151
2501
|
/**
|
|
2152
|
-
* Integrations - connect CRM platforms, trigger syncs. Requires API key
|
|
2502
|
+
* Integrations - connect CRM platforms, trigger syncs. Requires API key
|
|
2503
|
+
* (server-side). On the hardened HTTP core: throws a typed `G8Error` on failure
|
|
2504
|
+
* and retries transient errors.
|
|
2153
2505
|
*/
|
|
2154
2506
|
declare const createIntegrationsClient: (apiKey: string, apiUrl?: string) => {
|
|
2155
2507
|
list(): Promise<Integration[]>;
|
|
@@ -2185,6 +2537,8 @@ interface CampaignStats {
|
|
|
2185
2537
|
}
|
|
2186
2538
|
/**
|
|
2187
2539
|
* Campaigns - create, manage, launch campaigns. Requires API key (server-side).
|
|
2540
|
+
* On the hardened HTTP core: throws a typed `G8Error` on failure and retries
|
|
2541
|
+
* transient errors.
|
|
2188
2542
|
*/
|
|
2189
2543
|
declare const createCampaignsClient: (apiKey: string, apiUrl?: string) => {
|
|
2190
2544
|
list(page?: number, limit?: number): Promise<Campaign[]>;
|
|
@@ -2403,22 +2757,40 @@ declare const createSequencesClient: (apiKey: string, apiUrl?: string) => {
|
|
|
2403
2757
|
data: SequenceContactItem[];
|
|
2404
2758
|
pagination?: PaginationMeta;
|
|
2405
2759
|
}>;
|
|
2406
|
-
/**
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2760
|
+
/**
|
|
2761
|
+
* Add contacts to a sequence (V2 queuing). Live or drafted sequences only.
|
|
2762
|
+
* Pass `idempotencyKey` to make a retry safe — the same key returns the
|
|
2763
|
+
* first result instead of re-enrolling on a 5xx-then-success (A6).
|
|
2764
|
+
*/
|
|
2765
|
+
add(config: AddToSequenceConfig, idempotencyKey?: string): Promise<SequenceActionResult>;
|
|
2766
|
+
/**
|
|
2767
|
+
* Create a new sequence with optional steps + channels. Pass `idempotencyKey`
|
|
2768
|
+
* to make a retry safe — the same key returns the first result instead of
|
|
2769
|
+
* creating a duplicate sequence on a 5xx-then-success (A6).
|
|
2770
|
+
*/
|
|
2771
|
+
create(payload: SequenceCreateParams, idempotencyKey?: string): Promise<SequenceCreateResult>;
|
|
2410
2772
|
/** Update sequence metadata. Rejected (409) if sequence is in a transitional status. */
|
|
2411
2773
|
update(sequenceId: string, fields: SequenceUpdateParams): Promise<SequenceActionResult>;
|
|
2412
2774
|
/** Update a single step within a sequence. */
|
|
2413
2775
|
updateStep(sequenceId: string, stepId: string, fields: SequenceStepUpdateParams): Promise<SequenceActionResult>;
|
|
2414
2776
|
/** Soft-delete (archive) a sequence. */
|
|
2415
2777
|
delete(sequenceId: string): Promise<SequenceActionResult>;
|
|
2416
|
-
/**
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2778
|
+
/**
|
|
2779
|
+
* Run/start a DRAFTED sequence (V2 orchestration). Pass `idempotencyKey` to
|
|
2780
|
+
* make a retry safe — the same key won't re-trigger the run on a
|
|
2781
|
+
* 5xx-then-success (A6).
|
|
2782
|
+
*/
|
|
2783
|
+
run(sequenceId: string, idempotencyKey?: string): Promise<SequenceActionResult>;
|
|
2784
|
+
/**
|
|
2785
|
+
* Pause a live sequence. Pass `idempotencyKey` to make a retry safe — the
|
|
2786
|
+
* same key won't double-apply on a 5xx-then-success (A6).
|
|
2787
|
+
*/
|
|
2788
|
+
pause(sequenceId: string, idempotencyKey?: string): Promise<SequenceActionResult>;
|
|
2789
|
+
/**
|
|
2790
|
+
* Resume a paused sequence. Pass `idempotencyKey` to make a retry safe — the
|
|
2791
|
+
* same key won't double-apply on a 5xx-then-success (A6).
|
|
2792
|
+
*/
|
|
2793
|
+
resume(sequenceId: string, idempotencyKey?: string): Promise<SequenceActionResult>;
|
|
2422
2794
|
/** Read-only sequence preview with all steps + channels (no enrollment). */
|
|
2423
2795
|
preview(sequenceId: string): Promise<SequencePreview>;
|
|
2424
2796
|
/** Comprehensive analytics for a sequence. */
|
|
@@ -2454,7 +2826,8 @@ interface SearchResults {
|
|
|
2454
2826
|
/**
|
|
2455
2827
|
* Enrichment API - person/company lookup, email verification, prospecting search.
|
|
2456
2828
|
*
|
|
2457
|
-
* Requires API key (server-side only). Credits charged per call.
|
|
2829
|
+
* Requires API key (server-side only). Credits charged per call. On the hardened
|
|
2830
|
+
* HTTP core: throws a typed `G8Error` on failure and retries transient errors.
|
|
2458
2831
|
*/
|
|
2459
2832
|
declare const createEnrichClient: (apiKey: string, apiUrl?: string) => {
|
|
2460
2833
|
/** Look up a person by email, LinkedIn, or name + company. Costs 1 credit. */
|
|
@@ -2761,6 +3134,11 @@ declare const useG8: () => {
|
|
|
2761
3134
|
_intent: ReturnType<typeof createIntentClient> | null;
|
|
2762
3135
|
_studio: ReturnType<typeof createStudioClient> | null;
|
|
2763
3136
|
_meetings: ReturnType<typeof createMeetingsClient> | null;
|
|
3137
|
+
_audiences: ReturnType<typeof createAudiencesClient> | null;
|
|
3138
|
+
_search: ReturnType<typeof createSearchClient> | null;
|
|
3139
|
+
_agency: ReturnType<typeof createAgencyClient> | null;
|
|
3140
|
+
_marketplace: ReturnType<typeof createMarketplaceClient> | null;
|
|
3141
|
+
_snippet: ReturnType<typeof createSnippetClient> | null;
|
|
2764
3142
|
init(config: G8Config): void;
|
|
2765
3143
|
track(event: string, properties?: TrackProperties): void;
|
|
2766
3144
|
identify(userId: string, properties?: IdentifyProperties): void;
|
|
@@ -2824,14 +3202,14 @@ declare const useG8: () => {
|
|
|
2824
3202
|
data: SequenceContactItem[];
|
|
2825
3203
|
pagination?: PaginationMeta;
|
|
2826
3204
|
}>;
|
|
2827
|
-
add(config: AddToSequenceConfig): Promise<SequenceActionResult>;
|
|
2828
|
-
create(payload: SequenceCreateParams): Promise<SequenceCreateResult>;
|
|
3205
|
+
add(config: AddToSequenceConfig, idempotencyKey?: string): Promise<SequenceActionResult>;
|
|
3206
|
+
create(payload: SequenceCreateParams, idempotencyKey?: string): Promise<SequenceCreateResult>;
|
|
2829
3207
|
update(sequenceId: string, fields: SequenceUpdateParams): Promise<SequenceActionResult>;
|
|
2830
3208
|
updateStep(sequenceId: string, stepId: string, fields: SequenceStepUpdateParams): Promise<SequenceActionResult>;
|
|
2831
3209
|
delete(sequenceId: string): Promise<SequenceActionResult>;
|
|
2832
|
-
run(sequenceId: string): Promise<SequenceActionResult>;
|
|
2833
|
-
pause(sequenceId: string): Promise<SequenceActionResult>;
|
|
2834
|
-
resume(sequenceId: string): Promise<SequenceActionResult>;
|
|
3210
|
+
run(sequenceId: string, idempotencyKey?: string): Promise<SequenceActionResult>;
|
|
3211
|
+
pause(sequenceId: string, idempotencyKey?: string): Promise<SequenceActionResult>;
|
|
3212
|
+
resume(sequenceId: string, idempotencyKey?: string): Promise<SequenceActionResult>;
|
|
2835
3213
|
preview(sequenceId: string): Promise<SequencePreview>;
|
|
2836
3214
|
analytics(sequenceId: string): Promise<SequenceAnalytics>;
|
|
2837
3215
|
};
|
|
@@ -2925,8 +3303,9 @@ declare const useG8: () => {
|
|
|
2925
3303
|
}>;
|
|
2926
3304
|
};
|
|
2927
3305
|
get webhooks(): {
|
|
2928
|
-
|
|
2929
|
-
|
|
3306
|
+
baseUrl: string;
|
|
3307
|
+
knownEvents: readonly ["campaign.created", "campaign.updated", "campaign.deleted", "campaign.launched", "campaign.paused", "campaign.completed", "campaign.status_changed", "campaign.content_ready", "document.generated", "document.failed", "intelligence.completed", "intelligence.failed", "company.enriched", "company_intelligence.completed", "audience.ready", "audience.failed", "sequence.deployed", "sequence.started", "sequence.paused", "sequence.completed", "engagement.email_sent", "engagement.email_replied", "engagement.email_bounced", "engagement.email_skipped", "engagement.call_dispatched", "engagement.sms_sent", "engagement.sms_replied", "engagement.whatsapp_sent", "engagement.linkedin_connection_sent", "engagement.linkedin_message_sent", "engagement.linkedin_inmail_sent", "engagement.linkedin_reply_received", "engagement.linkedin_connection_accepted", "meeting.booked", "meeting.cancelled", "meeting.rescheduled"];
|
|
3308
|
+
constructEvent(payload: string, signature: string, timestamp: string | number, secret: string, opts?: ConstructEventOptions): WebhookEventPayload;
|
|
2930
3309
|
};
|
|
2931
3310
|
get contacts(): {
|
|
2932
3311
|
list(params?: ContactListParams): Promise<{
|
|
@@ -2934,7 +3313,7 @@ declare const useG8: () => {
|
|
|
2934
3313
|
total: number;
|
|
2935
3314
|
}>;
|
|
2936
3315
|
get(contactId: number): Promise<Contact>;
|
|
2937
|
-
create(contact: ContactCreateParams): Promise<Contact>;
|
|
3316
|
+
create(contact: ContactCreateParams, idempotencyKey?: string): Promise<Contact>;
|
|
2938
3317
|
update(contactId: number, fields: ContactUpdateParams): Promise<{
|
|
2939
3318
|
updated: number;
|
|
2940
3319
|
}>;
|
|
@@ -3415,6 +3794,58 @@ declare const useG8: () => {
|
|
|
3415
3794
|
}>;
|
|
3416
3795
|
get(meetingId: string): Promise<MeetingDetail>;
|
|
3417
3796
|
};
|
|
3797
|
+
get audiences(): {
|
|
3798
|
+
list(): Promise<{
|
|
3799
|
+
data: AudienceSync[];
|
|
3800
|
+
}>;
|
|
3801
|
+
create(params: AudienceSyncCreateParams): Promise<AudienceSync>;
|
|
3802
|
+
get(configId: number): Promise<AudienceSync>;
|
|
3803
|
+
update(configId: number, fields: AudienceSyncUpdateParams): Promise<AudienceSync>;
|
|
3804
|
+
delete(configId: number): Promise<{
|
|
3805
|
+
data: Record<string, unknown>;
|
|
3806
|
+
}>;
|
|
3807
|
+
trigger(configId: number): Promise<{
|
|
3808
|
+
data: Record<string, unknown>;
|
|
3809
|
+
}>;
|
|
3810
|
+
runs(configId: number): Promise<{
|
|
3811
|
+
data: AudienceSyncRun[];
|
|
3812
|
+
}>;
|
|
3813
|
+
errors(configId: number): Promise<{
|
|
3814
|
+
data: AudienceSyncError[];
|
|
3815
|
+
}>;
|
|
3816
|
+
};
|
|
3817
|
+
get search(): {
|
|
3818
|
+
contacts(params?: SearchParams): Promise<{
|
|
3819
|
+
data: SearchContactItem[];
|
|
3820
|
+
}>;
|
|
3821
|
+
companies(params?: SearchParams): Promise<{
|
|
3822
|
+
data: SearchCompanyItem[];
|
|
3823
|
+
}>;
|
|
3824
|
+
saveContacts(params: SearchSaveParams): Promise<SearchSaveResult>;
|
|
3825
|
+
saveCompanies(params: SearchSaveParams): Promise<SearchSaveResult>;
|
|
3826
|
+
};
|
|
3827
|
+
get agency(): {
|
|
3828
|
+
me(): Promise<AgencyInfo>;
|
|
3829
|
+
clients(): Promise<{
|
|
3830
|
+
data: AgencyClient[];
|
|
3831
|
+
}>;
|
|
3832
|
+
};
|
|
3833
|
+
get marketplace(): {
|
|
3834
|
+
profile(): Promise<MarketplaceProfile>;
|
|
3835
|
+
offers(): Promise<{
|
|
3836
|
+
offers: MarketplaceOffer[];
|
|
3837
|
+
count: number;
|
|
3838
|
+
}>;
|
|
3839
|
+
acceptOffer(hiringId: string): Promise<Record<string, unknown>>;
|
|
3840
|
+
rejectOffer(hiringId: string): Promise<Record<string, unknown>>;
|
|
3841
|
+
hirings(): Promise<{
|
|
3842
|
+
hirings: MarketplaceHiring[];
|
|
3843
|
+
count: number;
|
|
3844
|
+
}>;
|
|
3845
|
+
};
|
|
3846
|
+
get snippet(): {
|
|
3847
|
+
get(): Promise<Snippet>;
|
|
3848
|
+
};
|
|
3418
3849
|
get initialized(): boolean;
|
|
3419
3850
|
_assertInit(): void;
|
|
3420
3851
|
_assertKey(module: string): void;
|