@linkt/sdk 0.2.0 → 0.4.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/CHANGELOG.md +35 -0
- package/client.d.mts +7 -4
- package/client.d.mts.map +1 -1
- package/client.d.ts +7 -4
- package/client.d.ts.map +1 -1
- package/client.js +3 -0
- package/client.js.map +1 -1
- package/client.mjs +3 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/entity.d.mts +392 -0
- package/resources/entity.d.mts.map +1 -0
- package/resources/entity.d.ts +392 -0
- package/resources/entity.d.ts.map +1 -0
- package/resources/entity.js +164 -0
- package/resources/entity.js.map +1 -0
- package/resources/entity.mjs +160 -0
- package/resources/entity.mjs.map +1 -0
- package/resources/icp.d.mts +56 -3
- package/resources/icp.d.mts.map +1 -1
- package/resources/icp.d.ts +56 -3
- package/resources/icp.d.ts.map +1 -1
- package/resources/icp.js +2 -2
- package/resources/icp.mjs +2 -2
- package/resources/index.d.mts +3 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/run.d.mts +3 -3
- package/resources/run.d.ts +3 -3
- package/resources/sheet/index.d.mts +1 -2
- package/resources/sheet/index.d.mts.map +1 -1
- package/resources/sheet/index.d.ts +1 -2
- package/resources/sheet/index.d.ts.map +1 -1
- package/resources/sheet/index.js +1 -3
- package/resources/sheet/index.js.map +1 -1
- package/resources/sheet/index.mjs +0 -1
- package/resources/sheet/index.mjs.map +1 -1
- package/resources/sheet/sheet.d.mts +1 -90
- package/resources/sheet/sheet.d.mts.map +1 -1
- package/resources/sheet/sheet.d.ts +1 -90
- package/resources/sheet/sheet.d.ts.map +1 -1
- package/resources/sheet/sheet.js +0 -22
- package/resources/sheet/sheet.js.map +1 -1
- package/resources/sheet/sheet.mjs +0 -22
- package/resources/sheet/sheet.mjs.map +1 -1
- package/resources/task.d.mts +443 -288
- package/resources/task.d.mts.map +1 -1
- package/resources/task.d.ts +443 -288
- package/resources/task.d.ts.map +1 -1
- package/src/client.ts +57 -20
- package/src/resources/entity.ts +491 -0
- package/src/resources/icp.ts +59 -3
- package/src/resources/index.ts +27 -10
- package/src/resources/run.ts +3 -3
- package/src/resources/sheet/index.ts +0 -11
- package/src/resources/sheet/sheet.ts +0 -136
- package/src/resources/task.ts +530 -329
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/resources/sheet/entity.d.mts +0 -52
- package/resources/sheet/entity.d.mts.map +0 -1
- package/resources/sheet/entity.d.ts +0 -52
- package/resources/sheet/entity.d.ts.map +0 -1
- package/resources/sheet/entity.js +0 -45
- package/resources/sheet/entity.js.map +0 -1
- package/resources/sheet/entity.mjs +0 -41
- package/resources/sheet/entity.mjs.map +0 -1
- package/src/resources/sheet/entity.ts +0 -97
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.js";
|
|
2
|
+
import * as SheetAPI from "./sheet/sheet.js";
|
|
3
|
+
import { APIPromise } from "../core/api-promise.js";
|
|
4
|
+
import { RequestOptions } from "../internal/request-options.js";
|
|
5
|
+
export declare class Entity extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Get a single entity by ID with enrichment.
|
|
8
|
+
*
|
|
9
|
+
* Returns the entity with sheet_name, entity_type, and icp_id populated from the
|
|
10
|
+
* parent sheet.
|
|
11
|
+
*/
|
|
12
|
+
retrieve(entityID: string, options?: RequestOptions): APIPromise<EntityResponse>;
|
|
13
|
+
/**
|
|
14
|
+
* Update entity status or comments.
|
|
15
|
+
*
|
|
16
|
+
* Only status and comments can be updated via this endpoint. Use status=null to
|
|
17
|
+
* clear status, comments=null to clear comments.
|
|
18
|
+
*
|
|
19
|
+
* Status must be one of: new, reviewed, passed, contacted, or null.
|
|
20
|
+
*/
|
|
21
|
+
update(entityID: string, body: EntityUpdateParams, options?: RequestOptions): APIPromise<EntityResponse>;
|
|
22
|
+
/**
|
|
23
|
+
* Get paginated list of entities with filtering.
|
|
24
|
+
*
|
|
25
|
+
* Supports filtering by:
|
|
26
|
+
*
|
|
27
|
+
* - icp_id: Entities in sheets belonging to an ICP
|
|
28
|
+
* - sheet_id: Entities in a specific sheet
|
|
29
|
+
* - entity_type: Entities of a specific type (company, person, etc.)
|
|
30
|
+
* - status: Filter by workflow status (supports multiple:
|
|
31
|
+
* ?status=new&status=reviewed) Valid values: new, reviewed, passed, contacted,
|
|
32
|
+
* null
|
|
33
|
+
*
|
|
34
|
+
* All results include enrichment fields for UI annotations.
|
|
35
|
+
*/
|
|
36
|
+
list(query?: EntityListParams | null | undefined, options?: RequestOptions): APIPromise<EntityListResponse>;
|
|
37
|
+
/**
|
|
38
|
+
* Delete an entity by ID.
|
|
39
|
+
*
|
|
40
|
+
* This is a hard delete - the entity will be permanently removed.
|
|
41
|
+
*/
|
|
42
|
+
delete(entityID: string, options?: RequestOptions): APIPromise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* Update status for multiple entities at once.
|
|
45
|
+
*
|
|
46
|
+
* Accepts a list of entity IDs and a status value. The status can be:
|
|
47
|
+
*
|
|
48
|
+
* - "new", "reviewed", "passed", "contacted" (valid workflow statuses)
|
|
49
|
+
* - null (to clear the status)
|
|
50
|
+
*
|
|
51
|
+
* Returns the count of successfully updated entities and any failed IDs. Entities
|
|
52
|
+
* may fail to update if they have an invalid ID format or don't exist.
|
|
53
|
+
*
|
|
54
|
+
* WHY: Bulk operations enable users to update status for many entities at once
|
|
55
|
+
* (e.g., mark all search results as "reviewed"), improving workflow efficiency
|
|
56
|
+
* versus N individual PUT calls. Uses batch_update_by_filter for single database
|
|
57
|
+
* roundtrip efficiency.
|
|
58
|
+
*/
|
|
59
|
+
bulkUpdateStatus(body: EntityBulkUpdateStatusParams, options?: RequestOptions): APIPromise<EntityBulkUpdateStatusResponse>;
|
|
60
|
+
/**
|
|
61
|
+
* Export entities as CSV.
|
|
62
|
+
*
|
|
63
|
+
* Supports two formats:
|
|
64
|
+
*
|
|
65
|
+
* **separate** (default):
|
|
66
|
+
*
|
|
67
|
+
* - One row per entity
|
|
68
|
+
* - Standard flat export
|
|
69
|
+
* - All entity types exported independently
|
|
70
|
+
*
|
|
71
|
+
* **combined**:
|
|
72
|
+
*
|
|
73
|
+
* - Pre-joined parent-child rows
|
|
74
|
+
* - Requires icp_id parameter
|
|
75
|
+
* - Child entity columns appear first, followed by parent columns
|
|
76
|
+
* - Columns prefixed with entity type (e.g., "Person Name", "Company Industry")
|
|
77
|
+
* - Parent data repeats for each child (one row per child)
|
|
78
|
+
* - Orphan parents (no children) appear as rows with empty child columns
|
|
79
|
+
*
|
|
80
|
+
* **Excluded Fields** (both formats):
|
|
81
|
+
*
|
|
82
|
+
* - id, sheet_id, parent_id, icp_id, entity_type, sheet_name, comments
|
|
83
|
+
*
|
|
84
|
+
* **Included Fields**:
|
|
85
|
+
*
|
|
86
|
+
* - All data.\* fields (the actual enrichment data)
|
|
87
|
+
* - status, created_at, updated_at
|
|
88
|
+
*
|
|
89
|
+
* **Filtering**:
|
|
90
|
+
*
|
|
91
|
+
* - status: Filter by workflow status (supports multiple:
|
|
92
|
+
* ?status=new&status=contacted) Valid values: new, reviewed, passed, contacted,
|
|
93
|
+
* null
|
|
94
|
+
*
|
|
95
|
+
* Args: icp_id: Filter by ICP ID (REQUIRED for format=combined) sheet_id: Filter
|
|
96
|
+
* by sheet ID entity_type: Filter by entity type (ignored for format=combined)
|
|
97
|
+
* entity_ids: Export specific entity IDs status: Filter by status values (multiple
|
|
98
|
+
* allowed) format: Export format - "separate" (default) or "combined"
|
|
99
|
+
*
|
|
100
|
+
* Returns: StreamingResponse with CSV content
|
|
101
|
+
*
|
|
102
|
+
* Raises: HTTPException 400: format=combined without icp_id, or invalid status
|
|
103
|
+
* value HTTPException 404: ICP, sheet, or entities not found
|
|
104
|
+
*/
|
|
105
|
+
export(query?: EntityExportParams | null | undefined, options?: RequestOptions): APIPromise<unknown>;
|
|
106
|
+
/**
|
|
107
|
+
* Get entity counts grouped by entity_type.
|
|
108
|
+
*
|
|
109
|
+
* Returns the count of entities for each entity_type (company, person, etc.)
|
|
110
|
+
* across the organization. Supports optional filtering by ICP or status.
|
|
111
|
+
*
|
|
112
|
+
* Additional filtering:
|
|
113
|
+
*
|
|
114
|
+
* - status: Filter by workflow status (supports multiple:
|
|
115
|
+
* ?status=new&status=reviewed) Valid values: new, reviewed, passed, contacted,
|
|
116
|
+
* null
|
|
117
|
+
*
|
|
118
|
+
* Used by Entity Master List for accurate tab navigation counts.
|
|
119
|
+
*/
|
|
120
|
+
getCounts(query?: EntityGetCountsParams | null | undefined, options?: RequestOptions): APIPromise<EntityGetCountsResponse>;
|
|
121
|
+
/**
|
|
122
|
+
* Search entities by text query.
|
|
123
|
+
*
|
|
124
|
+
* Uses MongoDB Atlas Search for fuzzy text matching on entity names and company
|
|
125
|
+
* fields. Results are sorted by relevance.
|
|
126
|
+
*
|
|
127
|
+
* Scope of search determined by filters:
|
|
128
|
+
*
|
|
129
|
+
* - sheet_id: Search within specific sheet
|
|
130
|
+
* - icp_id: Search across ICP sheets
|
|
131
|
+
* - No filters: Search org-wide
|
|
132
|
+
*
|
|
133
|
+
* Additional filtering:
|
|
134
|
+
*
|
|
135
|
+
* - status: Filter by workflow status (supports multiple:
|
|
136
|
+
* ?status=new&status=reviewed) Valid values: new, reviewed, passed, contacted,
|
|
137
|
+
* null
|
|
138
|
+
*/
|
|
139
|
+
search(query: EntitySearchParams, options?: RequestOptions): APIPromise<EntitySearchResponse>;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Response model for single entity.
|
|
143
|
+
*
|
|
144
|
+
* IMPORTANT: Enrichment fields (sheet_name, entity_type, icp_id) are ALWAYS
|
|
145
|
+
* populated to support UI annotations. Excludes embedding data for HTTP
|
|
146
|
+
* efficiency.
|
|
147
|
+
*/
|
|
148
|
+
export interface EntityResponse {
|
|
149
|
+
/**
|
|
150
|
+
* Entity ID
|
|
151
|
+
*/
|
|
152
|
+
id: string;
|
|
153
|
+
/**
|
|
154
|
+
* Creation timestamp
|
|
155
|
+
*/
|
|
156
|
+
created_at: string;
|
|
157
|
+
/**
|
|
158
|
+
* Entity attribute data
|
|
159
|
+
*/
|
|
160
|
+
data: {
|
|
161
|
+
[key: string]: unknown;
|
|
162
|
+
};
|
|
163
|
+
/**
|
|
164
|
+
* Entity type (company, person, etc.)
|
|
165
|
+
*/
|
|
166
|
+
entity_type: string;
|
|
167
|
+
/**
|
|
168
|
+
* ICP ID (via sheet)
|
|
169
|
+
*/
|
|
170
|
+
icp_id: string;
|
|
171
|
+
/**
|
|
172
|
+
* Sheet this entity belongs to
|
|
173
|
+
*/
|
|
174
|
+
sheet_id: string;
|
|
175
|
+
/**
|
|
176
|
+
* Name of parent sheet
|
|
177
|
+
*/
|
|
178
|
+
sheet_name: string;
|
|
179
|
+
/**
|
|
180
|
+
* Last update timestamp
|
|
181
|
+
*/
|
|
182
|
+
updated_at: string;
|
|
183
|
+
/**
|
|
184
|
+
* User comments
|
|
185
|
+
*/
|
|
186
|
+
comments?: string | null;
|
|
187
|
+
/**
|
|
188
|
+
* Parent entity ID (for hierarchical entities)
|
|
189
|
+
*/
|
|
190
|
+
parent_id?: string | null;
|
|
191
|
+
/**
|
|
192
|
+
* Entity workflow status: new, reviewed, passed, contacted, or null
|
|
193
|
+
*/
|
|
194
|
+
status?: string | null;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Paginated list response for entities.
|
|
198
|
+
*
|
|
199
|
+
* All entities include enrichment fields (sheet_name, entity_type, icp_id) to
|
|
200
|
+
* support UI annotations without additional API calls.
|
|
201
|
+
*/
|
|
202
|
+
export interface EntityListResponse {
|
|
203
|
+
entities: Array<EntityResponse>;
|
|
204
|
+
/**
|
|
205
|
+
* Current page (1-based)
|
|
206
|
+
*/
|
|
207
|
+
page: number;
|
|
208
|
+
/**
|
|
209
|
+
* Items per page
|
|
210
|
+
*/
|
|
211
|
+
page_size: number;
|
|
212
|
+
/**
|
|
213
|
+
* Total matching entities (before pagination)
|
|
214
|
+
*/
|
|
215
|
+
total: number;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Response for bulk status update operation.
|
|
219
|
+
*
|
|
220
|
+
* WHY: Reports both success count and specific failures so the client knows
|
|
221
|
+
* exactly which entities were updated and which failed.
|
|
222
|
+
*/
|
|
223
|
+
export interface EntityBulkUpdateStatusResponse {
|
|
224
|
+
/**
|
|
225
|
+
* Number of entities successfully updated
|
|
226
|
+
*/
|
|
227
|
+
updated_count: number;
|
|
228
|
+
/**
|
|
229
|
+
* Entity IDs that failed to update (invalid format or not found)
|
|
230
|
+
*/
|
|
231
|
+
failed_ids?: Array<string>;
|
|
232
|
+
}
|
|
233
|
+
export type EntityExportResponse = unknown;
|
|
234
|
+
/**
|
|
235
|
+
* Response model for entity counts by type.
|
|
236
|
+
*
|
|
237
|
+
* Returns counts grouped by entity_type with an aggregate total. Used by Entity
|
|
238
|
+
* Master List for tab navigation counts.
|
|
239
|
+
*/
|
|
240
|
+
export interface EntityGetCountsResponse {
|
|
241
|
+
/**
|
|
242
|
+
* Sum of all entity counts
|
|
243
|
+
*/
|
|
244
|
+
total: number;
|
|
245
|
+
/**
|
|
246
|
+
* Entity counts keyed by entity_type (company, person, etc.)
|
|
247
|
+
*/
|
|
248
|
+
counts?: {
|
|
249
|
+
[key: string]: number;
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Search response with pagination.
|
|
254
|
+
*
|
|
255
|
+
* All entities include enrichment fields for UI annotations.
|
|
256
|
+
*/
|
|
257
|
+
export interface EntitySearchResponse {
|
|
258
|
+
entities: Array<EntityResponse>;
|
|
259
|
+
/**
|
|
260
|
+
* Current page (1-based)
|
|
261
|
+
*/
|
|
262
|
+
page: number;
|
|
263
|
+
/**
|
|
264
|
+
* Items per page
|
|
265
|
+
*/
|
|
266
|
+
page_size: number;
|
|
267
|
+
/**
|
|
268
|
+
* Original search query
|
|
269
|
+
*/
|
|
270
|
+
query: string;
|
|
271
|
+
/**
|
|
272
|
+
* Total matching entities
|
|
273
|
+
*/
|
|
274
|
+
total: number;
|
|
275
|
+
}
|
|
276
|
+
export interface EntityUpdateParams {
|
|
277
|
+
/**
|
|
278
|
+
* Update comments (null to clear)
|
|
279
|
+
*/
|
|
280
|
+
comments?: string | null;
|
|
281
|
+
/**
|
|
282
|
+
* Update workflow status: new, reviewed, passed, contacted, or null. Use explicit
|
|
283
|
+
* null to clear status.
|
|
284
|
+
*/
|
|
285
|
+
status?: string | null;
|
|
286
|
+
}
|
|
287
|
+
export interface EntityListParams {
|
|
288
|
+
/**
|
|
289
|
+
* Valid entity types for sheets.
|
|
290
|
+
*/
|
|
291
|
+
entity_type?: SheetAPI.EntityType | null;
|
|
292
|
+
/**
|
|
293
|
+
* Filter by ICP ID
|
|
294
|
+
*/
|
|
295
|
+
icp_id?: string | null;
|
|
296
|
+
/**
|
|
297
|
+
* Page number (1-based)
|
|
298
|
+
*/
|
|
299
|
+
page?: number;
|
|
300
|
+
/**
|
|
301
|
+
* Items per page
|
|
302
|
+
*/
|
|
303
|
+
page_size?: number;
|
|
304
|
+
/**
|
|
305
|
+
* Filter by sheet ID
|
|
306
|
+
*/
|
|
307
|
+
sheet_id?: string | null;
|
|
308
|
+
/**
|
|
309
|
+
* Filter by status values (supports multiple: ?status=new&status=reviewed)
|
|
310
|
+
*/
|
|
311
|
+
status?: Array<string> | null;
|
|
312
|
+
}
|
|
313
|
+
export interface EntityBulkUpdateStatusParams {
|
|
314
|
+
/**
|
|
315
|
+
* List of entity IDs to update (1-1000 IDs)
|
|
316
|
+
*/
|
|
317
|
+
entity_ids: Array<string>;
|
|
318
|
+
/**
|
|
319
|
+
* New status value: new, reviewed, passed, contacted, or null to clear
|
|
320
|
+
*/
|
|
321
|
+
status: string | null;
|
|
322
|
+
}
|
|
323
|
+
export interface EntityExportParams {
|
|
324
|
+
/**
|
|
325
|
+
* Specific entity IDs
|
|
326
|
+
*/
|
|
327
|
+
entity_ids?: Array<string> | null;
|
|
328
|
+
/**
|
|
329
|
+
* Valid entity types for sheets.
|
|
330
|
+
*/
|
|
331
|
+
entity_type?: SheetAPI.EntityType | null;
|
|
332
|
+
/**
|
|
333
|
+
* Export format: 'separate' (default) or 'combined' (joined parent-child rows)
|
|
334
|
+
*/
|
|
335
|
+
format?: 'separate' | 'combined';
|
|
336
|
+
/**
|
|
337
|
+
* Filter by ICP ID
|
|
338
|
+
*/
|
|
339
|
+
icp_id?: string | null;
|
|
340
|
+
/**
|
|
341
|
+
* Filter by sheet ID
|
|
342
|
+
*/
|
|
343
|
+
sheet_id?: string | null;
|
|
344
|
+
/**
|
|
345
|
+
* Filter by status values (supports multiple: ?status=new&status=contacted)
|
|
346
|
+
*/
|
|
347
|
+
status?: Array<string> | null;
|
|
348
|
+
}
|
|
349
|
+
export interface EntityGetCountsParams {
|
|
350
|
+
/**
|
|
351
|
+
* Filter by ICP ID
|
|
352
|
+
*/
|
|
353
|
+
icp_id?: string | null;
|
|
354
|
+
/**
|
|
355
|
+
* Filter by status values (supports multiple: ?status=new&status=passed)
|
|
356
|
+
*/
|
|
357
|
+
status?: Array<string> | null;
|
|
358
|
+
}
|
|
359
|
+
export interface EntitySearchParams {
|
|
360
|
+
/**
|
|
361
|
+
* Search query
|
|
362
|
+
*/
|
|
363
|
+
q: string;
|
|
364
|
+
/**
|
|
365
|
+
* Valid entity types for sheets.
|
|
366
|
+
*/
|
|
367
|
+
entity_type?: SheetAPI.EntityType | null;
|
|
368
|
+
/**
|
|
369
|
+
* Filter by ICP ID
|
|
370
|
+
*/
|
|
371
|
+
icp_id?: string | null;
|
|
372
|
+
/**
|
|
373
|
+
* Page number
|
|
374
|
+
*/
|
|
375
|
+
page?: number;
|
|
376
|
+
/**
|
|
377
|
+
* Items per page
|
|
378
|
+
*/
|
|
379
|
+
page_size?: number;
|
|
380
|
+
/**
|
|
381
|
+
* Filter by sheet ID
|
|
382
|
+
*/
|
|
383
|
+
sheet_id?: string | null;
|
|
384
|
+
/**
|
|
385
|
+
* Filter by status values (supports multiple: ?status=new&status=reviewed)
|
|
386
|
+
*/
|
|
387
|
+
status?: Array<string> | null;
|
|
388
|
+
}
|
|
389
|
+
export declare namespace Entity {
|
|
390
|
+
export { type EntityResponse as EntityResponse, type EntityListResponse as EntityListResponse, type EntityBulkUpdateStatusResponse as EntityBulkUpdateStatusResponse, type EntityExportResponse as EntityExportResponse, type EntityGetCountsResponse as EntityGetCountsResponse, type EntitySearchResponse as EntitySearchResponse, type EntityUpdateParams as EntityUpdateParams, type EntityListParams as EntityListParams, type EntityBulkUpdateStatusParams as EntityBulkUpdateStatusParams, type EntityExportParams as EntityExportParams, type EntityGetCountsParams as EntityGetCountsParams, type EntitySearchParams as EntitySearchParams, };
|
|
391
|
+
}
|
|
392
|
+
//# sourceMappingURL=entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../src/resources/entity.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,QAAQ;OACb,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAGzB,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,cAAc,CAAC;IAIhF;;;;;;;OAOG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,cAAc,CAAC;IAIxG;;;;;;;;;;;;;OAaG;IACH,IAAI,CACF,KAAK,GAAE,gBAAgB,GAAG,IAAI,GAAG,SAAc,EAC/C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,WAAW,CAAC,EAAE,QAAQ,CAAC,UAAU,GAAG,IAAI,CAAC;IAEzC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;CAC/B;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Entity = void 0;
|
|
5
|
+
const resource_1 = require("../core/resource.js");
|
|
6
|
+
const headers_1 = require("../internal/headers.js");
|
|
7
|
+
const path_1 = require("../internal/utils/path.js");
|
|
8
|
+
class Entity extends resource_1.APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Get a single entity by ID with enrichment.
|
|
11
|
+
*
|
|
12
|
+
* Returns the entity with sheet_name, entity_type, and icp_id populated from the
|
|
13
|
+
* parent sheet.
|
|
14
|
+
*/
|
|
15
|
+
retrieve(entityID, options) {
|
|
16
|
+
return this._client.get((0, path_1.path) `/v1/entity/${entityID}`, options);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Update entity status or comments.
|
|
20
|
+
*
|
|
21
|
+
* Only status and comments can be updated via this endpoint. Use status=null to
|
|
22
|
+
* clear status, comments=null to clear comments.
|
|
23
|
+
*
|
|
24
|
+
* Status must be one of: new, reviewed, passed, contacted, or null.
|
|
25
|
+
*/
|
|
26
|
+
update(entityID, body, options) {
|
|
27
|
+
return this._client.put((0, path_1.path) `/v1/entity/${entityID}`, { body, ...options });
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Get paginated list of entities with filtering.
|
|
31
|
+
*
|
|
32
|
+
* Supports filtering by:
|
|
33
|
+
*
|
|
34
|
+
* - icp_id: Entities in sheets belonging to an ICP
|
|
35
|
+
* - sheet_id: Entities in a specific sheet
|
|
36
|
+
* - entity_type: Entities of a specific type (company, person, etc.)
|
|
37
|
+
* - status: Filter by workflow status (supports multiple:
|
|
38
|
+
* ?status=new&status=reviewed) Valid values: new, reviewed, passed, contacted,
|
|
39
|
+
* null
|
|
40
|
+
*
|
|
41
|
+
* All results include enrichment fields for UI annotations.
|
|
42
|
+
*/
|
|
43
|
+
list(query = {}, options) {
|
|
44
|
+
return this._client.get('/v1/entity', { query, ...options });
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Delete an entity by ID.
|
|
48
|
+
*
|
|
49
|
+
* This is a hard delete - the entity will be permanently removed.
|
|
50
|
+
*/
|
|
51
|
+
delete(entityID, options) {
|
|
52
|
+
return this._client.delete((0, path_1.path) `/v1/entity/${entityID}`, {
|
|
53
|
+
...options,
|
|
54
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Update status for multiple entities at once.
|
|
59
|
+
*
|
|
60
|
+
* Accepts a list of entity IDs and a status value. The status can be:
|
|
61
|
+
*
|
|
62
|
+
* - "new", "reviewed", "passed", "contacted" (valid workflow statuses)
|
|
63
|
+
* - null (to clear the status)
|
|
64
|
+
*
|
|
65
|
+
* Returns the count of successfully updated entities and any failed IDs. Entities
|
|
66
|
+
* may fail to update if they have an invalid ID format or don't exist.
|
|
67
|
+
*
|
|
68
|
+
* WHY: Bulk operations enable users to update status for many entities at once
|
|
69
|
+
* (e.g., mark all search results as "reviewed"), improving workflow efficiency
|
|
70
|
+
* versus N individual PUT calls. Uses batch_update_by_filter for single database
|
|
71
|
+
* roundtrip efficiency.
|
|
72
|
+
*/
|
|
73
|
+
bulkUpdateStatus(body, options) {
|
|
74
|
+
return this._client.patch('/v1/entity/status/bulk', { body, ...options });
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Export entities as CSV.
|
|
78
|
+
*
|
|
79
|
+
* Supports two formats:
|
|
80
|
+
*
|
|
81
|
+
* **separate** (default):
|
|
82
|
+
*
|
|
83
|
+
* - One row per entity
|
|
84
|
+
* - Standard flat export
|
|
85
|
+
* - All entity types exported independently
|
|
86
|
+
*
|
|
87
|
+
* **combined**:
|
|
88
|
+
*
|
|
89
|
+
* - Pre-joined parent-child rows
|
|
90
|
+
* - Requires icp_id parameter
|
|
91
|
+
* - Child entity columns appear first, followed by parent columns
|
|
92
|
+
* - Columns prefixed with entity type (e.g., "Person Name", "Company Industry")
|
|
93
|
+
* - Parent data repeats for each child (one row per child)
|
|
94
|
+
* - Orphan parents (no children) appear as rows with empty child columns
|
|
95
|
+
*
|
|
96
|
+
* **Excluded Fields** (both formats):
|
|
97
|
+
*
|
|
98
|
+
* - id, sheet_id, parent_id, icp_id, entity_type, sheet_name, comments
|
|
99
|
+
*
|
|
100
|
+
* **Included Fields**:
|
|
101
|
+
*
|
|
102
|
+
* - All data.\* fields (the actual enrichment data)
|
|
103
|
+
* - status, created_at, updated_at
|
|
104
|
+
*
|
|
105
|
+
* **Filtering**:
|
|
106
|
+
*
|
|
107
|
+
* - status: Filter by workflow status (supports multiple:
|
|
108
|
+
* ?status=new&status=contacted) Valid values: new, reviewed, passed, contacted,
|
|
109
|
+
* null
|
|
110
|
+
*
|
|
111
|
+
* Args: icp_id: Filter by ICP ID (REQUIRED for format=combined) sheet_id: Filter
|
|
112
|
+
* by sheet ID entity_type: Filter by entity type (ignored for format=combined)
|
|
113
|
+
* entity_ids: Export specific entity IDs status: Filter by status values (multiple
|
|
114
|
+
* allowed) format: Export format - "separate" (default) or "combined"
|
|
115
|
+
*
|
|
116
|
+
* Returns: StreamingResponse with CSV content
|
|
117
|
+
*
|
|
118
|
+
* Raises: HTTPException 400: format=combined without icp_id, or invalid status
|
|
119
|
+
* value HTTPException 404: ICP, sheet, or entities not found
|
|
120
|
+
*/
|
|
121
|
+
export(query = {}, options) {
|
|
122
|
+
return this._client.get('/v1/entity/export', { query, ...options });
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Get entity counts grouped by entity_type.
|
|
126
|
+
*
|
|
127
|
+
* Returns the count of entities for each entity_type (company, person, etc.)
|
|
128
|
+
* across the organization. Supports optional filtering by ICP or status.
|
|
129
|
+
*
|
|
130
|
+
* Additional filtering:
|
|
131
|
+
*
|
|
132
|
+
* - status: Filter by workflow status (supports multiple:
|
|
133
|
+
* ?status=new&status=reviewed) Valid values: new, reviewed, passed, contacted,
|
|
134
|
+
* null
|
|
135
|
+
*
|
|
136
|
+
* Used by Entity Master List for accurate tab navigation counts.
|
|
137
|
+
*/
|
|
138
|
+
getCounts(query = {}, options) {
|
|
139
|
+
return this._client.get('/v1/entity/counts', { query, ...options });
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Search entities by text query.
|
|
143
|
+
*
|
|
144
|
+
* Uses MongoDB Atlas Search for fuzzy text matching on entity names and company
|
|
145
|
+
* fields. Results are sorted by relevance.
|
|
146
|
+
*
|
|
147
|
+
* Scope of search determined by filters:
|
|
148
|
+
*
|
|
149
|
+
* - sheet_id: Search within specific sheet
|
|
150
|
+
* - icp_id: Search across ICP sheets
|
|
151
|
+
* - No filters: Search org-wide
|
|
152
|
+
*
|
|
153
|
+
* Additional filtering:
|
|
154
|
+
*
|
|
155
|
+
* - status: Filter by workflow status (supports multiple:
|
|
156
|
+
* ?status=new&status=reviewed) Valid values: new, reviewed, passed, contacted,
|
|
157
|
+
* null
|
|
158
|
+
*/
|
|
159
|
+
search(query, options) {
|
|
160
|
+
return this._client.get('/v1/entity/search', { query, ...options });
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
exports.Entity = Entity;
|
|
164
|
+
//# sourceMappingURL=entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity.js","sourceRoot":"","sources":["../src/resources/entity.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAAmD;AAEnD,oDAA8C;AAE9C,MAAa,MAAO,SAAQ,sBAAW;IACrC;;;;;OAKG;IACH,QAAQ,CAAC,QAAgB,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,cAAc,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,QAAgB,EAAE,IAAwB,EAAE,OAAwB;QACzE,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,cAAc,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9E,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,IAAI,CACF,QAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAA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