@graph8/sdk 0.7.2 → 0.12.0
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 +67 -39
- package/dist/index.d.mts +416 -164
- package/dist/index.d.ts +416 -164
- package/dist/index.js +291 -178
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +284 -178
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +186 -156
- package/dist/react.d.ts +186 -156
- package/dist/react.js +115 -178
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +115 -178
- package/dist/react.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -434,11 +434,11 @@ interface ResearchReport {
|
|
|
434
434
|
* Requires API key (server-side).
|
|
435
435
|
*
|
|
436
436
|
* Backed by:
|
|
437
|
-
* GET
|
|
438
|
-
* GET /api/v1/icps
|
|
439
|
-
* GET /api/v1/personas
|
|
440
|
-
* GET
|
|
441
|
-
* GET
|
|
437
|
+
* GET /api/v1/global-context/documents
|
|
438
|
+
* GET /api/v1/icps POST /api/v1/icps PATCH /api/v1/icps/{id} POST /api/v1/icps/{id}/archive
|
|
439
|
+
* GET /api/v1/personas POST /api/v1/personas PATCH /api/v1/personas/{id} POST /api/v1/personas/{id}/archive
|
|
440
|
+
* GET /api/v1/intelligence-data
|
|
441
|
+
* GET /api/v1/research-reports
|
|
442
442
|
*/
|
|
443
443
|
declare const createStudioClient: (apiKey: string, apiUrl?: string) => {
|
|
444
444
|
/** Org-level Studio documents (brand_brief, value_props, messaging_house, etc.).
|
|
@@ -479,6 +479,66 @@ declare const createStudioClient: (apiKey: string, apiUrl?: string) => {
|
|
|
479
479
|
}): Promise<{
|
|
480
480
|
data: ResearchReport[];
|
|
481
481
|
}>;
|
|
482
|
+
/** Create an ICP manually (no AI scoring). Requires name + website_url. */
|
|
483
|
+
createIcp(body: {
|
|
484
|
+
name: string;
|
|
485
|
+
website_url: string;
|
|
486
|
+
description?: string;
|
|
487
|
+
firmographics?: Record<string, unknown>;
|
|
488
|
+
tech_stack?: Record<string, unknown>;
|
|
489
|
+
buying_signals?: unknown[];
|
|
490
|
+
estimated_market_size?: number;
|
|
491
|
+
}): Promise<{
|
|
492
|
+
data: ICP;
|
|
493
|
+
}>;
|
|
494
|
+
/** Update an ICP (partial - send only fields to change). */
|
|
495
|
+
updateIcp(icpId: string, body: {
|
|
496
|
+
name?: string;
|
|
497
|
+
description?: string;
|
|
498
|
+
firmographics?: Record<string, unknown>;
|
|
499
|
+
tech_stack?: Record<string, unknown>;
|
|
500
|
+
buying_signals?: unknown[];
|
|
501
|
+
estimated_market_size?: number;
|
|
502
|
+
}): Promise<{
|
|
503
|
+
data: ICP;
|
|
504
|
+
}>;
|
|
505
|
+
/** Archive an ICP (soft delete - sets status to "archived"). */
|
|
506
|
+
archiveIcp(icpId: string): Promise<{
|
|
507
|
+
data: ICP;
|
|
508
|
+
}>;
|
|
509
|
+
/** Create a buyer persona manually (no AI generation). Requires title + website_url. */
|
|
510
|
+
createPersona(body: {
|
|
511
|
+
title: string;
|
|
512
|
+
website_url: string;
|
|
513
|
+
priority?: number;
|
|
514
|
+
confidence?: string;
|
|
515
|
+
why_target?: string;
|
|
516
|
+
key_signals?: unknown[];
|
|
517
|
+
expected_receptivity?: string;
|
|
518
|
+
campaign_approach?: string;
|
|
519
|
+
recommended_goal?: string;
|
|
520
|
+
source?: string;
|
|
521
|
+
}): Promise<{
|
|
522
|
+
data: Persona;
|
|
523
|
+
}>;
|
|
524
|
+
/** Update a persona (partial). Passing status "archived" is equivalent to archivePersona. */
|
|
525
|
+
updatePersona(personaId: string, body: {
|
|
526
|
+
title?: string;
|
|
527
|
+
priority?: number;
|
|
528
|
+
confidence?: string;
|
|
529
|
+
why_target?: string;
|
|
530
|
+
key_signals?: unknown[];
|
|
531
|
+
expected_receptivity?: string;
|
|
532
|
+
campaign_approach?: string;
|
|
533
|
+
recommended_goal?: string;
|
|
534
|
+
status?: string;
|
|
535
|
+
}): Promise<{
|
|
536
|
+
data: Persona;
|
|
537
|
+
}>;
|
|
538
|
+
/** Archive a persona (soft delete - sets status to "archived"). */
|
|
539
|
+
archivePersona(personaId: string): Promise<{
|
|
540
|
+
data: Persona;
|
|
541
|
+
}>;
|
|
482
542
|
};
|
|
483
543
|
|
|
484
544
|
interface IntentKeyword {
|
|
@@ -1477,7 +1537,20 @@ interface Deal {
|
|
|
1477
1537
|
}
|
|
1478
1538
|
interface DealCreateParams {
|
|
1479
1539
|
name: string;
|
|
1480
|
-
/**
|
|
1540
|
+
/**
|
|
1541
|
+
* Deal owner (user id or email). Required.
|
|
1542
|
+
*/
|
|
1543
|
+
owner_id: string;
|
|
1544
|
+
/**
|
|
1545
|
+
* mashup_contact_ids to attach. Required, at least one. Every contact must
|
|
1546
|
+
* belong to the same company, and that company becomes the deal's company.
|
|
1547
|
+
* Same id space as the contacts API. Attach is idempotent.
|
|
1548
|
+
*/
|
|
1549
|
+
contact_ids: number[];
|
|
1550
|
+
/**
|
|
1551
|
+
* Deprecated: the company is derived from `contact_ids`. If supplied it must
|
|
1552
|
+
* match the contacts' company, otherwise omit it.
|
|
1553
|
+
*/
|
|
1481
1554
|
company_id?: number;
|
|
1482
1555
|
description?: string;
|
|
1483
1556
|
amount?: number;
|
|
@@ -1489,6 +1562,11 @@ interface DealCreateParams {
|
|
|
1489
1562
|
pipeline_id?: string;
|
|
1490
1563
|
/** ISO 8601 close date. */
|
|
1491
1564
|
close_date?: string;
|
|
1565
|
+
/**
|
|
1566
|
+
* Set true to create a deal even if one already exists for the company.
|
|
1567
|
+
* By default the API rejects a duplicate with HTTP 409.
|
|
1568
|
+
*/
|
|
1569
|
+
allow_duplicate?: boolean;
|
|
1492
1570
|
}
|
|
1493
1571
|
interface DealUpdateParams {
|
|
1494
1572
|
name?: string;
|
|
@@ -1498,6 +1576,16 @@ interface DealUpdateParams {
|
|
|
1498
1576
|
stage_id?: string;
|
|
1499
1577
|
/** ISO 8601 close date. */
|
|
1500
1578
|
close_date?: string;
|
|
1579
|
+
/** Reassign the deal owner (user id or email). Pass null to clear. */
|
|
1580
|
+
owner_id?: string | null;
|
|
1581
|
+
/**
|
|
1582
|
+
* mashup_contact_ids to link. Must belong to the deal's company (if the deal
|
|
1583
|
+
* has none yet, the added contacts' company is adopted); a cross-company add
|
|
1584
|
+
* is rejected. Idempotent.
|
|
1585
|
+
*/
|
|
1586
|
+
add_contact_ids?: number[];
|
|
1587
|
+
/** mashup_contact_ids to unlink. Idempotent. */
|
|
1588
|
+
remove_contact_ids?: number[];
|
|
1501
1589
|
}
|
|
1502
1590
|
interface DealListParams {
|
|
1503
1591
|
page?: number;
|
|
@@ -2059,7 +2147,7 @@ declare const createContactsClient: (apiKey: string, apiUrl?: string) => {
|
|
|
2059
2147
|
* adds events. ``WebhookEvent`` also accepts any string so a newly-added
|
|
2060
2148
|
* backend event never breaks a client that hasn't upgraded.
|
|
2061
2149
|
*/
|
|
2062
|
-
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.
|
|
2150
|
+
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.draft_created", "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"];
|
|
2063
2151
|
type WebhookEvent = (typeof KNOWN_WEBHOOK_EVENTS)[number] | (string & {});
|
|
2064
2152
|
/** The decoded body graph8 delivers to a webhook endpoint. */
|
|
2065
2153
|
interface WebhookEventPayload {
|
|
@@ -2118,56 +2206,11 @@ declare const createWebhooksClient: (_apiKey: string, apiUrl?: string) => {
|
|
|
2118
2206
|
/** Base URL the webhook subscription API lives under. */
|
|
2119
2207
|
baseUrl: string;
|
|
2120
2208
|
/** Known event types (for autocomplete / validation). */
|
|
2121
|
-
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.
|
|
2209
|
+
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.draft_created", "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"];
|
|
2122
2210
|
/** Verify an incoming webhook's HMAC signature and return the parsed event. */
|
|
2123
2211
|
constructEvent(payload: string, signature: string, timestamp: string | number, secret: string, opts?: ConstructEventOptions): WebhookEventPayload;
|
|
2124
2212
|
};
|
|
2125
2213
|
|
|
2126
|
-
interface LandingPage {
|
|
2127
|
-
id: string;
|
|
2128
|
-
title: string;
|
|
2129
|
-
slug: string;
|
|
2130
|
-
status: string;
|
|
2131
|
-
published_url: string | null;
|
|
2132
|
-
}
|
|
2133
|
-
/**
|
|
2134
|
-
* Landing pages - clone, create, publish. Requires API key (server-side). On the
|
|
2135
|
-
* hardened HTTP core: throws a typed `G8Error` on failure and retries transient
|
|
2136
|
-
* errors.
|
|
2137
|
-
*/
|
|
2138
|
-
declare const createPagesClient: (apiKey: string, apiUrl?: string) => {
|
|
2139
|
-
/** Clone a landing page from any URL. */
|
|
2140
|
-
clone(url: string): Promise<LandingPage>;
|
|
2141
|
-
/** Create a landing page from a template. */
|
|
2142
|
-
create(config: {
|
|
2143
|
-
template?: string;
|
|
2144
|
-
title?: string;
|
|
2145
|
-
content?: Record<string, unknown>;
|
|
2146
|
-
}): Promise<LandingPage>;
|
|
2147
|
-
/** Publish a landing page to CDN. */
|
|
2148
|
-
publish(pageId: string): Promise<{
|
|
2149
|
-
url: string;
|
|
2150
|
-
}>;
|
|
2151
|
-
};
|
|
2152
|
-
|
|
2153
|
-
interface VoiceSession {
|
|
2154
|
-
id: string;
|
|
2155
|
-
status: string;
|
|
2156
|
-
agent: string;
|
|
2157
|
-
started_at: string;
|
|
2158
|
-
}
|
|
2159
|
-
interface CallAnalysis {
|
|
2160
|
-
duration_seconds: number;
|
|
2161
|
-
sentiment: "positive" | "neutral" | "negative";
|
|
2162
|
-
summary: string;
|
|
2163
|
-
next_steps: string[];
|
|
2164
|
-
objections: string[];
|
|
2165
|
-
transcript: Array<{
|
|
2166
|
-
speaker: string;
|
|
2167
|
-
text: string;
|
|
2168
|
-
timestamp: number;
|
|
2169
|
-
}>;
|
|
2170
|
-
}
|
|
2171
2214
|
type VoiceEvent = "connected" | "transcription" | "ended" | "error";
|
|
2172
2215
|
type VoiceCallback = (data: Record<string, unknown>) => void;
|
|
2173
2216
|
interface VoicePagination {
|
|
@@ -2399,20 +2442,6 @@ interface DialerSessionResumeResult extends DialerSessionStatusUpdateResult {
|
|
|
2399
2442
|
* GET /api/v1/voice/dialer/agents
|
|
2400
2443
|
*/
|
|
2401
2444
|
declare const createVoiceClient: (apiKey: string, apiUrl?: string) => {
|
|
2402
|
-
/**
|
|
2403
|
-
* Start an AI voice session.
|
|
2404
|
-
* @deprecated Preview surface — for parallel-dialer flows use `voice.dialer.createSession()`.
|
|
2405
|
-
*/
|
|
2406
|
-
start(config: {
|
|
2407
|
-
agent?: string;
|
|
2408
|
-
contactId?: number;
|
|
2409
|
-
context?: Record<string, unknown>;
|
|
2410
|
-
}): Promise<VoiceSession>;
|
|
2411
|
-
/**
|
|
2412
|
-
* Get call analysis for a completed session.
|
|
2413
|
-
* @deprecated Preview surface — for dialer-call grading use `voice.dialer.callGrading(roomName)`.
|
|
2414
|
-
*/
|
|
2415
|
-
analysis(sessionId: string): Promise<CallAnalysis>;
|
|
2416
2445
|
/** Listen for voice events. */
|
|
2417
2446
|
on(event: VoiceEvent, callback: VoiceCallback): void;
|
|
2418
2447
|
/** Parallel-dialer session control + analytics. */
|
|
@@ -2480,31 +2509,6 @@ declare const createVoiceClient: (apiKey: string, apiUrl?: string) => {
|
|
|
2480
2509
|
};
|
|
2481
2510
|
};
|
|
2482
2511
|
|
|
2483
|
-
interface AnalyticsOverview {
|
|
2484
|
-
visitors: number;
|
|
2485
|
-
contacts_created: number;
|
|
2486
|
-
emails_sent: number;
|
|
2487
|
-
emails_opened: number;
|
|
2488
|
-
replies: number;
|
|
2489
|
-
meetings_booked: number;
|
|
2490
|
-
period: string;
|
|
2491
|
-
}
|
|
2492
|
-
/**
|
|
2493
|
-
* Analytics - dashboard data and metrics. Requires API key (server-side).
|
|
2494
|
-
*
|
|
2495
|
-
* On the hardened HTTP core: throws a typed `G8Error` on failure and retries
|
|
2496
|
-
* transient errors. Note the deliberate behavior change vs the preview client —
|
|
2497
|
-
* a non-2xx response now **throws** instead of silently returning an all-zeros
|
|
2498
|
-
* overview, so callers can distinguish genuinely-zero activity from an auth/5xx
|
|
2499
|
-
* failure.
|
|
2500
|
-
*/
|
|
2501
|
-
declare const createAnalyticsClient: (apiKey: string, apiUrl?: string) => {
|
|
2502
|
-
overview(config?: {
|
|
2503
|
-
period?: string;
|
|
2504
|
-
metrics?: string[];
|
|
2505
|
-
}): Promise<AnalyticsOverview>;
|
|
2506
|
-
};
|
|
2507
|
-
|
|
2508
2512
|
interface IntentSignals {
|
|
2509
2513
|
domain: string;
|
|
2510
2514
|
score: number;
|
|
@@ -2522,25 +2526,6 @@ declare const createSignalsClient: (key: string, isApiKey: boolean, apiUrl?: str
|
|
|
2522
2526
|
stream(domains: string[], callback: (signals: IntentSignals[]) => void): () => void;
|
|
2523
2527
|
};
|
|
2524
2528
|
|
|
2525
|
-
interface Integration {
|
|
2526
|
-
id: string;
|
|
2527
|
-
provider: string;
|
|
2528
|
-
status: string;
|
|
2529
|
-
connected_at: string | null;
|
|
2530
|
-
}
|
|
2531
|
-
/**
|
|
2532
|
-
* Integrations - connect CRM platforms, trigger syncs. Requires API key
|
|
2533
|
-
* (server-side). On the hardened HTTP core: throws a typed `G8Error` on failure
|
|
2534
|
-
* and retries transient errors.
|
|
2535
|
-
*/
|
|
2536
|
-
declare const createIntegrationsClient: (apiKey: string, apiUrl?: string) => {
|
|
2537
|
-
list(): Promise<Integration[]>;
|
|
2538
|
-
connect(provider: string, config?: Record<string, unknown>): Promise<void>;
|
|
2539
|
-
sync(provider: string, config?: {
|
|
2540
|
-
direction?: "inbound" | "outbound" | "bidirectional";
|
|
2541
|
-
}): Promise<void>;
|
|
2542
|
-
};
|
|
2543
|
-
|
|
2544
2529
|
interface Campaign {
|
|
2545
2530
|
id: string;
|
|
2546
2531
|
name: string;
|
|
@@ -2559,11 +2544,37 @@ interface CampaignCreateConfig {
|
|
|
2559
2544
|
target_persona?: string;
|
|
2560
2545
|
goal?: string;
|
|
2561
2546
|
}
|
|
2562
|
-
interface
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2547
|
+
interface CampaignLaunchExecution {
|
|
2548
|
+
status: string;
|
|
2549
|
+
contacts_total?: number;
|
|
2550
|
+
contacts_scheduled?: number;
|
|
2551
|
+
contacts_queued?: number;
|
|
2552
|
+
job_id?: string;
|
|
2553
|
+
polling_url?: string;
|
|
2554
|
+
orchestrator_version?: string;
|
|
2555
|
+
}
|
|
2556
|
+
interface CampaignLaunchResult {
|
|
2557
|
+
status: string;
|
|
2558
|
+
campaign_id: string;
|
|
2559
|
+
sequence_id: string;
|
|
2560
|
+
sequence_name: string;
|
|
2561
|
+
steps_created: number;
|
|
2562
|
+
link_id: string;
|
|
2563
|
+
warnings: string[];
|
|
2564
|
+
channels_attached: Array<{
|
|
2565
|
+
mailbox_id: number;
|
|
2566
|
+
email: string;
|
|
2567
|
+
channel_type: string;
|
|
2568
|
+
auto_picked: boolean;
|
|
2569
|
+
}>;
|
|
2570
|
+
agent_assigned: {
|
|
2571
|
+
textual_agent_name: string | null;
|
|
2572
|
+
voice_agent_name: string | null;
|
|
2573
|
+
};
|
|
2574
|
+
schedule_id: string | null;
|
|
2575
|
+
appointment_id: number | null;
|
|
2576
|
+
execution: CampaignLaunchExecution;
|
|
2577
|
+
message: string;
|
|
2567
2578
|
}
|
|
2568
2579
|
/**
|
|
2569
2580
|
* Campaigns - create, manage, launch campaigns. Requires API key (server-side).
|
|
@@ -2574,8 +2585,7 @@ declare const createCampaignsClient: (apiKey: string, apiUrl?: string) => {
|
|
|
2574
2585
|
list(page?: number, limit?: number): Promise<Campaign[]>;
|
|
2575
2586
|
get(campaignId: string): Promise<Campaign>;
|
|
2576
2587
|
create(config: CampaignCreateConfig): Promise<Campaign>;
|
|
2577
|
-
launch(campaignId: string): Promise<
|
|
2578
|
-
stats(campaignId: string): Promise<CampaignStats>;
|
|
2588
|
+
launch(campaignId: string): Promise<CampaignLaunchResult>;
|
|
2579
2589
|
};
|
|
2580
2590
|
|
|
2581
2591
|
interface Sequence {
|
|
@@ -2882,7 +2892,7 @@ declare const createEnrichClient: (apiKey: string, apiUrl?: string) => {
|
|
|
2882
2892
|
}): Promise<CompanyEnrichment>;
|
|
2883
2893
|
/** Verify an email address. Costs 1 credit. */
|
|
2884
2894
|
verifyEmail(email: string): Promise<EmailVerification>;
|
|
2885
|
-
/** Search
|
|
2895
|
+
/** Search 700M+ contacts with filters. Credits charged per result. */
|
|
2886
2896
|
search(filters: SearchFilter[], page?: number, limit?: number): Promise<SearchResults>;
|
|
2887
2897
|
};
|
|
2888
2898
|
|
|
@@ -3104,7 +3114,7 @@ declare const createFormsClient: (writeKey: string, apiUrl?: string) => {
|
|
|
3104
3114
|
* Handles event tracking, identity, and progressive forms.
|
|
3105
3115
|
*
|
|
3106
3116
|
* Usage:
|
|
3107
|
-
* import { g8 } from '@graph8/
|
|
3117
|
+
* import { g8 } from '@graph8/sdk';
|
|
3108
3118
|
* g8.init({ writeKey: 'your_write_key' });
|
|
3109
3119
|
* g8.track('page_view', { page: '/pricing' });
|
|
3110
3120
|
* g8.identify('user@acme.com', { name: 'John', company: 'Acme' });
|
|
@@ -3120,11 +3130,8 @@ declare class G8 {
|
|
|
3120
3130
|
/** @internal */ _enrich: ReturnType<typeof createEnrichClient> | null;
|
|
3121
3131
|
/** @internal */ _sequences: ReturnType<typeof createSequencesClient> | null;
|
|
3122
3132
|
/** @internal */ _campaigns: ReturnType<typeof createCampaignsClient> | null;
|
|
3123
|
-
/** @internal */ _integrations: ReturnType<typeof createIntegrationsClient> | null;
|
|
3124
3133
|
/** @internal */ _signals: ReturnType<typeof createSignalsClient> | null;
|
|
3125
|
-
/** @internal */ _analytics: ReturnType<typeof createAnalyticsClient> | null;
|
|
3126
3134
|
/** @internal */ _voice: ReturnType<typeof createVoiceClient> | null;
|
|
3127
|
-
/** @internal */ _pages: ReturnType<typeof createPagesClient> | null;
|
|
3128
3135
|
/** @internal */ _webhooks: ReturnType<typeof createWebhooksClient> | null;
|
|
3129
3136
|
/** @internal */ _contacts: ReturnType<typeof createContactsClient> | null;
|
|
3130
3137
|
/** @internal */ _companies: ReturnType<typeof createCompaniesClient> | null;
|
|
@@ -3240,37 +3247,15 @@ declare class G8 {
|
|
|
3240
3247
|
list(page?: number, limit?: number): Promise<Campaign[]>;
|
|
3241
3248
|
get(campaignId: string): Promise<Campaign>;
|
|
3242
3249
|
create(config: CampaignCreateConfig): Promise<Campaign>;
|
|
3243
|
-
launch(campaignId: string): Promise<
|
|
3244
|
-
stats(campaignId: string): Promise<CampaignStats>;
|
|
3245
|
-
};
|
|
3246
|
-
/** CRM integrations (requires API key). */
|
|
3247
|
-
get integrations(): {
|
|
3248
|
-
list(): Promise<Integration[]>;
|
|
3249
|
-
connect(provider: string, config?: Record<string, unknown>): Promise<void>;
|
|
3250
|
-
sync(provider: string, config?: {
|
|
3251
|
-
direction?: "inbound" | "outbound" | "bidirectional";
|
|
3252
|
-
}): Promise<void>;
|
|
3250
|
+
launch(campaignId: string): Promise<CampaignLaunchResult>;
|
|
3253
3251
|
};
|
|
3254
3252
|
/** Intent signals. */
|
|
3255
3253
|
get signals(): {
|
|
3256
3254
|
company(domain: string): Promise<IntentSignals>;
|
|
3257
3255
|
stream(domains: string[], callback: (signals: IntentSignals[]) => void): () => void;
|
|
3258
3256
|
};
|
|
3259
|
-
/** Analytics (requires API key). */
|
|
3260
|
-
get analytics(): {
|
|
3261
|
-
overview(config?: {
|
|
3262
|
-
period?: string;
|
|
3263
|
-
metrics?: string[];
|
|
3264
|
-
}): Promise<AnalyticsOverview>;
|
|
3265
|
-
};
|
|
3266
3257
|
/** Voice AI (requires API key). */
|
|
3267
3258
|
get voice(): {
|
|
3268
|
-
start(config: {
|
|
3269
|
-
agent?: string;
|
|
3270
|
-
contactId?: number;
|
|
3271
|
-
context?: Record<string, unknown>;
|
|
3272
|
-
}): Promise<VoiceSession>;
|
|
3273
|
-
analysis(sessionId: string): Promise<CallAnalysis>;
|
|
3274
3259
|
on(event: "error" | "ended" | "connected" | "transcription", callback: (data: Record<string, unknown>) => void): void;
|
|
3275
3260
|
dialer: {
|
|
3276
3261
|
listSessions(params?: DialerSessionsListParams): Promise<DialerSessionsListResult>;
|
|
@@ -3296,7 +3281,7 @@ declare class G8 {
|
|
|
3296
3281
|
contact_id?: number;
|
|
3297
3282
|
user_email?: string;
|
|
3298
3283
|
campaign_id?: string;
|
|
3299
|
-
date_from
|
|
3284
|
+
date_from? /** Marketplace — for SDR/AE talent: profile, hire offers (accept/reject), active hirings (requires API key). */: string;
|
|
3300
3285
|
date_to?: string;
|
|
3301
3286
|
limit?: number;
|
|
3302
3287
|
page?: number;
|
|
@@ -3318,22 +3303,10 @@ declare class G8 {
|
|
|
3318
3303
|
}>;
|
|
3319
3304
|
};
|
|
3320
3305
|
};
|
|
3321
|
-
/** Landing pages (requires API key). */
|
|
3322
|
-
get pages(): {
|
|
3323
|
-
clone(url: string): Promise<LandingPage>;
|
|
3324
|
-
create(config: {
|
|
3325
|
-
template?: string;
|
|
3326
|
-
title?: string;
|
|
3327
|
-
content?: Record<string, unknown>;
|
|
3328
|
-
}): Promise<LandingPage>;
|
|
3329
|
-
publish(pageId: string): Promise<{
|
|
3330
|
-
url: string;
|
|
3331
|
-
}>;
|
|
3332
|
-
};
|
|
3333
3306
|
/** Webhook event listeners (requires API key). */
|
|
3334
3307
|
get webhooks(): {
|
|
3335
3308
|
baseUrl: string;
|
|
3336
|
-
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.
|
|
3309
|
+
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.draft_created", "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"];
|
|
3337
3310
|
constructEvent(payload: string, signature: string, timestamp: string | number, secret: string, opts?: ConstructEventOptions): WebhookEventPayload;
|
|
3338
3311
|
};
|
|
3339
3312
|
/** Contacts CRUD (requires API key). */
|
|
@@ -3607,7 +3580,7 @@ declare class G8 {
|
|
|
3607
3580
|
};
|
|
3608
3581
|
}>;
|
|
3609
3582
|
nodeTypes(params?: {
|
|
3610
|
-
type
|
|
3583
|
+
type? /** Identify a user with properties. */: string;
|
|
3611
3584
|
}): Promise<{
|
|
3612
3585
|
data: NodeTypeSchema[];
|
|
3613
3586
|
}>;
|
|
@@ -3744,7 +3717,7 @@ declare class G8 {
|
|
|
3744
3717
|
data: IntentCompany[];
|
|
3745
3718
|
}>;
|
|
3746
3719
|
keywordContacts(keywordId: string, params?: {
|
|
3747
|
-
limit
|
|
3720
|
+
limit? /** @internal */: number;
|
|
3748
3721
|
date_from?: string;
|
|
3749
3722
|
date_to?: string;
|
|
3750
3723
|
}): Promise<{
|
|
@@ -3808,7 +3781,7 @@ declare class G8 {
|
|
|
3808
3781
|
}>;
|
|
3809
3782
|
personas(params?: {
|
|
3810
3783
|
status?: string;
|
|
3811
|
-
limit
|
|
3784
|
+
limit?: number;
|
|
3812
3785
|
}): Promise<{
|
|
3813
3786
|
data: Persona[];
|
|
3814
3787
|
}>;
|
|
@@ -3824,6 +3797,60 @@ declare class G8 {
|
|
|
3824
3797
|
}): Promise<{
|
|
3825
3798
|
data: ResearchReport[];
|
|
3826
3799
|
}>;
|
|
3800
|
+
createIcp(body: {
|
|
3801
|
+
name: string;
|
|
3802
|
+
website_url: string;
|
|
3803
|
+
description?: string;
|
|
3804
|
+
firmographics?: Record<string, unknown>;
|
|
3805
|
+
tech_stack?: Record<string, unknown>;
|
|
3806
|
+
buying_signals?: unknown[];
|
|
3807
|
+
estimated_market_size?: number;
|
|
3808
|
+
}): Promise<{
|
|
3809
|
+
data: ICP;
|
|
3810
|
+
}>;
|
|
3811
|
+
updateIcp(icpId: string, body: {
|
|
3812
|
+
name?: string;
|
|
3813
|
+
description?: string;
|
|
3814
|
+
firmographics?: Record<string, unknown>;
|
|
3815
|
+
tech_stack?: Record<string, unknown>;
|
|
3816
|
+
buying_signals?: unknown[];
|
|
3817
|
+
estimated_market_size?: number;
|
|
3818
|
+
}): Promise<{
|
|
3819
|
+
data: ICP;
|
|
3820
|
+
}>;
|
|
3821
|
+
archiveIcp(icpId: string): Promise<{
|
|
3822
|
+
data: ICP;
|
|
3823
|
+
}>;
|
|
3824
|
+
createPersona(body: {
|
|
3825
|
+
title: string;
|
|
3826
|
+
website_url: string;
|
|
3827
|
+
priority?: number;
|
|
3828
|
+
confidence?: string;
|
|
3829
|
+
why_target?: string;
|
|
3830
|
+
key_signals?: unknown[];
|
|
3831
|
+
expected_receptivity?: string;
|
|
3832
|
+
campaign_approach?: string;
|
|
3833
|
+
recommended_goal?: string;
|
|
3834
|
+
source?: string;
|
|
3835
|
+
}): Promise<{
|
|
3836
|
+
data: Persona;
|
|
3837
|
+
}>;
|
|
3838
|
+
updatePersona(personaId: string, body: {
|
|
3839
|
+
title?: string;
|
|
3840
|
+
priority?: number;
|
|
3841
|
+
confidence?: string;
|
|
3842
|
+
why_target?: string;
|
|
3843
|
+
key_signals?: unknown[];
|
|
3844
|
+
expected_receptivity?: string;
|
|
3845
|
+
campaign_approach?: string;
|
|
3846
|
+
recommended_goal?: string;
|
|
3847
|
+
status?: string;
|
|
3848
|
+
}): Promise<{
|
|
3849
|
+
data: Persona;
|
|
3850
|
+
}>;
|
|
3851
|
+
archivePersona(personaId: string): Promise<{
|
|
3852
|
+
data: Persona;
|
|
3853
|
+
}>;
|
|
3827
3854
|
};
|
|
3828
3855
|
/** Meetings — read scheduled, completed, cancelled meetings with transcripts + AI analysis (requires API key). */
|
|
3829
3856
|
get meetings(): {
|
|
@@ -3989,4 +4016,229 @@ interface PaginatedResponse<T> {
|
|
|
3989
4016
|
*/
|
|
3990
4017
|
declare function paginate<T>(fetchPage: (cursor?: string) => Promise<PaginatedResponse<T>>): AsyncGenerator<T, void, unknown>;
|
|
3991
4018
|
|
|
3992
|
-
|
|
4019
|
+
/**
|
|
4020
|
+
* App-platform token exchange + refresh core (M6-9).
|
|
4021
|
+
*
|
|
4022
|
+
* The hosted-app clients never carry a permanent org API key. Instead they mint
|
|
4023
|
+
* SHORT-LIVED app tokens by EXCHANGING a longer-lived credential, and refresh
|
|
4024
|
+
* them on/near expiry:
|
|
4025
|
+
*
|
|
4026
|
+
* - browser apps exchange the caller's PropelAuth login at
|
|
4027
|
+
* `POST /api/v1/app-sessions/exchange` (identity is derived server-side from
|
|
4028
|
+
* the validated principal — the body only names the target app + scopes);
|
|
4029
|
+
* - hosted backends exchange service client-credentials at
|
|
4030
|
+
* `POST /api/v1/service-token`.
|
|
4031
|
+
*
|
|
4032
|
+
* Both endpoints answer with the reused `ApiResponse` envelope wrapping a
|
|
4033
|
+
* `TokenResponse` (see developer_api/app_platform/app_tokens/dtos.py). This
|
|
4034
|
+
* module owns:
|
|
4035
|
+
*
|
|
4036
|
+
* - `AppTokenResponse` — the minted-token payload shape (frozen wire contract);
|
|
4037
|
+
* - `createTokenManager` — caches a token, refreshes it on/near expiry, and
|
|
4038
|
+
* de-dupes concurrent refreshes into one in-flight exchange;
|
|
4039
|
+
* - `createAppRequester` — binds the managed token onto the hardened
|
|
4040
|
+
* `request()` core (typed `G8Error`, retries, idempotency, pagination),
|
|
4041
|
+
* attaching `Authorization: Bearer <app-token>` (plus any static header such
|
|
4042
|
+
* as a service client's `X-Target-Org-Id`) and refreshing once on a 401.
|
|
4043
|
+
*
|
|
4044
|
+
* The backend app-token API is INERT/unmounted today (behind a deny-by-default
|
|
4045
|
+
* flag), so these paths are exercised against mocked HTTP, never a live server.
|
|
4046
|
+
*/
|
|
4047
|
+
declare const DEFAULT_APP_API = "https://be.graph8.com";
|
|
4048
|
+
/** The minted app token + the non-secret metadata a client reads back.
|
|
4049
|
+
* Mirrors `TokenResponse` in developer_api/app_platform/app_tokens/dtos.py. */
|
|
4050
|
+
interface AppTokenResponse {
|
|
4051
|
+
/** The signed app JWT (attach as `Authorization: Bearer <access_token>`). */
|
|
4052
|
+
access_token: string;
|
|
4053
|
+
/** Always "Bearer". */
|
|
4054
|
+
token_type: string;
|
|
4055
|
+
/** Lifetime in seconds from issuance. */
|
|
4056
|
+
expires_in: number;
|
|
4057
|
+
/** The distinct-per-app, per-environment audience. */
|
|
4058
|
+
audience: string;
|
|
4059
|
+
/** App the token is bound to (dapp_-prefixed). */
|
|
4060
|
+
app_id: string;
|
|
4061
|
+
/** Signing key id (matches a JWKS entry). */
|
|
4062
|
+
kid: string;
|
|
4063
|
+
}
|
|
4064
|
+
/** Per-request options accepted by an {@link AppRequest}. A subset of the
|
|
4065
|
+
* hardened core's `RequestOptions` — auth (the app token) and the injected
|
|
4066
|
+
* fetch/sleep seams are bound by the requester, not passed per call. */
|
|
4067
|
+
interface AppRequestOptions {
|
|
4068
|
+
method?: string;
|
|
4069
|
+
body?: unknown;
|
|
4070
|
+
headers?: Record<string, string>;
|
|
4071
|
+
query?: Record<string, unknown>;
|
|
4072
|
+
/** Sent as `Idempotency-Key` for safe POST/PATCH retries. */
|
|
4073
|
+
idempotencyKey?: string;
|
|
4074
|
+
/** Max retry attempts on 429/5xx/network (default 2). */
|
|
4075
|
+
maxRetries?: number;
|
|
4076
|
+
/** Base backoff in ms (default 200). */
|
|
4077
|
+
retryBaseMs?: number;
|
|
4078
|
+
signal?: AbortSignal;
|
|
4079
|
+
}
|
|
4080
|
+
/** A token-bound request function: same ergonomics as the raw `request()` core
|
|
4081
|
+
* minus the credential, which the token manager supplies. */
|
|
4082
|
+
type AppRequest = <T = unknown>(path: string, opts?: AppRequestOptions) => Promise<T>;
|
|
4083
|
+
/** Caches + refreshes one app token. */
|
|
4084
|
+
interface TokenManager {
|
|
4085
|
+
/** Return a valid token, refreshing on/near expiry. `force` refreshes now. */
|
|
4086
|
+
getToken(force?: boolean): Promise<string>;
|
|
4087
|
+
/** Current token expiry as an epoch-ms timestamp (0 before the first mint). */
|
|
4088
|
+
expiresAt(): number;
|
|
4089
|
+
}
|
|
4090
|
+
/**
|
|
4091
|
+
* Build a token manager over a `refresh` exchange.
|
|
4092
|
+
*
|
|
4093
|
+
* Freshness rule: a cached token is reused until it is within `refreshSkewMs`
|
|
4094
|
+
* of expiry, then a refresh is triggered. Concurrent callers during a refresh
|
|
4095
|
+
* share ONE in-flight exchange (no stampede). `now` is injectable for tests.
|
|
4096
|
+
*/
|
|
4097
|
+
declare function createTokenManager(args: {
|
|
4098
|
+
refresh: () => Promise<AppTokenResponse>;
|
|
4099
|
+
now?: () => number;
|
|
4100
|
+
refreshSkewMs?: number;
|
|
4101
|
+
}): TokenManager;
|
|
4102
|
+
/**
|
|
4103
|
+
* Bind a {@link TokenManager} onto the hardened `request()` core.
|
|
4104
|
+
*
|
|
4105
|
+
* Every call fetches the current token, attaches `Authorization: Bearer …`
|
|
4106
|
+
* (plus any `extraHeaders`, e.g. a service client's `X-Target-Org-Id`), and
|
|
4107
|
+
* reuses all of the core's typed errors / retries / idempotency. On a 401 —
|
|
4108
|
+
* a token revoked or gone stale mid-window — it force-refreshes ONCE and retries.
|
|
4109
|
+
*/
|
|
4110
|
+
declare function createAppRequester(args: {
|
|
4111
|
+
baseUrl: string;
|
|
4112
|
+
tokens: TokenManager;
|
|
4113
|
+
extraHeaders?: Record<string, string>;
|
|
4114
|
+
fetchImpl?: typeof fetch;
|
|
4115
|
+
sleepImpl?: (ms: number) => Promise<void>;
|
|
4116
|
+
}): AppRequest;
|
|
4117
|
+
/**
|
|
4118
|
+
* Exchange the caller's PropelAuth token for a short-lived BROWSER app token.
|
|
4119
|
+
* `POST /api/v1/app-sessions/exchange` (body = target app + scopes only;
|
|
4120
|
+
* identity/role/tenant are derived server-side from the validated principal).
|
|
4121
|
+
*/
|
|
4122
|
+
declare function exchangeBrowserToken(args: {
|
|
4123
|
+
baseUrl: string;
|
|
4124
|
+
appId: string;
|
|
4125
|
+
scopes?: string[];
|
|
4126
|
+
getPropelAuthToken: () => string | Promise<string>;
|
|
4127
|
+
fetchImpl?: typeof fetch;
|
|
4128
|
+
sleepImpl?: (ms: number) => Promise<void>;
|
|
4129
|
+
}): Promise<AppTokenResponse>;
|
|
4130
|
+
/**
|
|
4131
|
+
* Exchange service client-credentials for a SERVICE app token.
|
|
4132
|
+
* `POST /api/v1/service-token` — credentials travel in the body; this endpoint
|
|
4133
|
+
* has no bearer auth, so no `Authorization` is sent on the exchange itself.
|
|
4134
|
+
*/
|
|
4135
|
+
declare function exchangeServiceToken(args: {
|
|
4136
|
+
baseUrl: string;
|
|
4137
|
+
clientId: string;
|
|
4138
|
+
clientSecret: string;
|
|
4139
|
+
scopes?: string[];
|
|
4140
|
+
ttlSeconds?: number;
|
|
4141
|
+
fetchImpl?: typeof fetch;
|
|
4142
|
+
sleepImpl?: (ms: number) => Promise<void>;
|
|
4143
|
+
}): Promise<AppTokenResponse>;
|
|
4144
|
+
|
|
4145
|
+
/**
|
|
4146
|
+
* Hosted app-platform clients (M6-9).
|
|
4147
|
+
*
|
|
4148
|
+
* Two entry points, both additive to `@graph8/sdk` and independent of the
|
|
4149
|
+
* `g8` tracking/API-key singleton:
|
|
4150
|
+
*
|
|
4151
|
+
* - `createGraph8AppClient` — BROWSER client. Exchanges the caller's
|
|
4152
|
+
* PropelAuth token for a short-lived app token, refreshes it on/near expiry,
|
|
4153
|
+
* and attaches `Authorization: Bearer <app-token>` to every call. It NEVER
|
|
4154
|
+
* accepts a permanent org API key for browser init (the whole reason the
|
|
4155
|
+
* token-exchange exists).
|
|
4156
|
+
* - `createGraph8ServiceClient` — BACKEND client. Exchanges service
|
|
4157
|
+
* client-credentials for a service app token and sends `X-Target-Org-Id`
|
|
4158
|
+
* for the single configured tenant on every call.
|
|
4159
|
+
*
|
|
4160
|
+
* Both expose a token-bound `request()` — the hardened `request()` core with the
|
|
4161
|
+
* minted app token attached — so callers reach Developer API routes with the
|
|
4162
|
+
* app token and reuse the core's typed `G8Error`, retries, idempotency, and
|
|
4163
|
+
* cursor pagination. The typed `apps` (control-plane) and `objects`
|
|
4164
|
+
* (custom-object CRUD) resource modules are DEFERRED until their backend routes
|
|
4165
|
+
* ship and freeze (M6-3 / M6-5); only the auth clients ship here.
|
|
4166
|
+
*/
|
|
4167
|
+
|
|
4168
|
+
/** Config for {@link createGraph8AppClient} (browser). No API key is accepted. */
|
|
4169
|
+
interface Graph8AppClientConfig {
|
|
4170
|
+
/** Target app id (dapp_-prefixed). */
|
|
4171
|
+
appId: string;
|
|
4172
|
+
/** The client org this browser session acts in (informational; the server
|
|
4173
|
+
* derives the authoritative tenant from the validated PropelAuth principal). */
|
|
4174
|
+
tenantOrgId: string;
|
|
4175
|
+
/** Returns the caller's current PropelAuth token (sync or async). */
|
|
4176
|
+
getPropelAuthToken: () => string | Promise<string>;
|
|
4177
|
+
/** Scopes to embed in the minted app token. */
|
|
4178
|
+
scopes?: string[];
|
|
4179
|
+
/** Backend API URL (default https://be.graph8.com). */
|
|
4180
|
+
apiUrl?: string;
|
|
4181
|
+
/** Refresh this many ms before expiry (default 60_000). */
|
|
4182
|
+
refreshSkewMs?: number;
|
|
4183
|
+
/** Injected for tests; defaults to global fetch. */
|
|
4184
|
+
fetchImpl?: typeof fetch;
|
|
4185
|
+
/** Injected for tests; defaults to a real setTimeout sleep. */
|
|
4186
|
+
sleepImpl?: (ms: number) => Promise<void>;
|
|
4187
|
+
/** Injected for tests; defaults to Date.now. */
|
|
4188
|
+
now?: () => number;
|
|
4189
|
+
}
|
|
4190
|
+
/** A browser app-platform client. */
|
|
4191
|
+
interface Graph8AppClient {
|
|
4192
|
+
readonly appId: string;
|
|
4193
|
+
readonly tenantOrgId: string;
|
|
4194
|
+
/** Token-bound requester: mints/refreshes the app token and attaches
|
|
4195
|
+
* `Authorization: Bearer <app-token>` to every Developer API call. */
|
|
4196
|
+
readonly request: AppRequest;
|
|
4197
|
+
/** Return the current app token, refreshing on/near expiry (`force` refreshes now). */
|
|
4198
|
+
getAppToken(force?: boolean): Promise<string>;
|
|
4199
|
+
}
|
|
4200
|
+
/**
|
|
4201
|
+
* Create a BROWSER app-platform client backed by PropelAuth->app-token exchange.
|
|
4202
|
+
* Refuses an org API key / write key — those must never reach a browser.
|
|
4203
|
+
*/
|
|
4204
|
+
declare function createGraph8AppClient(config: Graph8AppClientConfig): Graph8AppClient;
|
|
4205
|
+
/** Config for {@link createGraph8ServiceClient} (backend / server-to-server). */
|
|
4206
|
+
interface Graph8ServiceClientConfig {
|
|
4207
|
+
/** Service credential client id. */
|
|
4208
|
+
clientId: string;
|
|
4209
|
+
/** Service credential client secret (checked against the stored hash). */
|
|
4210
|
+
clientSecret: string;
|
|
4211
|
+
/** The single consented client org this backend acts for (sent as X-Target-Org-Id). */
|
|
4212
|
+
tenantOrgId: string;
|
|
4213
|
+
/** Scopes to embed in the minted service token. */
|
|
4214
|
+
scopes?: string[];
|
|
4215
|
+
/** Requested token TTL; the server clamps it into its service band. */
|
|
4216
|
+
ttlSeconds?: number;
|
|
4217
|
+
/** Backend API URL (default https://be.graph8.com). */
|
|
4218
|
+
apiUrl?: string;
|
|
4219
|
+
/** Refresh this many ms before expiry (default 60_000). */
|
|
4220
|
+
refreshSkewMs?: number;
|
|
4221
|
+
/** Injected for tests; defaults to global fetch. */
|
|
4222
|
+
fetchImpl?: typeof fetch;
|
|
4223
|
+
/** Injected for tests; defaults to a real setTimeout sleep. */
|
|
4224
|
+
sleepImpl?: (ms: number) => Promise<void>;
|
|
4225
|
+
/** Injected for tests; defaults to Date.now. */
|
|
4226
|
+
now?: () => number;
|
|
4227
|
+
}
|
|
4228
|
+
/** A backend service app-platform client. */
|
|
4229
|
+
interface Graph8ServiceClient {
|
|
4230
|
+
readonly tenantOrgId: string;
|
|
4231
|
+
/** Token-bound requester: mints/refreshes the service token, attaches it, and
|
|
4232
|
+
* sends `X-Target-Org-Id` for the one consented tenant on every call. */
|
|
4233
|
+
readonly request: AppRequest;
|
|
4234
|
+
/** Return the current service token, refreshing on/near expiry (`force` refreshes now). */
|
|
4235
|
+
getServiceToken(force?: boolean): Promise<string>;
|
|
4236
|
+
}
|
|
4237
|
+
/**
|
|
4238
|
+
* Create a BACKEND service client backed by client-credentials->service-token
|
|
4239
|
+
* exchange. Every request carries `X-Target-Org-Id: <tenantOrgId>` for the one
|
|
4240
|
+
* configured consented tenant.
|
|
4241
|
+
*/
|
|
4242
|
+
declare function createGraph8ServiceClient(config: Graph8ServiceClientConfig): Graph8ServiceClient;
|
|
4243
|
+
|
|
4244
|
+
export { type AddToSequenceConfig, type AgencyClient, type AgencyInfo, type AppRequest, type AppRequestOptions, type AppTokenResponse, type AudienceSync, type AudienceSyncCreateParams, type AudienceSyncError, type AudienceSyncMode, type AudienceSyncPlatform, type AudienceSyncRun, type AudienceSyncUpdateParams, type Booking, type BookingRequest, type CalendarConfig, type CallGradingResult, type Campaign, type CampaignCreateConfig, type CampaignLaunchExecution, type CampaignLaunchResult, type ChatConfig, type Company, type CompanyColumn, type CompanyColumnCreateParams, type CompanyContact, type CompanyEnrichment, type CompanyListParams, type CompanyUpdateParams, type ConstructEventOptions, type Contact, type ContactColumn, type ContactColumnCreateParams, type ContactCreateParams, type ContactDeal, type ContactList, type ContactListParams, type ContactUpdateParams, type CopilotConfig, type CreatedField, DEFAULT_APP_API, type Deal, type DealCreateParams, type DealListParams, type DealUpdateParams, type DialerAgentSummary, type DialerAgentsListParams, type DialerAgentsListResult, type DialerNumberInfo, type DialerNumbersListResult, type DialerReportFilters, type DialerReportMetric, type DialerSessionCreateParams, type DialerSessionCreateResult, type DialerSessionResumeResult, type DialerSessionStatus, type DialerSessionStatusUpdateResult, type DialerSessionSummary, type DialerSessionsListParams, type DialerSessionsListResult, type DialerStatsParams, type DialerStatsResult, type EmailVerification, type EnrichLookupResult, type EvidenceKey, type Field, type FieldCreateParams, type FieldDeleteParams, type G8Config, G8Error, type G8PrivacyConfig, type GlobalContextDocument, type Graph8AppClient, type Graph8AppClientConfig, type Graph8ServiceClient, type Graph8ServiceClientConfig, type ICP, type IdentifyProperties, type InboxAssignResult, type InboxAssignee, type InboxChannel, type InboxContact, type InboxDraft, type InboxListParams, type InboxMessage, type InboxSendParams, type InboxSendResult, type InboxTag, type InboxTagResult, type InboxThread, type IntelligenceData, type IntentCompany, type IntentContact, type IntentKeyword, type IntentPage, type IntentSignals, type IntentStats, type IntentVisitor, KNOWN_WEBHOOK_EVENTS, type ListContact, type MarketplaceHiring, type MarketplaceOffer, type MarketplaceProfile, type MeetingAnalysis, type MeetingAttendee, type MeetingDetail, type MeetingListParams, type MeetingSummary, type MeetingTranscriptLine, type MissedCallback, type MissedCallbacksResult, type NodeTypeSchema, type Note, type PaginatedResponse, type PaginationMeta$1 as PaginationMeta, type PersonEnrichment, type Persona, type Pipeline, type PipelineStage, type PipelineSuggestion, type QuotableProduct, type QuoteCreateParams, type QuoteDetail, type QuoteLineItem, type QuoteListParams, type QuoteSendParams, type QuoteSettings, type QuoteStatus, type QuoteSummary, type QuoteUpdateParams, type RequestOptions, type ResearchReport, type SearchCompanyItem, type SearchCondition, type SearchContactItem, type SearchFilter, type SearchOperator, type SearchParams, type SearchResults, type SearchSaveParams, type SearchSaveResult, type Sequence, type SequenceActionResult, type SequenceAnalytics, type SequenceChannelConfig, type SequenceContactItem, type SequenceContactsParams, type SequenceCreateParams, type SequenceCreateResult, type SequenceDetail, type SequenceKind, type SequenceListItem, type SequenceListParams, type SequencePreview, type SequencePreviewChannel, type SequencePreviewStep, type SequenceStepConfig, type SequenceStepInputType, type SequenceStepType, type SequenceStepUpdateParams, type SequenceUpdateParams, type SetFieldValueParams, type Skill, type SkillCreateAPIParams, type SkillCreateLLMParams, type SkillInputField, type SkillListParams, type SkillTemplate, type SkillType, type SkillUpdateAPIParams, type SkillUpdateLLMParams, type Snippet, type StageCreateParams, type StagePipeline, type StagePipelineCreateParams, type StagePipelineStage, type StagePipelineUpdateParams, type StageUpdateParams, type Task, type TaskCreateParams, type TaskListParams, type TaskUpdateParams, type TimeSlot, type TokenManager, type TrackProperties, type VisitorCompany, type VisitorScore, type VoicePagination, type WebhookEvent, type WebhookEventPayload, WebhookSignatureError, type Workflow, type WorkflowConfig, type WorkflowConnection, type WorkflowCreateParams, type WorkflowExecution, type WorkflowListParams, type WorkflowNode, type WorkflowUpdateParams, backoffDelayMs, constructEvent, createAppRequester, createGraph8AppClient, createGraph8ServiceClient, createTokenManager, exchangeBrowserToken, exchangeServiceToken, g8, isRetryableStatus, paginate, parseRetryAfter, request };
|