@elevasis/sdk 1.2.0 → 1.3.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/dist/cli.cjs +16 -5
- package/dist/index.d.ts +476 -49
- package/dist/types/worker/adapters/index.d.ts +1 -0
- package/dist/types/worker/adapters/lead.d.ts +1 -1
- package/dist/types/worker/adapters/list.d.ts +9 -0
- package/dist/worker/index.js +20 -3
- package/package.json +6 -4
- package/reference/_navigation.md +6 -55
- package/reference/_reference-manifest.json +437 -0
- package/reference/cli.mdx +75 -3
- package/reference/deployment/index.mdx +2 -1
- package/reference/deployment/provided-features.mdx +259 -0
- package/reference/deployment/ui-execution.mdx +251 -0
- package/reference/index.mdx +5 -3
- package/reference/platform-tools/adapters-platform.mdx +93 -36
- package/reference/resources/patterns.mdx +48 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Platform Adapters
|
|
3
|
-
description: Type-safe singleton adapters for built-in platform services -- scheduler, storage, LLM, PDF, approval, notifications, acqDb, execution, and email -- no credentials required
|
|
4
|
-
loadWhen: "Using platform service adapters (scheduler, storage, llm, pdf, approval, acqDb,
|
|
3
|
+
description: Type-safe singleton adapters for built-in platform services -- scheduler, storage, LLM, PDF, approval, notifications, acqDb, list, execution, and email -- no credentials required
|
|
4
|
+
loadWhen: "Using platform service adapters (scheduler, storage, llm, pdf, approval, notifications, acqDb, list, execution, email)"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
Platform adapters are singleton objects imported directly from `@elevasis/sdk/worker`. They require no credential argument because the platform injects context server-side. For integration adapters (Attio, Stripe, etc.), see [Integration Adapters](adapters-integration.mdx).
|
|
@@ -9,7 +9,7 @@ Platform adapters are singleton objects imported directly from `@elevasis/sdk/wo
|
|
|
9
9
|
```typescript
|
|
10
10
|
import {
|
|
11
11
|
acqDb, scheduler, storage, pdf, approval,
|
|
12
|
-
notifications, llm, execution, email,
|
|
12
|
+
notifications, llm, list, execution, email,
|
|
13
13
|
} from '@elevasis/sdk/worker'
|
|
14
14
|
```
|
|
15
15
|
|
|
@@ -19,13 +19,14 @@ import {
|
|
|
19
19
|
|
|
20
20
|
| Import | Methods | Purpose |
|
|
21
21
|
| --------------- | ------- | ------------------------------------ |
|
|
22
|
-
| `acqDb` |
|
|
22
|
+
| `acqDb` | 49 | Acquisition database CRUD and sync |
|
|
23
23
|
| `scheduler` | 9 | Task schedule management |
|
|
24
24
|
| `storage` | 5 | File upload, download, signed URLs |
|
|
25
25
|
| `pdf` | 2 | PDF rendering to storage or buffer |
|
|
26
26
|
| `approval` | 2 | Human-in-the-loop approval gates |
|
|
27
27
|
| `notifications` | 1 | In-app team notifications |
|
|
28
28
|
| `llm` | 1 | LLM inference with structured output |
|
|
29
|
+
| `list` | 4 | List-scoped execution and stage ops |
|
|
29
30
|
| `execution` | 1 | Trigger nested child executions |
|
|
30
31
|
| `email` | 1 | Send email to org members |
|
|
31
32
|
|
|
@@ -287,7 +288,7 @@ await notifications.create({
|
|
|
287
288
|
|
|
288
289
|
## AcqDb Adapter
|
|
289
290
|
|
|
290
|
-
Singleton --
|
|
291
|
+
Singleton -- 41 methods for acquisition database management (lists, companies, contacts, deals, deal-sync, enrichment, social monitoring). `organizationId` is injected server-side -- never pass it.
|
|
291
292
|
|
|
292
293
|
```typescript
|
|
293
294
|
import { acqDb } from '@elevasis/sdk/worker'
|
|
@@ -297,12 +298,13 @@ import { acqDb } from '@elevasis/sdk/worker'
|
|
|
297
298
|
|
|
298
299
|
**List operations:**
|
|
299
300
|
|
|
300
|
-
| Method
|
|
301
|
-
|
|
|
302
|
-
| `listLists`
|
|
303
|
-
| `createList`
|
|
304
|
-
| `updateList`
|
|
305
|
-
| `deleteList`
|
|
301
|
+
| Method | Params | Returns |
|
|
302
|
+
| ------------------- | --------------------------------------------------- | ------------------------- |
|
|
303
|
+
| `listLists` | none | `AcqList[]` |
|
|
304
|
+
| `createList` | `Omit<CreateListParams, 'organizationId'>` | `AcqList` |
|
|
305
|
+
| `updateList` | `{ id } & UpdateListParams` | `AcqList` |
|
|
306
|
+
| `deleteList` | `{ id }` | `void` |
|
|
307
|
+
| `addContactsToList` | `Omit<AddContactsToListParams, 'organizationId'>` | `AddContactsToListResult` |
|
|
306
308
|
|
|
307
309
|
**Company operations:**
|
|
308
310
|
|
|
@@ -317,16 +319,18 @@ import { acqDb } from '@elevasis/sdk/worker'
|
|
|
317
319
|
|
|
318
320
|
**Contact operations:**
|
|
319
321
|
|
|
320
|
-
| Method
|
|
321
|
-
|
|
|
322
|
-
| `createContact`
|
|
323
|
-
| `upsertContact`
|
|
324
|
-
| `updateContact`
|
|
325
|
-
| `getContact`
|
|
326
|
-
| `getContactByEmail`
|
|
327
|
-
| `listContacts`
|
|
328
|
-
| `deleteContact`
|
|
329
|
-
| `bulkImportContacts`
|
|
322
|
+
| Method | Params | Returns |
|
|
323
|
+
| ----------------------------- | ----------------------------------------------------- | ------------------------------- |
|
|
324
|
+
| `createContact` | `Omit<CreateContactParams, 'organizationId'>` | `AcqContact` |
|
|
325
|
+
| `upsertContact` | `Omit<UpsertContactParams, 'organizationId'>` | `AcqContact` |
|
|
326
|
+
| `updateContact` | `{ id } & UpdateContactParams` | `AcqContact` |
|
|
327
|
+
| `getContact` | `{ id }` | `AcqContact | null` |
|
|
328
|
+
| `getContactByEmail` | `{ email }` | `AcqContact | null` |
|
|
329
|
+
| `listContacts` | `{ filters?, pagination? }` | `PaginatedResult<AcqContact>` |
|
|
330
|
+
| `deleteContact` | `{ id }` | `void` |
|
|
331
|
+
| `bulkImportContacts` | `Omit<BulkImportParams, 'organizationId'>` | `BulkImportResult` |
|
|
332
|
+
| `bulkImportCompanies` | `Omit<BulkImportCompaniesParams, 'organizationId'>` | `BulkImportCompaniesResult` |
|
|
333
|
+
| `deactivateContactsByCompany` | `{ companyId }` | `{ deactivated: number }` |
|
|
330
334
|
|
|
331
335
|
**Deal operations:**
|
|
332
336
|
|
|
@@ -340,20 +344,34 @@ import { acqDb } from '@elevasis/sdk/worker'
|
|
|
340
344
|
|
|
341
345
|
**Deal-sync operations:**
|
|
342
346
|
|
|
343
|
-
| Method | Params
|
|
344
|
-
| ------------------------------- |
|
|
345
|
-
| `updateDiscoveryData` | `Omit<UpdateDiscoveryDataParams, 'organizationId'>`
|
|
346
|
-
| `updateProposalData` | `Omit<UpdateProposalDataParams, 'organizationId'>`
|
|
347
|
-
| `markProposalSent` | `Omit<MarkProposalSentParams, 'organizationId'>`
|
|
348
|
-
| `markProposalReviewed` | `Omit<MarkProposalReviewedParams, 'organizationId'>`
|
|
349
|
-
| `updateCloseLostReason` | `Omit<UpdateCloseLostReasonParams, 'organizationId'>`
|
|
350
|
-
| `updateFees` | `Omit<UpdateFeesParams, 'organizationId'>`
|
|
351
|
-
| `syncDealStage` | `Omit<SyncDealStageParams, 'organizationId'>`
|
|
352
|
-
| `setContactNurture` | `Omit<SetContactNurtureParams, 'organizationId'>`
|
|
353
|
-
| `cancelSchedulesAndHitlByEmail` | `Omit<..., 'organizationId'>`
|
|
354
|
-
| `cancelHitlByDealId` | `Omit<..., 'organizationId'>`
|
|
355
|
-
| `clearDealFields` | `Omit<ClearDealFieldsParams, 'organizationId'>`
|
|
356
|
-
| `deleteDeal` | `Omit<DeleteDealParams, 'organizationId'>`
|
|
347
|
+
| Method | Params | Returns |
|
|
348
|
+
| ------------------------------- | ----------------------------------------------------------- | ------------------------------------- |
|
|
349
|
+
| `updateDiscoveryData` | `Omit<UpdateDiscoveryDataParams, 'organizationId'>` | `void` |
|
|
350
|
+
| `updateProposalData` | `Omit<UpdateProposalDataParams, 'organizationId'>` | `void` |
|
|
351
|
+
| `markProposalSent` | `Omit<MarkProposalSentParams, 'organizationId'>` | `void` |
|
|
352
|
+
| `markProposalReviewed` | `Omit<MarkProposalReviewedParams, 'organizationId'>` | `void` |
|
|
353
|
+
| `updateCloseLostReason` | `Omit<UpdateCloseLostReasonParams, 'organizationId'>` | `void` |
|
|
354
|
+
| `updateFees` | `Omit<UpdateFeesParams, 'organizationId'>` | `void` |
|
|
355
|
+
| `syncDealStage` | `Omit<SyncDealStageParams, 'organizationId'>` | `void` |
|
|
356
|
+
| `setContactNurture` | `Omit<SetContactNurtureParams, 'organizationId'>` | `void` |
|
|
357
|
+
| `cancelSchedulesAndHitlByEmail` | `Omit<..., 'organizationId'>` | `{ schedulesCancelled, hitlDeleted }` |
|
|
358
|
+
| `cancelHitlByDealId` | `Omit<..., 'organizationId'>` | `{ hitlDeleted }` |
|
|
359
|
+
| `clearDealFields` | `Omit<ClearDealFieldsParams, 'organizationId'>` | `void` |
|
|
360
|
+
| `deleteDeal` | `Omit<DeleteDealParams, 'organizationId'>` | `void` |
|
|
361
|
+
| `recordReply` | `{ contactEmail, replyText, replySubject?, campaignName? }` | `void` |
|
|
362
|
+
| `recordDealActivity` | `{ attioDealId?, contactEmail?, type, ... }` | `void` |
|
|
363
|
+
|
|
364
|
+
**Enrichment operations:**
|
|
365
|
+
|
|
366
|
+
| Method | Params | Returns |
|
|
367
|
+
| --------------------- | -------------------------------------------------------- | ------- |
|
|
368
|
+
| `mergeEnrichmentData` | `{ id, table: 'acq_companies' | 'acq_contacts', data }` | `void` |
|
|
369
|
+
|
|
370
|
+
**Social monitoring operations:**
|
|
371
|
+
|
|
372
|
+
| Method | Params | Returns |
|
|
373
|
+
| ------------------- | --------------------------------------------------------------- | ------------------------- |
|
|
374
|
+
| `upsertSocialPosts` | `{ posts: Omit<UpsertSocialPostParams, 'organizationId'>[] }` | `UpsertSocialPostsResult` |
|
|
357
375
|
|
|
358
376
|
### Example
|
|
359
377
|
|
|
@@ -407,6 +425,45 @@ if (!result.success) {
|
|
|
407
425
|
|
|
408
426
|
---
|
|
409
427
|
|
|
428
|
+
## List Adapter
|
|
429
|
+
|
|
430
|
+
Singleton -- 4 methods for list-scoped lead-gen runtime operations. This is the focused companion to `acqDb` for list-oriented workflows.
|
|
431
|
+
|
|
432
|
+
```typescript
|
|
433
|
+
import { list } from '@elevasis/sdk/worker'
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
### Methods
|
|
437
|
+
|
|
438
|
+
| Method | Params | Returns |
|
|
439
|
+
| ------ | ------ | ------- |
|
|
440
|
+
| `getConfig` | `{ listId }` | `ListConfig` |
|
|
441
|
+
| `recordExecution` | `{ listId, executionId, payload? }` | `void` |
|
|
442
|
+
| `updateCompanyStage` | `{ listId, companyId, stage, metadata? }` | `void` |
|
|
443
|
+
| `updateContactStage` | `{ listId, contactId, stage, metadata? }` | `void` |
|
|
444
|
+
|
|
445
|
+
### Example
|
|
446
|
+
|
|
447
|
+
```typescript
|
|
448
|
+
const config = await list.getConfig({ listId })
|
|
449
|
+
|
|
450
|
+
await list.recordExecution({
|
|
451
|
+
listId,
|
|
452
|
+
executionId: context.executionId,
|
|
453
|
+
payload: { resourceId: context.resourceId, step: 'qualification' },
|
|
454
|
+
})
|
|
455
|
+
|
|
456
|
+
await list.updateCompanyStage({
|
|
457
|
+
listId,
|
|
458
|
+
companyId,
|
|
459
|
+
stage: 'qualified',
|
|
460
|
+
})
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
Use `list` when the workflow is explicitly operating on a list pipeline run. Use `acqDb` when you need broader list, company, contact, or deal CRUD.
|
|
464
|
+
|
|
465
|
+
---
|
|
466
|
+
|
|
410
467
|
## Email Adapter
|
|
411
468
|
|
|
412
469
|
Singleton -- 1 method for sending platform emails to organization members (from `notifications@elevasis.io`). For client-facing emails, use the Resend or Instantly integration adapters instead.
|
|
@@ -493,4 +550,4 @@ Retryable error codes: `rate_limit_exceeded`, `network_error`, `timeout_error`,
|
|
|
493
550
|
|
|
494
551
|
---
|
|
495
552
|
|
|
496
|
-
**Last Updated:** 2026-
|
|
553
|
+
**Last Updated:** 2026-04-15
|
|
@@ -352,4 +352,52 @@ The keys in `workflows` and `agents` are the resource identifiers used in CLI co
|
|
|
352
352
|
|
|
353
353
|
---
|
|
354
354
|
|
|
355
|
+
---
|
|
356
|
+
|
|
357
|
+
## Human-in-the-Loop UI Integration
|
|
358
|
+
|
|
359
|
+
The platform's HITL mechanism works in two parts: your workflow code creates an approval task, and a UI surfaces that task to a reviewer.
|
|
360
|
+
|
|
361
|
+
### Creating approval tasks
|
|
362
|
+
|
|
363
|
+
Call `approval.create()` from any workflow step to pause execution and emit a task to the Command Queue:
|
|
364
|
+
|
|
365
|
+
```typescript
|
|
366
|
+
import { approval } from '@elevasis/sdk/worker'
|
|
367
|
+
|
|
368
|
+
const task = await approval.create({
|
|
369
|
+
actions: [
|
|
370
|
+
{ id: 'approve', label: 'Approve', type: 'primary' },
|
|
371
|
+
{ id: 'reject', label: 'Reject', type: 'danger' },
|
|
372
|
+
],
|
|
373
|
+
context: { dealId, proposalUrl },
|
|
374
|
+
description: 'Review proposal before sending',
|
|
375
|
+
})
|
|
376
|
+
|
|
377
|
+
if (task.actionId === 'approve') {
|
|
378
|
+
// continue with approved path
|
|
379
|
+
}
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
The workflow step suspends at `approval.create()` and resumes only after a reviewer submits an action. See [Platform Adapters](../platform-tools/adapters-platform.mdx) for the full `approval.create()` reference.
|
|
383
|
+
|
|
384
|
+
### Built-in Command Center handling
|
|
385
|
+
|
|
386
|
+
The Command Queue page in the Command Center surfaces all pending approval tasks automatically. Reviewers can filter by resource, approve or reject with an optional comment, and view decision history. No custom UI code is required -- deploy your workflow and the queue populates as tasks arrive.
|
|
387
|
+
|
|
388
|
+
### Custom UI handling
|
|
389
|
+
|
|
390
|
+
`@elevasis/ui` exposes the following hooks for approval task operations, exported from `@elevasis/ui/hooks`:
|
|
391
|
+
|
|
392
|
+
- `useCommandQueue` -- fetches the list of pending tasks for the organization
|
|
393
|
+
- `useSubmitAction` -- POSTs an action decision to `/command-queue/{taskId}/action`
|
|
394
|
+
- `usePatchTask` -- updates task metadata
|
|
395
|
+
- `useDeleteTask` -- removes a task
|
|
396
|
+
|
|
397
|
+
Use these hooks to build a custom approval queue surface in your template UI. `useSubmitAction` accepts `taskId`, `actionId`, and optional `notes`, and optimistically marks the task as `processing` while the request is in flight.
|
|
398
|
+
|
|
399
|
+
For triggering executions from custom pages (the other side of the workflow interaction), see [UI Execution](../deployment/ui-execution.mdx).
|
|
400
|
+
|
|
401
|
+
---
|
|
402
|
+
|
|
355
403
|
**Last Updated:** 2026-02-25
|