geodedo 0.1.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 +414 -0
- package/dist/index.cjs +1077 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1157 -0
- package/dist/index.d.ts +1157 -0
- package/dist/index.js +1021 -0
- package/dist/index.js.map +1 -0
- package/package.json +48 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options that can be passed per-request to override client defaults.
|
|
3
|
+
*/
|
|
4
|
+
interface RequestOptions {
|
|
5
|
+
/** Override the API key for this request. */
|
|
6
|
+
apiKey?: string;
|
|
7
|
+
/** Override the user ID for this request. */
|
|
8
|
+
userId?: string;
|
|
9
|
+
/** Override the request timeout in milliseconds. */
|
|
10
|
+
timeout?: number;
|
|
11
|
+
/** Additional headers to merge into the request. */
|
|
12
|
+
headers?: Record<string, string>;
|
|
13
|
+
/** An AbortSignal to cancel the request. */
|
|
14
|
+
signal?: AbortSignal;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Options for constructing a GeoDedo client.
|
|
18
|
+
*/
|
|
19
|
+
interface ClientOptions {
|
|
20
|
+
/** API key for authentication (e.g. "gd_live_xxx"). */
|
|
21
|
+
apiKey: string;
|
|
22
|
+
/** Default user ID sent via X-User-Id header for user-scoped operations. */
|
|
23
|
+
userId?: string;
|
|
24
|
+
/** Base URL for the API. Defaults to "https://geodedo-api.vercel.app". */
|
|
25
|
+
baseURL?: string;
|
|
26
|
+
/** Maximum number of retries for failed requests. Defaults to 2. */
|
|
27
|
+
maxRetries?: number;
|
|
28
|
+
/** Default request timeout in milliseconds. Defaults to 60000. */
|
|
29
|
+
timeout?: number;
|
|
30
|
+
/**
|
|
31
|
+
* By default, the SDK will throw if it detects it is running in a browser
|
|
32
|
+
* environment to prevent leaking API keys. Set this to `true` to suppress
|
|
33
|
+
* that check (use at your own risk).
|
|
34
|
+
*/
|
|
35
|
+
dangerouslyAllowBrowser?: boolean;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Pagination parameters for list endpoints.
|
|
39
|
+
* The API uses page-based pagination (NOT limit/offset).
|
|
40
|
+
*/
|
|
41
|
+
interface PaginationParams {
|
|
42
|
+
/** Page number (1-indexed). Defaults to 1. */
|
|
43
|
+
page?: number;
|
|
44
|
+
/** Number of items per page. Defaults vary by resource. */
|
|
45
|
+
perPage?: number;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Generic paginated response from the API.
|
|
49
|
+
*
|
|
50
|
+
* The server wraps the data array under a resource-specific key
|
|
51
|
+
* (e.g. "contacts", "sequences", "drafts"), so callers use
|
|
52
|
+
* `PageResponse<Contact>` and access the `data` field which is
|
|
53
|
+
* normalized from whatever wrapper key the server used.
|
|
54
|
+
*/
|
|
55
|
+
interface PageResponse<T> {
|
|
56
|
+
/** The items on this page (normalized from the server's resource key). */
|
|
57
|
+
data: T[];
|
|
58
|
+
/** Total number of items across all pages. */
|
|
59
|
+
total: number;
|
|
60
|
+
/** Current page number. */
|
|
61
|
+
page: number;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** HTTP methods supported by the client. */
|
|
65
|
+
type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
66
|
+
interface APIClientOptions {
|
|
67
|
+
apiKey: string;
|
|
68
|
+
userId?: string;
|
|
69
|
+
baseURL?: string;
|
|
70
|
+
maxRetries?: number;
|
|
71
|
+
timeout?: number;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Low-level HTTP client that handles auth, retries, timeouts, and error mapping.
|
|
75
|
+
* Uses the built-in `fetch` API (available in Node 18+).
|
|
76
|
+
*/
|
|
77
|
+
declare class APIClient {
|
|
78
|
+
readonly apiKey: string;
|
|
79
|
+
readonly userId: string | undefined;
|
|
80
|
+
readonly baseURL: string;
|
|
81
|
+
readonly maxRetries: number;
|
|
82
|
+
readonly timeout: number;
|
|
83
|
+
constructor(options: APIClientOptions);
|
|
84
|
+
/**
|
|
85
|
+
* Core request method. All convenience methods delegate here.
|
|
86
|
+
*/
|
|
87
|
+
request<T>(method: HttpMethod, path: string, body?: unknown, options?: RequestOptions): Promise<T>;
|
|
88
|
+
/** Calculate retry delay with exponential backoff and jitter. */
|
|
89
|
+
private retryDelay;
|
|
90
|
+
private sleep;
|
|
91
|
+
get<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
92
|
+
post<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
|
|
93
|
+
put<T>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
|
|
94
|
+
delete<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Options needed to fetch the next page of a paginated result.
|
|
99
|
+
*/
|
|
100
|
+
interface PageRequestOptions {
|
|
101
|
+
/** The API client to use for fetching. */
|
|
102
|
+
client: APIClient;
|
|
103
|
+
/** HTTP method (GET or POST). */
|
|
104
|
+
method: 'GET' | 'POST';
|
|
105
|
+
/** API path. */
|
|
106
|
+
path: string;
|
|
107
|
+
/** Request body (for POST-based pagination like contact search). */
|
|
108
|
+
body?: Record<string, unknown>;
|
|
109
|
+
/** Query parameters appended to the URL. */
|
|
110
|
+
query?: Record<string, string | number>;
|
|
111
|
+
/** The key in the response that contains the array of items. */
|
|
112
|
+
responseKey: string;
|
|
113
|
+
/** Per-request options (auth overrides, etc.). */
|
|
114
|
+
options?: RequestOptions;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* A single page of results from a paginated API endpoint.
|
|
118
|
+
*
|
|
119
|
+
* Supports:
|
|
120
|
+
* - `data` / `total` / `page` accessors
|
|
121
|
+
* - `hasNextPage()` / `getNextPage()` for manual iteration
|
|
122
|
+
* - `Symbol.asyncIterator` for `for await...of` across all pages
|
|
123
|
+
*/
|
|
124
|
+
declare class Page<T> {
|
|
125
|
+
/** The items on this page. */
|
|
126
|
+
readonly data: T[];
|
|
127
|
+
/** Total number of items across all pages. */
|
|
128
|
+
readonly total: number;
|
|
129
|
+
/** Current page number (1-indexed). */
|
|
130
|
+
readonly page: number;
|
|
131
|
+
/** Number of items per page (inferred from the current page size). */
|
|
132
|
+
readonly perPage: number;
|
|
133
|
+
private readonly _requestOptions;
|
|
134
|
+
constructor(data: T[], total: number, page: number, perPage: number, requestOptions: PageRequestOptions);
|
|
135
|
+
/**
|
|
136
|
+
* Whether there is a next page available.
|
|
137
|
+
*/
|
|
138
|
+
hasNextPage(): boolean;
|
|
139
|
+
/**
|
|
140
|
+
* Fetch the next page. Throws if there is no next page.
|
|
141
|
+
*/
|
|
142
|
+
getNextPage(): Promise<Page<T>>;
|
|
143
|
+
/**
|
|
144
|
+
* Async iterator that yields every item across all pages,
|
|
145
|
+
* automatically fetching subsequent pages as needed.
|
|
146
|
+
*/
|
|
147
|
+
[Symbol.asyncIterator](): AsyncIterableIterator<T>;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Parameters for searching contacts (Apollo-style enrichment).
|
|
152
|
+
*/
|
|
153
|
+
interface ContactSearchParams extends PaginationParams {
|
|
154
|
+
titles?: string[];
|
|
155
|
+
seniorities?: string[];
|
|
156
|
+
locations?: string[];
|
|
157
|
+
employeeRanges?: string[];
|
|
158
|
+
departments?: string[];
|
|
159
|
+
source?: string;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Parameters for enriching a single contact.
|
|
163
|
+
*/
|
|
164
|
+
interface ContactEnrichParams {
|
|
165
|
+
email?: string;
|
|
166
|
+
linkedinUrl?: string;
|
|
167
|
+
firstName?: string;
|
|
168
|
+
lastName?: string;
|
|
169
|
+
company?: string;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* A single contact entry within an import batch.
|
|
173
|
+
*/
|
|
174
|
+
interface ContactImportEntry {
|
|
175
|
+
firstName?: string;
|
|
176
|
+
lastName?: string;
|
|
177
|
+
email?: string;
|
|
178
|
+
phone?: string;
|
|
179
|
+
title?: string;
|
|
180
|
+
company?: string;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Parameters for importing contacts from a CSV-like batch.
|
|
184
|
+
*/
|
|
185
|
+
interface ContactImportParams {
|
|
186
|
+
name?: string;
|
|
187
|
+
contacts: ContactImportEntry[];
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* An enriched contact returned from search or enrich.
|
|
191
|
+
*/
|
|
192
|
+
interface Contact {
|
|
193
|
+
firstName: string;
|
|
194
|
+
lastName: string;
|
|
195
|
+
fullName: string;
|
|
196
|
+
email: string;
|
|
197
|
+
phone: string;
|
|
198
|
+
title: string;
|
|
199
|
+
company: string;
|
|
200
|
+
linkedinUrl: string;
|
|
201
|
+
location: string;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* A stored contact in the user's account.
|
|
205
|
+
*/
|
|
206
|
+
interface StoredContact {
|
|
207
|
+
id: string;
|
|
208
|
+
tenant_user_id: string;
|
|
209
|
+
email: string;
|
|
210
|
+
provider: string;
|
|
211
|
+
status: string;
|
|
212
|
+
created_at: string;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Result of a contact import operation.
|
|
216
|
+
*/
|
|
217
|
+
interface ImportResult {
|
|
218
|
+
id: string;
|
|
219
|
+
tenant_user_id: string;
|
|
220
|
+
name: string;
|
|
221
|
+
contacts: ContactImportEntry[];
|
|
222
|
+
created_at: string;
|
|
223
|
+
updated_at: string;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* A CSV list reference.
|
|
227
|
+
*/
|
|
228
|
+
interface CsvList {
|
|
229
|
+
id: string;
|
|
230
|
+
name: string;
|
|
231
|
+
created_at: string;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Resource for contact search, enrichment, import, and listing.
|
|
236
|
+
*/
|
|
237
|
+
declare class Contacts {
|
|
238
|
+
private readonly client;
|
|
239
|
+
constructor(client: APIClient);
|
|
240
|
+
/**
|
|
241
|
+
* Search for contacts matching the given ICP criteria.
|
|
242
|
+
* Returns a paginated list of enriched contacts.
|
|
243
|
+
*/
|
|
244
|
+
search(params: ContactSearchParams, options?: RequestOptions): Promise<Page<Contact>>;
|
|
245
|
+
/**
|
|
246
|
+
* Enrich a single contact by email, LinkedIn URL, or name+company.
|
|
247
|
+
*/
|
|
248
|
+
enrich(params: ContactEnrichParams, options?: RequestOptions): Promise<Contact>;
|
|
249
|
+
/**
|
|
250
|
+
* Import a batch of contacts (CSV-like).
|
|
251
|
+
*/
|
|
252
|
+
importCsv(params: ContactImportParams, options?: RequestOptions): Promise<ImportResult>;
|
|
253
|
+
/**
|
|
254
|
+
* List stored contacts for the current user. Paginated.
|
|
255
|
+
*/
|
|
256
|
+
list(params?: {
|
|
257
|
+
page?: number;
|
|
258
|
+
perPage?: number;
|
|
259
|
+
}, options?: RequestOptions): Promise<Page<StoredContact>>;
|
|
260
|
+
/**
|
|
261
|
+
* List all CSV lists (imports) for the current user.
|
|
262
|
+
*/
|
|
263
|
+
csvLists(options?: RequestOptions): Promise<CsvList[]>;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Parameters for creating a new outreach sequence.
|
|
268
|
+
*/
|
|
269
|
+
interface SequenceCreateParams {
|
|
270
|
+
name?: string;
|
|
271
|
+
icp: string;
|
|
272
|
+
channelType?: string;
|
|
273
|
+
channel?: string;
|
|
274
|
+
contactsPerDay?: number;
|
|
275
|
+
startHour?: number;
|
|
276
|
+
endHour?: number;
|
|
277
|
+
activeDays?: string[];
|
|
278
|
+
timezone?: string;
|
|
279
|
+
conversationId?: string;
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* A sequence record.
|
|
283
|
+
*/
|
|
284
|
+
interface Sequence {
|
|
285
|
+
id: string;
|
|
286
|
+
tenant_user_id: string;
|
|
287
|
+
conversation_id: string;
|
|
288
|
+
name: string;
|
|
289
|
+
icp: string;
|
|
290
|
+
channel_type: string;
|
|
291
|
+
contacts_per_day: number;
|
|
292
|
+
start_hour: number;
|
|
293
|
+
end_hour: number;
|
|
294
|
+
active_days: string[];
|
|
295
|
+
timezone: string;
|
|
296
|
+
status: string;
|
|
297
|
+
created_at: string;
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Stats attached to a sequence.
|
|
301
|
+
*/
|
|
302
|
+
interface SequenceStats {
|
|
303
|
+
sent: number;
|
|
304
|
+
replied: number;
|
|
305
|
+
pending?: number;
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* A sequence with performance stats.
|
|
309
|
+
*/
|
|
310
|
+
interface SequenceWithStats extends Sequence {
|
|
311
|
+
stats: SequenceStats;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Resource for managing outreach sequences.
|
|
316
|
+
*/
|
|
317
|
+
declare class Sequences {
|
|
318
|
+
private readonly client;
|
|
319
|
+
constructor(client: APIClient);
|
|
320
|
+
/**
|
|
321
|
+
* Create a new outreach sequence.
|
|
322
|
+
*/
|
|
323
|
+
create(params: SequenceCreateParams, options?: RequestOptions): Promise<Sequence>;
|
|
324
|
+
/**
|
|
325
|
+
* List all sequences for the current user. Paginated.
|
|
326
|
+
*/
|
|
327
|
+
list(params?: {
|
|
328
|
+
page?: number;
|
|
329
|
+
perPage?: number;
|
|
330
|
+
}, options?: RequestOptions): Promise<Page<SequenceWithStats>>;
|
|
331
|
+
/**
|
|
332
|
+
* Get a single sequence by ID.
|
|
333
|
+
*/
|
|
334
|
+
get(sequenceId: string, options?: RequestOptions): Promise<SequenceWithStats>;
|
|
335
|
+
/**
|
|
336
|
+
* Pause a running sequence.
|
|
337
|
+
*/
|
|
338
|
+
pause(sequenceId: string, options?: RequestOptions): Promise<Sequence>;
|
|
339
|
+
/**
|
|
340
|
+
* Resume a paused sequence.
|
|
341
|
+
*/
|
|
342
|
+
resume(sequenceId: string, options?: RequestOptions): Promise<Sequence>;
|
|
343
|
+
/**
|
|
344
|
+
* Stop (terminate) a sequence.
|
|
345
|
+
*/
|
|
346
|
+
stop(sequenceId: string, options?: RequestOptions): Promise<Sequence>;
|
|
347
|
+
/**
|
|
348
|
+
* Get the current status of a sequence.
|
|
349
|
+
*/
|
|
350
|
+
status(sequenceId: string, options?: RequestOptions): Promise<SequenceWithStats>;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* A single contact entry for draft generation.
|
|
355
|
+
*/
|
|
356
|
+
interface DraftContact {
|
|
357
|
+
name?: string;
|
|
358
|
+
fullName?: string;
|
|
359
|
+
title?: string;
|
|
360
|
+
company?: string;
|
|
361
|
+
email?: string;
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* Parameters for generating outreach drafts.
|
|
365
|
+
*/
|
|
366
|
+
interface DraftGenerateParams {
|
|
367
|
+
contacts: DraftContact[];
|
|
368
|
+
channel?: string;
|
|
369
|
+
context?: string;
|
|
370
|
+
conversationId?: string;
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* Parameters for listing drafts.
|
|
374
|
+
*/
|
|
375
|
+
interface DraftListParams {
|
|
376
|
+
conversationId?: string;
|
|
377
|
+
batchId?: string;
|
|
378
|
+
status?: string;
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* Parameters for updating a draft.
|
|
382
|
+
*/
|
|
383
|
+
interface DraftUpdateParams {
|
|
384
|
+
subject?: string;
|
|
385
|
+
body?: string;
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* Parameters for approving drafts.
|
|
389
|
+
*/
|
|
390
|
+
interface DraftApproveParams {
|
|
391
|
+
draftIds: string[];
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Parameters for sending drafts.
|
|
395
|
+
*/
|
|
396
|
+
interface DraftSendParams {
|
|
397
|
+
draftIds: string[];
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* A draft message record.
|
|
401
|
+
*/
|
|
402
|
+
interface Draft {
|
|
403
|
+
id: string;
|
|
404
|
+
tenant_user_id: string;
|
|
405
|
+
conversation_id: string;
|
|
406
|
+
batch_id: string;
|
|
407
|
+
channel: string;
|
|
408
|
+
to_email: string;
|
|
409
|
+
to_name: string;
|
|
410
|
+
to_linkedin_url: string;
|
|
411
|
+
to_phone: string;
|
|
412
|
+
subject: string;
|
|
413
|
+
body: string;
|
|
414
|
+
status: string;
|
|
415
|
+
created_at: string;
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* Result of a batch draft generation.
|
|
419
|
+
*/
|
|
420
|
+
interface DraftBatchResult {
|
|
421
|
+
batchId: string;
|
|
422
|
+
drafts: Draft[];
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* Result of approving drafts.
|
|
426
|
+
*/
|
|
427
|
+
interface DraftApproveResult {
|
|
428
|
+
approved: number;
|
|
429
|
+
drafts: Draft[];
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* An individual send error.
|
|
433
|
+
*/
|
|
434
|
+
interface DraftSendError {
|
|
435
|
+
draftId: string;
|
|
436
|
+
error: string;
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* Result of sending drafts.
|
|
440
|
+
*/
|
|
441
|
+
interface DraftSendResult {
|
|
442
|
+
sent: number;
|
|
443
|
+
failed: number;
|
|
444
|
+
errors?: DraftSendError[];
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
/**
|
|
448
|
+
* Resource for generating, reviewing, approving, and sending outreach drafts.
|
|
449
|
+
*/
|
|
450
|
+
declare class Drafts {
|
|
451
|
+
private readonly client;
|
|
452
|
+
constructor(client: APIClient);
|
|
453
|
+
/**
|
|
454
|
+
* Generate outreach drafts for a list of contacts.
|
|
455
|
+
*/
|
|
456
|
+
generate(params: DraftGenerateParams, options?: RequestOptions): Promise<DraftBatchResult>;
|
|
457
|
+
/**
|
|
458
|
+
* List drafts, optionally filtered by conversation, batch, or status. Paginated.
|
|
459
|
+
*/
|
|
460
|
+
list(params?: DraftListParams & {
|
|
461
|
+
page?: number;
|
|
462
|
+
perPage?: number;
|
|
463
|
+
}, options?: RequestOptions): Promise<Page<Draft>>;
|
|
464
|
+
/**
|
|
465
|
+
* Update a specific draft's subject and/or body.
|
|
466
|
+
*/
|
|
467
|
+
update(draftId: string, params: DraftUpdateParams, options?: RequestOptions): Promise<Draft>;
|
|
468
|
+
/**
|
|
469
|
+
* Approve drafts by their IDs.
|
|
470
|
+
*/
|
|
471
|
+
approve(params: DraftApproveParams, options?: RequestOptions): Promise<DraftApproveResult>;
|
|
472
|
+
/**
|
|
473
|
+
* Send approved drafts.
|
|
474
|
+
*/
|
|
475
|
+
send(params: DraftSendParams, options?: RequestOptions): Promise<DraftSendResult>;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* Parameters for sending an email.
|
|
480
|
+
*/
|
|
481
|
+
interface EmailSendParams {
|
|
482
|
+
to: string;
|
|
483
|
+
subject: string;
|
|
484
|
+
body: string;
|
|
485
|
+
provider?: 'gmail' | 'agentmail';
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* Parameters for sending a LinkedIn message.
|
|
489
|
+
*/
|
|
490
|
+
interface LinkedInSendParams {
|
|
491
|
+
chatId?: string;
|
|
492
|
+
text: string;
|
|
493
|
+
profileUrl?: string;
|
|
494
|
+
connectionNote?: string;
|
|
495
|
+
}
|
|
496
|
+
/**
|
|
497
|
+
* Parameters for sending an Instagram message.
|
|
498
|
+
*/
|
|
499
|
+
interface InstagramSendParams {
|
|
500
|
+
chatId?: string;
|
|
501
|
+
attendeeId?: string;
|
|
502
|
+
text: string;
|
|
503
|
+
}
|
|
504
|
+
/**
|
|
505
|
+
* Parameters for sending an SMS.
|
|
506
|
+
*/
|
|
507
|
+
interface SmsSendParams {
|
|
508
|
+
to: string;
|
|
509
|
+
body: string;
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* Result of sending an email.
|
|
513
|
+
*/
|
|
514
|
+
interface EmailResult {
|
|
515
|
+
sent: boolean;
|
|
516
|
+
id?: string;
|
|
517
|
+
from?: string;
|
|
518
|
+
to?: string;
|
|
519
|
+
status?: string;
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* Result of sending a LinkedIn message.
|
|
523
|
+
*/
|
|
524
|
+
interface LinkedInResult {
|
|
525
|
+
sent: boolean;
|
|
526
|
+
[key: string]: unknown;
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* Result of sending an Instagram message.
|
|
530
|
+
*/
|
|
531
|
+
interface InstagramResult {
|
|
532
|
+
sent: boolean;
|
|
533
|
+
[key: string]: unknown;
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* Result of sending an SMS.
|
|
537
|
+
*/
|
|
538
|
+
interface SmsResult {
|
|
539
|
+
sent: boolean;
|
|
540
|
+
sid?: string;
|
|
541
|
+
status?: string;
|
|
542
|
+
to?: string;
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* Supported inbox channel types.
|
|
546
|
+
*/
|
|
547
|
+
type InboxChannel = 'gmail' | 'agentmail' | 'linkedin' | 'instagram' | 'sms';
|
|
548
|
+
|
|
549
|
+
/**
|
|
550
|
+
* Resource for sending messages across channels and accessing the unified inbox.
|
|
551
|
+
*/
|
|
552
|
+
declare class Messages {
|
|
553
|
+
private readonly client;
|
|
554
|
+
constructor(client: APIClient);
|
|
555
|
+
/**
|
|
556
|
+
* Send an email via Gmail or AgentMail.
|
|
557
|
+
*/
|
|
558
|
+
sendEmail(params: EmailSendParams, options?: RequestOptions): Promise<EmailResult>;
|
|
559
|
+
/**
|
|
560
|
+
* Send a LinkedIn message or connection request.
|
|
561
|
+
*/
|
|
562
|
+
sendLinkedIn(params: LinkedInSendParams, options?: RequestOptions): Promise<LinkedInResult>;
|
|
563
|
+
/**
|
|
564
|
+
* Send an Instagram DM.
|
|
565
|
+
*/
|
|
566
|
+
sendInstagram(params: InstagramSendParams, options?: RequestOptions): Promise<InstagramResult>;
|
|
567
|
+
/**
|
|
568
|
+
* Send an SMS message.
|
|
569
|
+
*/
|
|
570
|
+
sendSms(params: SmsSendParams, options?: RequestOptions): Promise<SmsResult>;
|
|
571
|
+
/**
|
|
572
|
+
* Get the unified inbox for a specific channel.
|
|
573
|
+
*/
|
|
574
|
+
inbox(channel: InboxChannel, options?: RequestOptions): Promise<Record<string, unknown>>;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
/**
|
|
578
|
+
* Parameters for creating a chat message / conversation.
|
|
579
|
+
*/
|
|
580
|
+
interface ChatCreateParams {
|
|
581
|
+
message: string;
|
|
582
|
+
conversationId?: string;
|
|
583
|
+
}
|
|
584
|
+
/**
|
|
585
|
+
* Response from the chat endpoint.
|
|
586
|
+
*/
|
|
587
|
+
interface ChatResponse {
|
|
588
|
+
conversationId: string;
|
|
589
|
+
response: string;
|
|
590
|
+
iterations?: number;
|
|
591
|
+
}
|
|
592
|
+
/**
|
|
593
|
+
* A conversation summary.
|
|
594
|
+
*/
|
|
595
|
+
interface Conversation {
|
|
596
|
+
id: string;
|
|
597
|
+
title: string;
|
|
598
|
+
created_at: string;
|
|
599
|
+
}
|
|
600
|
+
/**
|
|
601
|
+
* A single message within a conversation.
|
|
602
|
+
*/
|
|
603
|
+
interface ConversationMessage {
|
|
604
|
+
id: string;
|
|
605
|
+
role: 'user' | 'assistant';
|
|
606
|
+
content: string;
|
|
607
|
+
created_at: string;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
/**
|
|
611
|
+
* Sub-resource for conversation management.
|
|
612
|
+
*/
|
|
613
|
+
declare class ConversationsResource {
|
|
614
|
+
private readonly client;
|
|
615
|
+
constructor(client: APIClient);
|
|
616
|
+
/**
|
|
617
|
+
* List all conversations.
|
|
618
|
+
*/
|
|
619
|
+
list(options?: RequestOptions): Promise<Conversation[]>;
|
|
620
|
+
/**
|
|
621
|
+
* Get messages for a specific conversation.
|
|
622
|
+
*/
|
|
623
|
+
get(conversationId: string, options?: RequestOptions): Promise<ConversationMessage[]>;
|
|
624
|
+
/**
|
|
625
|
+
* Delete a conversation.
|
|
626
|
+
*/
|
|
627
|
+
delete(conversationId: string, options?: RequestOptions): Promise<void>;
|
|
628
|
+
}
|
|
629
|
+
/**
|
|
630
|
+
* Resource for the AI chat assistant and conversation management.
|
|
631
|
+
*/
|
|
632
|
+
declare class Chat {
|
|
633
|
+
private readonly client;
|
|
634
|
+
/** Sub-resource for managing conversations. */
|
|
635
|
+
readonly conversations: ConversationsResource;
|
|
636
|
+
constructor(client: APIClient);
|
|
637
|
+
/**
|
|
638
|
+
* Send a message to the AI assistant.
|
|
639
|
+
*/
|
|
640
|
+
create(params: ChatCreateParams, options?: RequestOptions): Promise<ChatResponse>;
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
/**
|
|
644
|
+
* Supported channel names.
|
|
645
|
+
*/
|
|
646
|
+
type ChannelName = 'gmail' | 'linkedin' | 'instagram' | 'agentmail' | 'sms';
|
|
647
|
+
/**
|
|
648
|
+
* Status of each connected channel.
|
|
649
|
+
*/
|
|
650
|
+
interface ChannelStatus {
|
|
651
|
+
gmail: {
|
|
652
|
+
connected: boolean;
|
|
653
|
+
email?: string;
|
|
654
|
+
};
|
|
655
|
+
linkedin: {
|
|
656
|
+
connected: boolean;
|
|
657
|
+
status?: string;
|
|
658
|
+
email?: string;
|
|
659
|
+
};
|
|
660
|
+
instagram: {
|
|
661
|
+
connected: boolean;
|
|
662
|
+
status?: string;
|
|
663
|
+
username?: string;
|
|
664
|
+
};
|
|
665
|
+
agentmail: {
|
|
666
|
+
connected: boolean;
|
|
667
|
+
email?: string;
|
|
668
|
+
};
|
|
669
|
+
sms: {
|
|
670
|
+
connected: boolean;
|
|
671
|
+
phoneNumber?: string;
|
|
672
|
+
};
|
|
673
|
+
}
|
|
674
|
+
/**
|
|
675
|
+
* Result of initiating Gmail OAuth.
|
|
676
|
+
*/
|
|
677
|
+
interface GmailConnectResult {
|
|
678
|
+
authUrl: string;
|
|
679
|
+
}
|
|
680
|
+
/**
|
|
681
|
+
* Parameters for connecting LinkedIn.
|
|
682
|
+
*/
|
|
683
|
+
interface LinkedInConnectParams {
|
|
684
|
+
email: string;
|
|
685
|
+
password: string;
|
|
686
|
+
}
|
|
687
|
+
/**
|
|
688
|
+
* Parameters for connecting Instagram.
|
|
689
|
+
*/
|
|
690
|
+
interface InstagramConnectParams {
|
|
691
|
+
username: string;
|
|
692
|
+
password: string;
|
|
693
|
+
}
|
|
694
|
+
/**
|
|
695
|
+
* Parameters for resolving a 2FA checkpoint.
|
|
696
|
+
*/
|
|
697
|
+
interface CheckpointParams {
|
|
698
|
+
code: string;
|
|
699
|
+
}
|
|
700
|
+
/**
|
|
701
|
+
* Generic connection result for LinkedIn/Instagram.
|
|
702
|
+
*/
|
|
703
|
+
interface ConnectionResult {
|
|
704
|
+
account?: {
|
|
705
|
+
id: string;
|
|
706
|
+
status: string;
|
|
707
|
+
};
|
|
708
|
+
[key: string]: unknown;
|
|
709
|
+
}
|
|
710
|
+
/**
|
|
711
|
+
* Parameters for creating an AgentMail address.
|
|
712
|
+
*/
|
|
713
|
+
interface AgentMailCreateParams {
|
|
714
|
+
username: string;
|
|
715
|
+
}
|
|
716
|
+
/**
|
|
717
|
+
* Result of creating an AgentMail address.
|
|
718
|
+
*/
|
|
719
|
+
interface AgentMailCreateResult {
|
|
720
|
+
email: string;
|
|
721
|
+
inboxId: string;
|
|
722
|
+
}
|
|
723
|
+
/**
|
|
724
|
+
* Parameters for verifying (initiating) SMS.
|
|
725
|
+
*/
|
|
726
|
+
interface SmsVerifyParams {
|
|
727
|
+
phoneNumber: string;
|
|
728
|
+
}
|
|
729
|
+
/**
|
|
730
|
+
* Parameters for confirming SMS with a code.
|
|
731
|
+
*/
|
|
732
|
+
interface SmsConfirmParams {
|
|
733
|
+
phoneNumber: string;
|
|
734
|
+
code: string;
|
|
735
|
+
}
|
|
736
|
+
/**
|
|
737
|
+
* Result of SMS verification steps.
|
|
738
|
+
*/
|
|
739
|
+
interface SmsVerifyResult {
|
|
740
|
+
status: string;
|
|
741
|
+
to?: string;
|
|
742
|
+
valid?: boolean;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
/**
|
|
746
|
+
* Sub-resource for Gmail channel operations.
|
|
747
|
+
*/
|
|
748
|
+
declare class GmailChannel {
|
|
749
|
+
private readonly client;
|
|
750
|
+
constructor(client: APIClient);
|
|
751
|
+
/**
|
|
752
|
+
* Initiate Gmail OAuth flow. Returns an authUrl for the user to visit.
|
|
753
|
+
*/
|
|
754
|
+
connect(options?: RequestOptions): Promise<GmailConnectResult>;
|
|
755
|
+
}
|
|
756
|
+
/**
|
|
757
|
+
* Sub-resource for LinkedIn channel operations.
|
|
758
|
+
*/
|
|
759
|
+
declare class LinkedInChannel {
|
|
760
|
+
private readonly client;
|
|
761
|
+
constructor(client: APIClient);
|
|
762
|
+
/**
|
|
763
|
+
* Connect a LinkedIn account with credentials.
|
|
764
|
+
*/
|
|
765
|
+
connect(params: LinkedInConnectParams, options?: RequestOptions): Promise<ConnectionResult>;
|
|
766
|
+
/**
|
|
767
|
+
* Resolve a LinkedIn 2FA checkpoint.
|
|
768
|
+
*/
|
|
769
|
+
checkpoint(params: CheckpointParams, options?: RequestOptions): Promise<ConnectionResult>;
|
|
770
|
+
}
|
|
771
|
+
/**
|
|
772
|
+
* Sub-resource for Instagram channel operations.
|
|
773
|
+
*/
|
|
774
|
+
declare class InstagramChannel {
|
|
775
|
+
private readonly client;
|
|
776
|
+
constructor(client: APIClient);
|
|
777
|
+
/**
|
|
778
|
+
* Connect an Instagram account with credentials.
|
|
779
|
+
*/
|
|
780
|
+
connect(params: InstagramConnectParams, options?: RequestOptions): Promise<ConnectionResult>;
|
|
781
|
+
/**
|
|
782
|
+
* Resolve an Instagram 2FA checkpoint.
|
|
783
|
+
*/
|
|
784
|
+
checkpoint(params: CheckpointParams, options?: RequestOptions): Promise<ConnectionResult>;
|
|
785
|
+
}
|
|
786
|
+
/**
|
|
787
|
+
* Sub-resource for AgentMail channel operations.
|
|
788
|
+
*/
|
|
789
|
+
declare class AgentMailChannel {
|
|
790
|
+
private readonly client;
|
|
791
|
+
constructor(client: APIClient);
|
|
792
|
+
/**
|
|
793
|
+
* Create a new AgentMail address.
|
|
794
|
+
*/
|
|
795
|
+
create(params: AgentMailCreateParams, options?: RequestOptions): Promise<AgentMailCreateResult>;
|
|
796
|
+
}
|
|
797
|
+
/**
|
|
798
|
+
* Sub-resource for SMS channel operations.
|
|
799
|
+
*/
|
|
800
|
+
declare class SmsChannel {
|
|
801
|
+
private readonly client;
|
|
802
|
+
constructor(client: APIClient);
|
|
803
|
+
/**
|
|
804
|
+
* Initiate SMS verification for a phone number.
|
|
805
|
+
*/
|
|
806
|
+
verify(params: SmsVerifyParams, options?: RequestOptions): Promise<SmsVerifyResult>;
|
|
807
|
+
/**
|
|
808
|
+
* Confirm SMS verification with the code.
|
|
809
|
+
*/
|
|
810
|
+
confirm(params: SmsConfirmParams, options?: RequestOptions): Promise<SmsVerifyResult>;
|
|
811
|
+
}
|
|
812
|
+
/**
|
|
813
|
+
* Resource for managing channel connections (Gmail, LinkedIn, Instagram, AgentMail, SMS).
|
|
814
|
+
*/
|
|
815
|
+
declare class Channels {
|
|
816
|
+
private readonly client;
|
|
817
|
+
/** Gmail channel operations. */
|
|
818
|
+
readonly gmail: GmailChannel;
|
|
819
|
+
/** LinkedIn channel operations. */
|
|
820
|
+
readonly linkedin: LinkedInChannel;
|
|
821
|
+
/** Instagram channel operations. */
|
|
822
|
+
readonly instagram: InstagramChannel;
|
|
823
|
+
/** AgentMail channel operations. */
|
|
824
|
+
readonly agentmail: AgentMailChannel;
|
|
825
|
+
/** SMS channel operations. */
|
|
826
|
+
readonly sms: SmsChannel;
|
|
827
|
+
constructor(client: APIClient);
|
|
828
|
+
/**
|
|
829
|
+
* Get the connection status of all channels.
|
|
830
|
+
*/
|
|
831
|
+
status(options?: RequestOptions): Promise<ChannelStatus>;
|
|
832
|
+
/**
|
|
833
|
+
* Disconnect a specific channel.
|
|
834
|
+
*/
|
|
835
|
+
disconnect(channel: ChannelName, options?: RequestOptions): Promise<void>;
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
/**
|
|
839
|
+
* Parameters for uploading a document.
|
|
840
|
+
*/
|
|
841
|
+
interface DocumentUploadParams {
|
|
842
|
+
filename: string;
|
|
843
|
+
content: string;
|
|
844
|
+
}
|
|
845
|
+
/**
|
|
846
|
+
* A document record.
|
|
847
|
+
*/
|
|
848
|
+
interface Document {
|
|
849
|
+
id: string;
|
|
850
|
+
tenant_user_id?: string;
|
|
851
|
+
filename: string;
|
|
852
|
+
content?: string;
|
|
853
|
+
created_at: string;
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
/**
|
|
857
|
+
* Resource for uploading, listing, and deleting documents.
|
|
858
|
+
*/
|
|
859
|
+
declare class Documents {
|
|
860
|
+
private readonly client;
|
|
861
|
+
constructor(client: APIClient);
|
|
862
|
+
/**
|
|
863
|
+
* Upload a document.
|
|
864
|
+
*/
|
|
865
|
+
upload(params: DocumentUploadParams, options?: RequestOptions): Promise<Document>;
|
|
866
|
+
/**
|
|
867
|
+
* List all documents. Paginated.
|
|
868
|
+
*/
|
|
869
|
+
list(params?: {
|
|
870
|
+
page?: number;
|
|
871
|
+
perPage?: number;
|
|
872
|
+
}, options?: RequestOptions): Promise<Page<Document>>;
|
|
873
|
+
/**
|
|
874
|
+
* Delete a document by ID.
|
|
875
|
+
*/
|
|
876
|
+
delete(documentId: string, options?: RequestOptions): Promise<void>;
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
/**
|
|
880
|
+
* ICP analysis recommendation.
|
|
881
|
+
*/
|
|
882
|
+
interface ICPAnalysis {
|
|
883
|
+
recommendation: string;
|
|
884
|
+
}
|
|
885
|
+
/**
|
|
886
|
+
* Channel recommendation.
|
|
887
|
+
*/
|
|
888
|
+
interface ChannelRecommendation {
|
|
889
|
+
recommendation: string;
|
|
890
|
+
}
|
|
891
|
+
/**
|
|
892
|
+
* Sequence strategy recommendation.
|
|
893
|
+
*/
|
|
894
|
+
interface SequenceStrategy {
|
|
895
|
+
recommendation: string;
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
/**
|
|
899
|
+
* Resource for AI-powered recommendations (ICP analysis, channel selection, sequence strategy).
|
|
900
|
+
*/
|
|
901
|
+
declare class Recommendations {
|
|
902
|
+
private readonly client;
|
|
903
|
+
constructor(client: APIClient);
|
|
904
|
+
/**
|
|
905
|
+
* Get an ICP analysis recommendation.
|
|
906
|
+
*/
|
|
907
|
+
icpAnalysis(options?: RequestOptions): Promise<ICPAnalysis>;
|
|
908
|
+
/**
|
|
909
|
+
* Get a channel recommendation.
|
|
910
|
+
*/
|
|
911
|
+
channel(options?: RequestOptions): Promise<ChannelRecommendation>;
|
|
912
|
+
/**
|
|
913
|
+
* Get a sequence strategy recommendation.
|
|
914
|
+
*/
|
|
915
|
+
sequenceStrategy(options?: RequestOptions): Promise<SequenceStrategy>;
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
/**
|
|
919
|
+
* Credit balance for a tenant.
|
|
920
|
+
*/
|
|
921
|
+
interface CreditBalance {
|
|
922
|
+
id: string;
|
|
923
|
+
tenant_id: string;
|
|
924
|
+
credits_remaining: number;
|
|
925
|
+
credits_used_total: number;
|
|
926
|
+
last_purchase_at: string;
|
|
927
|
+
created_at: string;
|
|
928
|
+
updated_at: string;
|
|
929
|
+
}
|
|
930
|
+
/**
|
|
931
|
+
* A single usage log entry.
|
|
932
|
+
*/
|
|
933
|
+
interface UsageEntry {
|
|
934
|
+
id: string;
|
|
935
|
+
tenant_id: string;
|
|
936
|
+
tenant_user_id: string;
|
|
937
|
+
endpoint: string;
|
|
938
|
+
operation: string;
|
|
939
|
+
credits_charged: number;
|
|
940
|
+
metadata: Record<string, unknown>;
|
|
941
|
+
created_at: string;
|
|
942
|
+
}
|
|
943
|
+
/**
|
|
944
|
+
* Aggregated usage summary.
|
|
945
|
+
*/
|
|
946
|
+
interface UsageSummary {
|
|
947
|
+
summary: UsageSummaryEntry[];
|
|
948
|
+
}
|
|
949
|
+
/**
|
|
950
|
+
* A single row in a usage summary.
|
|
951
|
+
*/
|
|
952
|
+
interface UsageSummaryEntry {
|
|
953
|
+
operation: string;
|
|
954
|
+
total_calls: number;
|
|
955
|
+
total_credits: number;
|
|
956
|
+
}
|
|
957
|
+
/**
|
|
958
|
+
* Parameters for listing usage entries.
|
|
959
|
+
*/
|
|
960
|
+
interface UsageListParams {
|
|
961
|
+
from?: string;
|
|
962
|
+
to?: string;
|
|
963
|
+
page?: number;
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
/**
|
|
967
|
+
* Resource for credit balance and usage tracking.
|
|
968
|
+
*/
|
|
969
|
+
declare class Billing {
|
|
970
|
+
private readonly client;
|
|
971
|
+
constructor(client: APIClient);
|
|
972
|
+
/**
|
|
973
|
+
* Get the current credit balance.
|
|
974
|
+
*/
|
|
975
|
+
balance(options?: RequestOptions): Promise<CreditBalance>;
|
|
976
|
+
/**
|
|
977
|
+
* List usage entries. Paginated.
|
|
978
|
+
*/
|
|
979
|
+
usage(params?: UsageListParams, options?: RequestOptions): Promise<Page<UsageEntry>>;
|
|
980
|
+
/**
|
|
981
|
+
* Get an aggregated usage summary.
|
|
982
|
+
*/
|
|
983
|
+
usageSummary(options?: RequestOptions): Promise<UsageSummary>;
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
/**
|
|
987
|
+
* Parameters for registering a new user.
|
|
988
|
+
*/
|
|
989
|
+
interface UserRegisterParams {
|
|
990
|
+
externalUserId: string;
|
|
991
|
+
aboutMe?: string;
|
|
992
|
+
icp?: string;
|
|
993
|
+
cta?: string;
|
|
994
|
+
}
|
|
995
|
+
/**
|
|
996
|
+
* Parameters for updating a user profile.
|
|
997
|
+
*/
|
|
998
|
+
interface UserUpdateParams {
|
|
999
|
+
aboutMe?: string;
|
|
1000
|
+
icp?: string;
|
|
1001
|
+
cta?: string;
|
|
1002
|
+
}
|
|
1003
|
+
/**
|
|
1004
|
+
* A user record.
|
|
1005
|
+
*/
|
|
1006
|
+
interface User {
|
|
1007
|
+
id: string;
|
|
1008
|
+
tenant_id: string;
|
|
1009
|
+
external_user_id: string;
|
|
1010
|
+
about_me: string;
|
|
1011
|
+
icp: string;
|
|
1012
|
+
cta: string;
|
|
1013
|
+
created_at: string;
|
|
1014
|
+
updated_at: string;
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
/**
|
|
1018
|
+
* Resource for user registration and profile management.
|
|
1019
|
+
*/
|
|
1020
|
+
declare class Users {
|
|
1021
|
+
private readonly client;
|
|
1022
|
+
constructor(client: APIClient);
|
|
1023
|
+
/**
|
|
1024
|
+
* Register a new user.
|
|
1025
|
+
*/
|
|
1026
|
+
register(params: UserRegisterParams, options?: RequestOptions): Promise<User>;
|
|
1027
|
+
/**
|
|
1028
|
+
* Get the current user's profile.
|
|
1029
|
+
*/
|
|
1030
|
+
me(options?: RequestOptions): Promise<User>;
|
|
1031
|
+
/**
|
|
1032
|
+
* Update the current user's profile.
|
|
1033
|
+
*/
|
|
1034
|
+
update(params: UserUpdateParams, options?: RequestOptions): Promise<User>;
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
/**
|
|
1038
|
+
* GeoDedo — the main SDK client.
|
|
1039
|
+
*
|
|
1040
|
+
* ```ts
|
|
1041
|
+
* const client = new GeoDedo({ apiKey: 'gd_live_xxx' });
|
|
1042
|
+
* const contacts = await client.contacts.search({ titles: ['CEO'] });
|
|
1043
|
+
* ```
|
|
1044
|
+
*/
|
|
1045
|
+
declare class GeoDedo {
|
|
1046
|
+
private readonly _client;
|
|
1047
|
+
/** Contact search, enrichment, and import. */
|
|
1048
|
+
readonly contacts: Contacts;
|
|
1049
|
+
/** Outreach sequence management. */
|
|
1050
|
+
readonly sequences: Sequences;
|
|
1051
|
+
/** Draft generation, review, and sending. */
|
|
1052
|
+
readonly drafts: Drafts;
|
|
1053
|
+
/** Direct message sending (email, LinkedIn, Instagram, SMS). */
|
|
1054
|
+
readonly messages: Messages;
|
|
1055
|
+
/** AI chat assistant. */
|
|
1056
|
+
readonly chat: Chat;
|
|
1057
|
+
/** Channel connection management. */
|
|
1058
|
+
readonly channels: Channels;
|
|
1059
|
+
/** Document upload and management. */
|
|
1060
|
+
readonly documents: Documents;
|
|
1061
|
+
/** AI-powered recommendations. */
|
|
1062
|
+
readonly recommendations: Recommendations;
|
|
1063
|
+
/** Credit balance and usage tracking. */
|
|
1064
|
+
readonly billing: Billing;
|
|
1065
|
+
/** User registration and profile management. */
|
|
1066
|
+
readonly users: Users;
|
|
1067
|
+
constructor(options?: Partial<ClientOptions>);
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
/**
|
|
1071
|
+
* Base error class for all GeoDedo SDK errors.
|
|
1072
|
+
*/
|
|
1073
|
+
declare class GeoDedoError extends Error {
|
|
1074
|
+
constructor(message: string);
|
|
1075
|
+
}
|
|
1076
|
+
/**
|
|
1077
|
+
* Error returned when the API responds with a non-2xx status code.
|
|
1078
|
+
*/
|
|
1079
|
+
declare class APIError extends GeoDedoError {
|
|
1080
|
+
/** HTTP status code. */
|
|
1081
|
+
readonly status: number;
|
|
1082
|
+
/** Machine-readable error code from the response body, if present. */
|
|
1083
|
+
readonly code: string | undefined;
|
|
1084
|
+
/** Request ID from the X-Request-Id response header, if present. */
|
|
1085
|
+
readonly requestId: string | undefined;
|
|
1086
|
+
/** Raw response body. */
|
|
1087
|
+
readonly body: unknown;
|
|
1088
|
+
constructor(status: number, body: unknown, message: string, code?: string, requestId?: string);
|
|
1089
|
+
/**
|
|
1090
|
+
* Factory that maps an HTTP status code to the appropriate error subclass.
|
|
1091
|
+
*/
|
|
1092
|
+
static fromResponse(status: number, body: unknown, headers?: Headers | Record<string, string>): APIError;
|
|
1093
|
+
}
|
|
1094
|
+
/**
|
|
1095
|
+
* 401 — Invalid or missing API key.
|
|
1096
|
+
*/
|
|
1097
|
+
declare class AuthenticationError extends APIError {
|
|
1098
|
+
constructor(body: unknown, message: string, code?: string, requestId?: string);
|
|
1099
|
+
}
|
|
1100
|
+
/**
|
|
1101
|
+
* 402 — Not enough credits to complete the request.
|
|
1102
|
+
*/
|
|
1103
|
+
declare class InsufficientCreditsError extends APIError {
|
|
1104
|
+
/** Number of credits required for the operation. */
|
|
1105
|
+
readonly creditsRequired: number | undefined;
|
|
1106
|
+
/** Current credit balance. */
|
|
1107
|
+
readonly creditsRemaining: number | undefined;
|
|
1108
|
+
constructor(body: unknown, message: string, code?: string, requestId?: string, creditsRequired?: number, creditsRemaining?: number);
|
|
1109
|
+
}
|
|
1110
|
+
/**
|
|
1111
|
+
* 403 — Authenticated but not authorized for this operation.
|
|
1112
|
+
*/
|
|
1113
|
+
declare class PermissionDeniedError extends APIError {
|
|
1114
|
+
constructor(body: unknown, message: string, code?: string, requestId?: string);
|
|
1115
|
+
}
|
|
1116
|
+
/**
|
|
1117
|
+
* 404 — The requested resource was not found.
|
|
1118
|
+
*/
|
|
1119
|
+
declare class NotFoundError extends APIError {
|
|
1120
|
+
constructor(body: unknown, message: string, code?: string, requestId?: string);
|
|
1121
|
+
}
|
|
1122
|
+
/**
|
|
1123
|
+
* 422 — Validation error in the request body or parameters.
|
|
1124
|
+
*/
|
|
1125
|
+
declare class ValidationError extends APIError {
|
|
1126
|
+
constructor(body: unknown, message: string, code?: string, requestId?: string);
|
|
1127
|
+
}
|
|
1128
|
+
/**
|
|
1129
|
+
* 429 — Rate limit exceeded.
|
|
1130
|
+
*/
|
|
1131
|
+
declare class RateLimitError extends APIError {
|
|
1132
|
+
/** Seconds to wait before retrying, from the Retry-After header. */
|
|
1133
|
+
readonly retryAfter: number | undefined;
|
|
1134
|
+
constructor(body: unknown, message: string, code?: string, requestId?: string, retryAfter?: number);
|
|
1135
|
+
}
|
|
1136
|
+
/**
|
|
1137
|
+
* 5xx — Internal server error.
|
|
1138
|
+
*/
|
|
1139
|
+
declare class InternalServerError extends APIError {
|
|
1140
|
+
constructor(status: number, body: unknown, message: string, code?: string, requestId?: string);
|
|
1141
|
+
}
|
|
1142
|
+
/**
|
|
1143
|
+
* Network-level failure (DNS, socket, TLS, etc.).
|
|
1144
|
+
*/
|
|
1145
|
+
declare class APIConnectionError extends GeoDedoError {
|
|
1146
|
+
/** The underlying error that caused the connection failure. */
|
|
1147
|
+
readonly cause: unknown;
|
|
1148
|
+
constructor(message: string, cause?: unknown);
|
|
1149
|
+
}
|
|
1150
|
+
/**
|
|
1151
|
+
* Request timed out before receiving a response.
|
|
1152
|
+
*/
|
|
1153
|
+
declare class APITimeoutError extends APIConnectionError {
|
|
1154
|
+
constructor(message?: string);
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
export { APIClient, type APIClientOptions, APIConnectionError, APIError, APITimeoutError, AgentMailChannel, type AgentMailCreateParams, type AgentMailCreateResult, AuthenticationError, Billing, type ChannelName, type ChannelRecommendation, type ChannelStatus, Channels, Chat, type ChatCreateParams, type ChatResponse, type CheckpointParams, type ClientOptions, type ConnectionResult, type Contact, type ContactEnrichParams, type ContactImportEntry, type ContactImportParams, type ContactSearchParams, Contacts, type Conversation, type ConversationMessage, ConversationsResource, type CreditBalance, type CsvList, type Document, type DocumentUploadParams, Documents, type Draft, type DraftApproveParams, type DraftApproveResult, type DraftBatchResult, type DraftContact, type DraftGenerateParams, type DraftListParams, type DraftSendError, type DraftSendParams, type DraftSendResult, type DraftUpdateParams, Drafts, type EmailResult, type EmailSendParams, GeoDedo, GeoDedoError, GmailChannel, type GmailConnectResult, type ICPAnalysis, type ImportResult, type InboxChannel, InstagramChannel, type InstagramConnectParams, type InstagramResult, type InstagramSendParams, InsufficientCreditsError, InternalServerError, LinkedInChannel, type LinkedInConnectParams, type LinkedInResult, type LinkedInSendParams, Messages, NotFoundError, Page, type PageRequestOptions, type PageResponse, type PaginationParams, PermissionDeniedError, RateLimitError, Recommendations, type RequestOptions, type Sequence, type SequenceCreateParams, type SequenceStats, type SequenceStrategy, type SequenceWithStats, Sequences, SmsChannel, type SmsConfirmParams, type SmsResult, type SmsSendParams, type SmsVerifyParams, type SmsVerifyResult, type StoredContact, type UsageEntry, type UsageListParams, type UsageSummary, type UsageSummaryEntry, type User, type UserRegisterParams, type UserUpdateParams, Users, ValidationError };
|