exponential-sdk 1.0.0 → 1.0.1
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 +179 -0
- package/dist/index.d.ts +450 -1
- package/dist/index.js +69 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
# Exponential SDK
|
|
2
|
+
|
|
3
|
+
The official TypeScript SDK for [Exponential](https://exponential.im) — the AI-powered alignment layer where your goals, your team, and your AI stay in sync.
|
|
4
|
+
|
|
5
|
+
Build integrations that connect daily work to meaningful outcomes. Manage workspaces, projects, and actions programmatically.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install exponential-sdk
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { ExponentialClient, saveConfig, loadConfig } from "exponential-sdk";
|
|
17
|
+
|
|
18
|
+
// Persist your credentials
|
|
19
|
+
saveConfig({
|
|
20
|
+
apiUrl: "https://exponential.im",
|
|
21
|
+
token: "your-bearer-token",
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
// Initialize the client
|
|
25
|
+
const config = loadConfig();
|
|
26
|
+
const client = new ExponentialClient({
|
|
27
|
+
token: config.token,
|
|
28
|
+
apiUrl: config.apiUrl,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
// List your workspaces
|
|
32
|
+
const workspaces = await client.workspaces.list();
|
|
33
|
+
|
|
34
|
+
// Get today's actions
|
|
35
|
+
const today = await client.actions.getToday(workspaces[0].id);
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## API Reference
|
|
39
|
+
|
|
40
|
+
### `ExponentialClient`
|
|
41
|
+
|
|
42
|
+
Create a client with your API token:
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
const client = new ExponentialClient({
|
|
46
|
+
token: "your-bearer-token",
|
|
47
|
+
apiUrl: "https://exponential.im",
|
|
48
|
+
});
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
### Workspaces
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
const workspaces = await client.workspaces.list();
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Returns all workspaces you have access to.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
### Projects
|
|
64
|
+
|
|
65
|
+
```typescript
|
|
66
|
+
// List all projects
|
|
67
|
+
const projects = await client.projects.list();
|
|
68
|
+
|
|
69
|
+
// Filter by workspace
|
|
70
|
+
const projects = await client.projects.list({
|
|
71
|
+
workspaceId: "ws-123",
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
// Include nested actions
|
|
75
|
+
const projects = await client.projects.list({
|
|
76
|
+
workspaceId: "ws-123",
|
|
77
|
+
includeActions: true,
|
|
78
|
+
});
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
### Actions
|
|
84
|
+
|
|
85
|
+
Actions are the core work items in Exponential — tasks connected to outcomes that move the needle.
|
|
86
|
+
|
|
87
|
+
```typescript
|
|
88
|
+
// List active actions (excludes DONE & CANCELLED by default)
|
|
89
|
+
const actions = await client.actions.list();
|
|
90
|
+
|
|
91
|
+
// Filter by status, project, or assignee
|
|
92
|
+
const actions = await client.actions.list({
|
|
93
|
+
status: "IN_PROGRESS",
|
|
94
|
+
projectId: "proj-123",
|
|
95
|
+
assigneeId: "user-456",
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
// Get today's actions for a workspace
|
|
99
|
+
const today = await client.actions.getToday("ws-123");
|
|
100
|
+
|
|
101
|
+
// Get actions within a date range
|
|
102
|
+
const upcoming = await client.actions.getByDateRange(
|
|
103
|
+
new Date("2025-01-01"),
|
|
104
|
+
new Date("2025-01-31"),
|
|
105
|
+
"ws-123"
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
// Get actions by kanban status
|
|
109
|
+
const todo = await client.actions.getKanban({ status: "TODO" });
|
|
110
|
+
|
|
111
|
+
// Get all actions for a project
|
|
112
|
+
const projectActions = await client.actions.getProjectActions("proj-123");
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
#### Kanban Statuses
|
|
116
|
+
|
|
117
|
+
`BACKLOG` · `TODO` · `IN_PROGRESS` · `IN_REVIEW` · `DONE` · `CANCELLED`
|
|
118
|
+
|
|
119
|
+
#### Priorities
|
|
120
|
+
|
|
121
|
+
`Quick` · `Scheduled` · `1st Priority` · `2nd Priority` · `3rd Priority` · `4th Priority` · `5th Priority` · `Errand` · `Remember` · `Watch` · `Someday Maybe`
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
### Configuration
|
|
126
|
+
|
|
127
|
+
Credentials are stored persistently using the OS keychain via [`conf`](https://github.com/sindresorhus/conf).
|
|
128
|
+
|
|
129
|
+
```typescript
|
|
130
|
+
import {
|
|
131
|
+
saveConfig,
|
|
132
|
+
loadConfig,
|
|
133
|
+
clearConfig,
|
|
134
|
+
isAuthenticated,
|
|
135
|
+
getConfigPath,
|
|
136
|
+
} from "exponential-sdk";
|
|
137
|
+
|
|
138
|
+
saveConfig({
|
|
139
|
+
apiUrl: "https://exponential.im",
|
|
140
|
+
token: "your-bearer-token",
|
|
141
|
+
defaultWorkspaceId: "ws-123",
|
|
142
|
+
defaultWorkspaceSlug: "my-team",
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
if (isAuthenticated()) {
|
|
146
|
+
const config = loadConfig();
|
|
147
|
+
console.log(config.token);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// For multi-project setups, create isolated config stores
|
|
151
|
+
import { createConfigStore } from "exponential-sdk";
|
|
152
|
+
|
|
153
|
+
const store = createConfigStore({ projectName: "my-app" });
|
|
154
|
+
store.saveConfig({ apiUrl: "...", token: "..." });
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
### Error Handling
|
|
160
|
+
|
|
161
|
+
```typescript
|
|
162
|
+
import { isTRPCError } from "exponential-sdk";
|
|
163
|
+
|
|
164
|
+
try {
|
|
165
|
+
const actions = await client.actions.list();
|
|
166
|
+
} catch (error) {
|
|
167
|
+
if (isTRPCError(error)) {
|
|
168
|
+
console.error("API error:", error.message);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## Requirements
|
|
174
|
+
|
|
175
|
+
- Node.js >= 18.0.0
|
|
176
|
+
|
|
177
|
+
## License
|
|
178
|
+
|
|
179
|
+
MIT
|
package/dist/index.d.ts
CHANGED
|
@@ -23,6 +23,41 @@ type ProjectInput = {
|
|
|
23
23
|
};
|
|
24
24
|
workspaceId?: string;
|
|
25
25
|
};
|
|
26
|
+
type ActionStatus$1 = 'ACTIVE' | 'COMPLETED' | 'CANCELLED' | 'DELETED' | 'DRAFT';
|
|
27
|
+
type ActionKanbanStatus = 'BACKLOG' | 'TODO' | 'IN_PROGRESS' | 'IN_REVIEW' | 'DONE' | 'CANCELLED';
|
|
28
|
+
type ActionPriority = 'Quick' | 'Scheduled' | '1st Priority' | '2nd Priority' | '3rd Priority' | '4th Priority' | '5th Priority' | 'Errand' | 'Remember' | 'Watch' | 'Someday Maybe';
|
|
29
|
+
type ActionCreateInput$1 = {
|
|
30
|
+
name: string;
|
|
31
|
+
description?: string;
|
|
32
|
+
projectId?: string;
|
|
33
|
+
workspaceId?: string;
|
|
34
|
+
dueDate?: Date;
|
|
35
|
+
scheduledStart?: Date;
|
|
36
|
+
scheduledEnd?: Date;
|
|
37
|
+
duration?: number;
|
|
38
|
+
priority?: ActionPriority;
|
|
39
|
+
status?: ActionStatus$1;
|
|
40
|
+
epicId?: string;
|
|
41
|
+
effortEstimate?: number;
|
|
42
|
+
blockedByIds?: string[];
|
|
43
|
+
};
|
|
44
|
+
type ActionUpdateInput$1 = {
|
|
45
|
+
id: string;
|
|
46
|
+
name?: string;
|
|
47
|
+
description?: string;
|
|
48
|
+
projectId?: string;
|
|
49
|
+
workspaceId?: string | null;
|
|
50
|
+
dueDate?: Date | null;
|
|
51
|
+
scheduledStart?: Date | null;
|
|
52
|
+
scheduledEnd?: Date | null;
|
|
53
|
+
duration?: number | null;
|
|
54
|
+
priority?: ActionPriority;
|
|
55
|
+
status?: ActionStatus$1;
|
|
56
|
+
kanbanStatus?: ActionKanbanStatus;
|
|
57
|
+
epicId?: string | null;
|
|
58
|
+
effortEstimate?: number | null;
|
|
59
|
+
blockedByIds?: string[];
|
|
60
|
+
};
|
|
26
61
|
interface TrpcClient {
|
|
27
62
|
action: {
|
|
28
63
|
getAll: {
|
|
@@ -43,6 +78,12 @@ interface TrpcClient {
|
|
|
43
78
|
assigneeId?: string;
|
|
44
79
|
}) => Promise<unknown[]>;
|
|
45
80
|
};
|
|
81
|
+
create: {
|
|
82
|
+
mutate: (input: ActionCreateInput$1) => Promise<unknown>;
|
|
83
|
+
};
|
|
84
|
+
update: {
|
|
85
|
+
mutate: (input: ActionUpdateInput$1) => Promise<unknown>;
|
|
86
|
+
};
|
|
46
87
|
};
|
|
47
88
|
project: {
|
|
48
89
|
getAll: {
|
|
@@ -54,6 +95,138 @@ interface TrpcClient {
|
|
|
54
95
|
query: () => Promise<unknown[]>;
|
|
55
96
|
};
|
|
56
97
|
};
|
|
98
|
+
crmApi: {
|
|
99
|
+
contactList: {
|
|
100
|
+
query: (input: {
|
|
101
|
+
workspaceId: string;
|
|
102
|
+
search?: string;
|
|
103
|
+
tags?: string[];
|
|
104
|
+
organizationId?: string;
|
|
105
|
+
limit?: number;
|
|
106
|
+
cursor?: string;
|
|
107
|
+
}) => Promise<unknown>;
|
|
108
|
+
};
|
|
109
|
+
contactGet: {
|
|
110
|
+
query: (input: {
|
|
111
|
+
id: string;
|
|
112
|
+
includeInteractions?: boolean;
|
|
113
|
+
}) => Promise<unknown>;
|
|
114
|
+
};
|
|
115
|
+
contactCreate: {
|
|
116
|
+
mutate: (input: {
|
|
117
|
+
workspaceId: string;
|
|
118
|
+
firstName?: string;
|
|
119
|
+
lastName?: string;
|
|
120
|
+
email?: string | null;
|
|
121
|
+
phone?: string;
|
|
122
|
+
linkedIn?: string;
|
|
123
|
+
telegram?: string;
|
|
124
|
+
twitter?: string;
|
|
125
|
+
github?: string;
|
|
126
|
+
bluesky?: string;
|
|
127
|
+
about?: string;
|
|
128
|
+
profileType?: string;
|
|
129
|
+
skills?: string[];
|
|
130
|
+
tags?: string[];
|
|
131
|
+
organizationId?: string;
|
|
132
|
+
}) => Promise<unknown>;
|
|
133
|
+
};
|
|
134
|
+
contactUpdate: {
|
|
135
|
+
mutate: (input: {
|
|
136
|
+
id: string;
|
|
137
|
+
firstName?: string;
|
|
138
|
+
lastName?: string;
|
|
139
|
+
email?: string | null;
|
|
140
|
+
phone?: string | null;
|
|
141
|
+
linkedIn?: string | null;
|
|
142
|
+
telegram?: string | null;
|
|
143
|
+
twitter?: string | null;
|
|
144
|
+
github?: string | null;
|
|
145
|
+
bluesky?: string | null;
|
|
146
|
+
about?: string;
|
|
147
|
+
profileType?: string;
|
|
148
|
+
skills?: string[];
|
|
149
|
+
tags?: string[];
|
|
150
|
+
organizationId?: string | null;
|
|
151
|
+
}) => Promise<unknown>;
|
|
152
|
+
};
|
|
153
|
+
contactDelete: {
|
|
154
|
+
mutate: (input: {
|
|
155
|
+
id: string;
|
|
156
|
+
}) => Promise<unknown>;
|
|
157
|
+
};
|
|
158
|
+
contactAddInteraction: {
|
|
159
|
+
mutate: (input: {
|
|
160
|
+
contactId: string;
|
|
161
|
+
type: string;
|
|
162
|
+
direction: string;
|
|
163
|
+
subject?: string;
|
|
164
|
+
notes?: string;
|
|
165
|
+
metadata?: unknown;
|
|
166
|
+
}) => Promise<unknown>;
|
|
167
|
+
};
|
|
168
|
+
pipelineGet: {
|
|
169
|
+
query: (input: {
|
|
170
|
+
workspaceId: string;
|
|
171
|
+
}) => Promise<unknown>;
|
|
172
|
+
};
|
|
173
|
+
pipelineGetStages: {
|
|
174
|
+
query: (input: {
|
|
175
|
+
workspaceId: string;
|
|
176
|
+
}) => Promise<unknown[]>;
|
|
177
|
+
};
|
|
178
|
+
dealList: {
|
|
179
|
+
query: (input: {
|
|
180
|
+
workspaceId: string;
|
|
181
|
+
}) => Promise<unknown[]>;
|
|
182
|
+
};
|
|
183
|
+
dealGet: {
|
|
184
|
+
query: (input: {
|
|
185
|
+
id: string;
|
|
186
|
+
}) => Promise<unknown>;
|
|
187
|
+
};
|
|
188
|
+
dealCreate: {
|
|
189
|
+
mutate: (input: {
|
|
190
|
+
workspaceId: string;
|
|
191
|
+
stageId: string;
|
|
192
|
+
title: string;
|
|
193
|
+
description?: string;
|
|
194
|
+
value?: number;
|
|
195
|
+
currency?: string;
|
|
196
|
+
probability?: number;
|
|
197
|
+
expectedCloseDate?: Date;
|
|
198
|
+
contactId?: string;
|
|
199
|
+
organizationId?: string;
|
|
200
|
+
assignedToId?: string;
|
|
201
|
+
}) => Promise<unknown>;
|
|
202
|
+
};
|
|
203
|
+
dealUpdate: {
|
|
204
|
+
mutate: (input: {
|
|
205
|
+
id: string;
|
|
206
|
+
title?: string;
|
|
207
|
+
description?: string | null;
|
|
208
|
+
value?: number | null;
|
|
209
|
+
currency?: string;
|
|
210
|
+
probability?: number | null;
|
|
211
|
+
expectedCloseDate?: Date | null;
|
|
212
|
+
contactId?: string | null;
|
|
213
|
+
organizationId?: string | null;
|
|
214
|
+
assignedToId?: string | null;
|
|
215
|
+
}) => Promise<unknown>;
|
|
216
|
+
};
|
|
217
|
+
dealMove: {
|
|
218
|
+
mutate: (input: {
|
|
219
|
+
id: string;
|
|
220
|
+
stageId: string;
|
|
221
|
+
stageOrder: number;
|
|
222
|
+
}) => Promise<unknown>;
|
|
223
|
+
};
|
|
224
|
+
dealDelete: {
|
|
225
|
+
mutate: (input: {
|
|
226
|
+
id: string;
|
|
227
|
+
}) => Promise<unknown>;
|
|
228
|
+
};
|
|
229
|
+
};
|
|
57
230
|
}
|
|
58
231
|
declare function isTRPCError(error: unknown): error is TRPCClientError<any>;
|
|
59
232
|
|
|
@@ -142,6 +315,39 @@ interface ActionsKanbanOptions {
|
|
|
142
315
|
status?: KanbanStatus;
|
|
143
316
|
assigneeId?: string;
|
|
144
317
|
}
|
|
318
|
+
type ActionStatus = 'ACTIVE' | 'COMPLETED' | 'CANCELLED' | 'DELETED' | 'DRAFT';
|
|
319
|
+
interface ActionCreateInput {
|
|
320
|
+
name: string;
|
|
321
|
+
description?: string;
|
|
322
|
+
projectId?: string;
|
|
323
|
+
workspaceId?: string;
|
|
324
|
+
dueDate?: Date;
|
|
325
|
+
scheduledStart?: Date;
|
|
326
|
+
scheduledEnd?: Date;
|
|
327
|
+
duration?: number;
|
|
328
|
+
priority?: Priority;
|
|
329
|
+
status?: ActionStatus;
|
|
330
|
+
epicId?: string;
|
|
331
|
+
effortEstimate?: number;
|
|
332
|
+
blockedByIds?: string[];
|
|
333
|
+
}
|
|
334
|
+
interface ActionUpdateInput {
|
|
335
|
+
id: string;
|
|
336
|
+
name?: string;
|
|
337
|
+
description?: string;
|
|
338
|
+
projectId?: string;
|
|
339
|
+
workspaceId?: string | null;
|
|
340
|
+
dueDate?: Date | null;
|
|
341
|
+
scheduledStart?: Date | null;
|
|
342
|
+
scheduledEnd?: Date | null;
|
|
343
|
+
duration?: number | null;
|
|
344
|
+
priority?: Priority;
|
|
345
|
+
status?: ActionStatus;
|
|
346
|
+
kanbanStatus?: KanbanStatus;
|
|
347
|
+
epicId?: string | null;
|
|
348
|
+
effortEstimate?: number | null;
|
|
349
|
+
blockedByIds?: string[];
|
|
350
|
+
}
|
|
145
351
|
declare class ActionsApi {
|
|
146
352
|
private client;
|
|
147
353
|
constructor(client: TrpcClient);
|
|
@@ -150,6 +356,8 @@ declare class ActionsApi {
|
|
|
150
356
|
getByDateRange(start: Date, end: Date, workspaceId?: string): Promise<Action[]>;
|
|
151
357
|
getKanban(options?: ActionsKanbanOptions): Promise<Action[]>;
|
|
152
358
|
getProjectActions(projectId: string, assigneeId?: string): Promise<Action[]>;
|
|
359
|
+
create(input: ActionCreateInput): Promise<Action>;
|
|
360
|
+
update(input: ActionUpdateInput): Promise<Action>;
|
|
153
361
|
}
|
|
154
362
|
|
|
155
363
|
interface Project {
|
|
@@ -219,6 +427,245 @@ declare class WorkspacesApi {
|
|
|
219
427
|
list(): Promise<Workspace[]>;
|
|
220
428
|
}
|
|
221
429
|
|
|
430
|
+
type InteractionType = 'EMAIL' | 'TELEGRAM' | 'PHONE_CALL' | 'MEETING' | 'NOTE' | 'LINKEDIN' | 'OTHER';
|
|
431
|
+
type InteractionDirection = 'INBOUND' | 'OUTBOUND';
|
|
432
|
+
interface Contact {
|
|
433
|
+
id: string;
|
|
434
|
+
workspaceId: string;
|
|
435
|
+
firstName: string | null;
|
|
436
|
+
lastName: string | null;
|
|
437
|
+
email: string | null;
|
|
438
|
+
phone: string | null;
|
|
439
|
+
linkedIn: string | null;
|
|
440
|
+
telegram: string | null;
|
|
441
|
+
twitter: string | null;
|
|
442
|
+
github: string | null;
|
|
443
|
+
bluesky: string | null;
|
|
444
|
+
about: string | null;
|
|
445
|
+
profileType: string | null;
|
|
446
|
+
skills: string[];
|
|
447
|
+
tags: string[];
|
|
448
|
+
organizationId: string | null;
|
|
449
|
+
connectionScore: number | null;
|
|
450
|
+
lastInteractionAt: Date | null;
|
|
451
|
+
lastInteractionType: string | null;
|
|
452
|
+
importSource: string | null;
|
|
453
|
+
createdAt: Date;
|
|
454
|
+
updatedAt: Date;
|
|
455
|
+
organization?: {
|
|
456
|
+
id: string;
|
|
457
|
+
name: string;
|
|
458
|
+
workspaceId: string;
|
|
459
|
+
websiteUrl: string | null;
|
|
460
|
+
logoUrl: string | null;
|
|
461
|
+
description: string | null;
|
|
462
|
+
industry: string | null;
|
|
463
|
+
size: string | null;
|
|
464
|
+
} | null;
|
|
465
|
+
createdBy?: {
|
|
466
|
+
id: string;
|
|
467
|
+
name: string | null;
|
|
468
|
+
email: string | null;
|
|
469
|
+
image: string | null;
|
|
470
|
+
} | null;
|
|
471
|
+
}
|
|
472
|
+
interface ContactInteraction {
|
|
473
|
+
id: string;
|
|
474
|
+
contactId: string;
|
|
475
|
+
workspaceId: string;
|
|
476
|
+
userId: string | null;
|
|
477
|
+
type: string;
|
|
478
|
+
direction: string;
|
|
479
|
+
subject: string | null;
|
|
480
|
+
notes: string | null;
|
|
481
|
+
metadata: unknown;
|
|
482
|
+
occurredAt: Date;
|
|
483
|
+
createdAt: Date;
|
|
484
|
+
}
|
|
485
|
+
interface ContactListOutput {
|
|
486
|
+
contacts: Contact[];
|
|
487
|
+
nextCursor?: string;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
interface ContactsListOptions {
|
|
491
|
+
workspaceId: string;
|
|
492
|
+
search?: string;
|
|
493
|
+
tags?: string[];
|
|
494
|
+
organizationId?: string;
|
|
495
|
+
limit?: number;
|
|
496
|
+
cursor?: string;
|
|
497
|
+
}
|
|
498
|
+
interface ContactCreateInput {
|
|
499
|
+
workspaceId: string;
|
|
500
|
+
firstName?: string;
|
|
501
|
+
lastName?: string;
|
|
502
|
+
email?: string | null;
|
|
503
|
+
phone?: string;
|
|
504
|
+
linkedIn?: string;
|
|
505
|
+
telegram?: string;
|
|
506
|
+
twitter?: string;
|
|
507
|
+
github?: string;
|
|
508
|
+
bluesky?: string;
|
|
509
|
+
about?: string;
|
|
510
|
+
profileType?: string;
|
|
511
|
+
skills?: string[];
|
|
512
|
+
tags?: string[];
|
|
513
|
+
organizationId?: string;
|
|
514
|
+
}
|
|
515
|
+
interface ContactUpdateInput {
|
|
516
|
+
id: string;
|
|
517
|
+
firstName?: string;
|
|
518
|
+
lastName?: string;
|
|
519
|
+
email?: string | null;
|
|
520
|
+
phone?: string | null;
|
|
521
|
+
linkedIn?: string | null;
|
|
522
|
+
telegram?: string | null;
|
|
523
|
+
twitter?: string | null;
|
|
524
|
+
github?: string | null;
|
|
525
|
+
bluesky?: string | null;
|
|
526
|
+
about?: string;
|
|
527
|
+
profileType?: string;
|
|
528
|
+
skills?: string[];
|
|
529
|
+
tags?: string[];
|
|
530
|
+
organizationId?: string | null;
|
|
531
|
+
}
|
|
532
|
+
interface AddInteractionInput {
|
|
533
|
+
contactId: string;
|
|
534
|
+
type: InteractionType;
|
|
535
|
+
direction: InteractionDirection;
|
|
536
|
+
subject?: string;
|
|
537
|
+
notes?: string;
|
|
538
|
+
metadata?: Record<string, unknown>;
|
|
539
|
+
}
|
|
540
|
+
declare class ContactsApi {
|
|
541
|
+
private client;
|
|
542
|
+
constructor(client: TrpcClient);
|
|
543
|
+
list(options: ContactsListOptions): Promise<ContactListOutput>;
|
|
544
|
+
get(id: string, options?: {
|
|
545
|
+
includeInteractions?: boolean;
|
|
546
|
+
}): Promise<Contact>;
|
|
547
|
+
create(input: ContactCreateInput): Promise<Contact>;
|
|
548
|
+
update(input: ContactUpdateInput): Promise<Contact>;
|
|
549
|
+
delete(id: string): Promise<void>;
|
|
550
|
+
addInteraction(input: AddInteractionInput): Promise<ContactInteraction>;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
interface PipelineStage {
|
|
554
|
+
id: string;
|
|
555
|
+
projectId: string;
|
|
556
|
+
name: string;
|
|
557
|
+
color: string;
|
|
558
|
+
order: number;
|
|
559
|
+
type: string;
|
|
560
|
+
createdAt: Date;
|
|
561
|
+
updatedAt: Date;
|
|
562
|
+
_count?: {
|
|
563
|
+
deals: number;
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
interface Pipeline {
|
|
567
|
+
id: string;
|
|
568
|
+
name: string;
|
|
569
|
+
workspaceId: string | null;
|
|
570
|
+
status: string | null;
|
|
571
|
+
pipelineStages: PipelineStage[];
|
|
572
|
+
}
|
|
573
|
+
interface Deal {
|
|
574
|
+
id: string;
|
|
575
|
+
projectId: string;
|
|
576
|
+
stageId: string;
|
|
577
|
+
title: string;
|
|
578
|
+
description: string | null;
|
|
579
|
+
value: number | null;
|
|
580
|
+
currency: string;
|
|
581
|
+
probability: number | null;
|
|
582
|
+
expectedCloseDate: Date | null;
|
|
583
|
+
closedAt: Date | null;
|
|
584
|
+
stageOrder: number;
|
|
585
|
+
contactId: string | null;
|
|
586
|
+
organizationId: string | null;
|
|
587
|
+
workspaceId: string;
|
|
588
|
+
createdById: string;
|
|
589
|
+
assignedToId: string | null;
|
|
590
|
+
createdAt: Date;
|
|
591
|
+
updatedAt: Date;
|
|
592
|
+
stage?: PipelineStage;
|
|
593
|
+
contact?: {
|
|
594
|
+
id: string;
|
|
595
|
+
firstName: string | null;
|
|
596
|
+
lastName: string | null;
|
|
597
|
+
organizationId?: string | null;
|
|
598
|
+
} | null;
|
|
599
|
+
organization?: {
|
|
600
|
+
id: string;
|
|
601
|
+
name: string;
|
|
602
|
+
} | null;
|
|
603
|
+
assignedTo?: {
|
|
604
|
+
id: string;
|
|
605
|
+
name: string | null;
|
|
606
|
+
image: string | null;
|
|
607
|
+
email?: string | null;
|
|
608
|
+
} | null;
|
|
609
|
+
activities?: DealActivity[];
|
|
610
|
+
}
|
|
611
|
+
interface DealActivity {
|
|
612
|
+
id: string;
|
|
613
|
+
dealId: string;
|
|
614
|
+
userId: string | null;
|
|
615
|
+
type: string;
|
|
616
|
+
content: string | null;
|
|
617
|
+
metadata: unknown;
|
|
618
|
+
createdAt: Date;
|
|
619
|
+
user?: {
|
|
620
|
+
id: string;
|
|
621
|
+
name: string | null;
|
|
622
|
+
image: string | null;
|
|
623
|
+
} | null;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
interface DealCreateInput {
|
|
627
|
+
workspaceId: string;
|
|
628
|
+
stageId: string;
|
|
629
|
+
title: string;
|
|
630
|
+
description?: string;
|
|
631
|
+
value?: number;
|
|
632
|
+
currency?: string;
|
|
633
|
+
probability?: number;
|
|
634
|
+
expectedCloseDate?: Date;
|
|
635
|
+
contactId?: string;
|
|
636
|
+
organizationId?: string;
|
|
637
|
+
assignedToId?: string;
|
|
638
|
+
}
|
|
639
|
+
interface DealUpdateInput {
|
|
640
|
+
id: string;
|
|
641
|
+
title?: string;
|
|
642
|
+
description?: string | null;
|
|
643
|
+
value?: number | null;
|
|
644
|
+
currency?: string;
|
|
645
|
+
probability?: number | null;
|
|
646
|
+
expectedCloseDate?: Date | null;
|
|
647
|
+
contactId?: string | null;
|
|
648
|
+
organizationId?: string | null;
|
|
649
|
+
assignedToId?: string | null;
|
|
650
|
+
}
|
|
651
|
+
interface DealMoveInput {
|
|
652
|
+
id: string;
|
|
653
|
+
stageId: string;
|
|
654
|
+
stageOrder: number;
|
|
655
|
+
}
|
|
656
|
+
declare class PipelinesApi {
|
|
657
|
+
private client;
|
|
658
|
+
constructor(client: TrpcClient);
|
|
659
|
+
get(workspaceId: string): Promise<Pipeline | null>;
|
|
660
|
+
getStages(workspaceId: string): Promise<PipelineStage[]>;
|
|
661
|
+
listDeals(workspaceId: string): Promise<Deal[]>;
|
|
662
|
+
getDeal(id: string): Promise<Deal>;
|
|
663
|
+
createDeal(input: DealCreateInput): Promise<Deal>;
|
|
664
|
+
updateDeal(input: DealUpdateInput): Promise<Deal>;
|
|
665
|
+
moveDeal(input: DealMoveInput): Promise<Deal>;
|
|
666
|
+
deleteDeal(id: string): Promise<void>;
|
|
667
|
+
}
|
|
668
|
+
|
|
222
669
|
interface ExponentialConfig {
|
|
223
670
|
apiUrl: string;
|
|
224
671
|
token: string;
|
|
@@ -247,10 +694,12 @@ declare class ExponentialClient {
|
|
|
247
694
|
actions: ActionsApi;
|
|
248
695
|
projects: ProjectsApi;
|
|
249
696
|
workspaces: WorkspacesApi;
|
|
697
|
+
contacts: ContactsApi;
|
|
698
|
+
pipelines: PipelinesApi;
|
|
250
699
|
constructor(config: {
|
|
251
700
|
token: string;
|
|
252
701
|
apiUrl: string;
|
|
253
702
|
});
|
|
254
703
|
}
|
|
255
704
|
|
|
256
|
-
export { type Action, type ActionOutput, type ActionsListOutput, ExponentialClient, type ExponentialConfig, type KanbanStatus, type Priority, type Project, type ProjectOutput, type ProjectsListOutput, type Workspace, type WorkspaceOutput, type WorkspacesListOutput, clearConfig, createConfigStore, getConfigPath, isAuthenticated, isTRPCError, loadConfig, saveConfig };
|
|
705
|
+
export { type Action, type ActionCreateInput, type ActionOutput, type ActionStatus, type ActionUpdateInput, type ActionsListOutput, type AddInteractionInput, type Contact, type ContactCreateInput, type ContactInteraction, type ContactListOutput, type ContactUpdateInput, type ContactsListOptions, type Deal, type DealActivity, type DealCreateInput, type DealMoveInput, type DealUpdateInput, ExponentialClient, type ExponentialConfig, type InteractionDirection, type InteractionType, type KanbanStatus, type Pipeline, type PipelineStage, type Priority, type Project, type ProjectOutput, type ProjectsListOutput, type Workspace, type WorkspaceOutput, type WorkspacesListOutput, clearConfig, createConfigStore, getConfigPath, isAuthenticated, isTRPCError, loadConfig, saveConfig };
|
package/dist/index.js
CHANGED
|
@@ -77,6 +77,12 @@ var ActionsApi = class {
|
|
|
77
77
|
assigneeId
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
|
+
async create(input) {
|
|
81
|
+
return await this.client.action.create.mutate(input);
|
|
82
|
+
}
|
|
83
|
+
async update(input) {
|
|
84
|
+
return await this.client.action.update.mutate(input);
|
|
85
|
+
}
|
|
80
86
|
};
|
|
81
87
|
|
|
82
88
|
// src/projects.ts
|
|
@@ -103,6 +109,65 @@ var WorkspacesApi = class {
|
|
|
103
109
|
}
|
|
104
110
|
};
|
|
105
111
|
|
|
112
|
+
// src/contacts.ts
|
|
113
|
+
var ContactsApi = class {
|
|
114
|
+
constructor(client) {
|
|
115
|
+
this.client = client;
|
|
116
|
+
}
|
|
117
|
+
async list(options) {
|
|
118
|
+
return await this.client.crmApi.contactList.query(options);
|
|
119
|
+
}
|
|
120
|
+
async get(id, options) {
|
|
121
|
+
return await this.client.crmApi.contactGet.query({
|
|
122
|
+
id,
|
|
123
|
+
includeInteractions: options?.includeInteractions
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
async create(input) {
|
|
127
|
+
return await this.client.crmApi.contactCreate.mutate(input);
|
|
128
|
+
}
|
|
129
|
+
async update(input) {
|
|
130
|
+
return await this.client.crmApi.contactUpdate.mutate(input);
|
|
131
|
+
}
|
|
132
|
+
async delete(id) {
|
|
133
|
+
await this.client.crmApi.contactDelete.mutate({ id });
|
|
134
|
+
}
|
|
135
|
+
async addInteraction(input) {
|
|
136
|
+
return await this.client.crmApi.contactAddInteraction.mutate(input);
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
// src/pipelines.ts
|
|
141
|
+
var PipelinesApi = class {
|
|
142
|
+
constructor(client) {
|
|
143
|
+
this.client = client;
|
|
144
|
+
}
|
|
145
|
+
async get(workspaceId) {
|
|
146
|
+
return await this.client.crmApi.pipelineGet.query({ workspaceId });
|
|
147
|
+
}
|
|
148
|
+
async getStages(workspaceId) {
|
|
149
|
+
return await this.client.crmApi.pipelineGetStages.query({ workspaceId });
|
|
150
|
+
}
|
|
151
|
+
async listDeals(workspaceId) {
|
|
152
|
+
return await this.client.crmApi.dealList.query({ workspaceId });
|
|
153
|
+
}
|
|
154
|
+
async getDeal(id) {
|
|
155
|
+
return await this.client.crmApi.dealGet.query({ id });
|
|
156
|
+
}
|
|
157
|
+
async createDeal(input) {
|
|
158
|
+
return await this.client.crmApi.dealCreate.mutate(input);
|
|
159
|
+
}
|
|
160
|
+
async updateDeal(input) {
|
|
161
|
+
return await this.client.crmApi.dealUpdate.mutate(input);
|
|
162
|
+
}
|
|
163
|
+
async moveDeal(input) {
|
|
164
|
+
return await this.client.crmApi.dealMove.mutate(input);
|
|
165
|
+
}
|
|
166
|
+
async deleteDeal(id) {
|
|
167
|
+
await this.client.crmApi.dealDelete.mutate({ id });
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
|
|
106
171
|
// src/config.ts
|
|
107
172
|
import Conf from "conf";
|
|
108
173
|
var schema = {
|
|
@@ -188,11 +253,15 @@ var ExponentialClient = class {
|
|
|
188
253
|
this.actions = new ActionsApi(this.client);
|
|
189
254
|
this.projects = new ProjectsApi(this.client);
|
|
190
255
|
this.workspaces = new WorkspacesApi(this.client);
|
|
256
|
+
this.contacts = new ContactsApi(this.client);
|
|
257
|
+
this.pipelines = new PipelinesApi(this.client);
|
|
191
258
|
}
|
|
192
259
|
client;
|
|
193
260
|
actions;
|
|
194
261
|
projects;
|
|
195
262
|
workspaces;
|
|
263
|
+
contacts;
|
|
264
|
+
pipelines;
|
|
196
265
|
};
|
|
197
266
|
export {
|
|
198
267
|
ExponentialClient,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/client.ts","../src/actions.ts","../src/projects.ts","../src/workspaces.ts","../src/config.ts","../src/index.ts"],"sourcesContent":["import { createTRPCClient, httpBatchLink, TRPCClientError } from '@trpc/client';\nimport superjson from 'superjson';\n\ntype ActionInput = {\n assigneeId?: string;\n};\n\ntype KanbanInput = {\n projectId?: string;\n assigneeId?: string;\n kanbanStatus?: 'BACKLOG' | 'TODO' | 'IN_PROGRESS' | 'IN_REVIEW' | 'DONE' | 'CANCELLED';\n};\n\ntype TodayInput = {\n workspaceId?: string;\n};\n\ntype DateRangeInput = {\n startDate: Date;\n endDate: Date;\n workspaceId?: string;\n};\n\ntype ProjectInput = {\n include?: {\n actions?: boolean;\n };\n workspaceId?: string;\n};\n\nexport interface TrpcClient {\n action: {\n getAll: { query: (input?: ActionInput) => Promise<unknown[]> };\n getKanbanActions: { query: (input?: KanbanInput) => Promise<unknown[]> };\n getToday: { query: (input?: TodayInput) => Promise<unknown[]> };\n getByDateRange: { query: (input: DateRangeInput) => Promise<unknown[]> };\n getProjectActions: { query: (input: { projectId: string; assigneeId?: string }) => Promise<unknown[]> };\n };\n project: {\n getAll: { query: (input?: ProjectInput) => Promise<unknown[]> };\n };\n workspace: {\n list: { query: () => Promise<unknown[]> };\n };\n}\n\nexport function createClient(config: { token: string; apiUrl: string }): TrpcClient {\n const apiUrl = config.apiUrl.replace(/\\/+$/, '');\n\n return createTRPCClient<any>({\n links: [\n httpBatchLink({\n url: `${apiUrl}/api/trpc`,\n headers() {\n return {\n Authorization: `Bearer ${config.token}`,\n };\n },\n transformer: superjson,\n }),\n ],\n }) as unknown as TrpcClient;\n}\n\nexport function isTRPCError(error: unknown): error is TRPCClientError<any> {\n return error instanceof TRPCClientError;\n}\n\nexport { TRPCClientError };\n","import type { TrpcClient } from './client.js';\nimport type { Action, KanbanStatus } from './types/action.js';\n\nexport interface ActionsListOptions {\n projectId?: string;\n status?: KanbanStatus;\n assigneeId?: string;\n}\n\nexport interface ActionsKanbanOptions {\n projectId?: string;\n status?: KanbanStatus;\n assigneeId?: string;\n}\n\nexport class ActionsApi {\n constructor(private client: TrpcClient) {}\n\n async list(options: ActionsListOptions = {}): Promise<Action[]> {\n const { projectId, status, assigneeId } = options;\n let actions: Action[];\n\n if (projectId) {\n actions = await this.client.action.getProjectActions.query({\n projectId,\n assigneeId,\n }) as Action[];\n } else if (status) {\n actions = await this.client.action.getKanbanActions.query({\n kanbanStatus: status,\n assigneeId,\n }) as Action[];\n } else {\n actions = await this.client.action.getAll.query({\n assigneeId,\n }) as Action[];\n }\n\n // Match CLI behavior: hide completed/cancelled unless status specified\n if (!status) {\n actions = actions.filter(action =>\n action.status !== 'COMPLETED' &&\n action.status !== 'CANCELLED' &&\n action.kanbanStatus !== 'DONE' &&\n action.kanbanStatus !== 'CANCELLED'\n );\n }\n\n return actions;\n }\n\n async getToday(workspaceId?: string): Promise<Action[]> {\n return await this.client.action.getToday.query({\n workspaceId,\n }) as Action[];\n }\n\n async getByDateRange(start: Date, end: Date, workspaceId?: string): Promise<Action[]> {\n return await this.client.action.getByDateRange.query({\n startDate: start,\n endDate: end,\n workspaceId,\n }) as Action[];\n }\n\n async getKanban(options: ActionsKanbanOptions = {}): Promise<Action[]> {\n const { projectId, status, assigneeId } = options;\n\n return await this.client.action.getKanbanActions.query({\n projectId,\n kanbanStatus: status,\n assigneeId,\n }) as Action[];\n }\n\n async getProjectActions(projectId: string, assigneeId?: string): Promise<Action[]> {\n return await this.client.action.getProjectActions.query({\n projectId,\n assigneeId,\n }) as Action[];\n }\n}\n","import type { TrpcClient } from './client.js';\nimport type { Project } from './types/project.js';\n\nexport interface ProjectsListOptions {\n workspaceId?: string;\n includeActions?: boolean;\n}\n\nexport class ProjectsApi {\n constructor(private client: TrpcClient) {}\n\n async list(options: ProjectsListOptions = {}): Promise<Project[]> {\n const { workspaceId, includeActions } = options;\n\n return await this.client.project.getAll.query({\n workspaceId,\n include: includeActions ? { actions: true } : undefined,\n }) as Project[];\n }\n}\n","import type { TrpcClient } from './client.js';\nimport type { Workspace } from './types/workspace.js';\n\nexport class WorkspacesApi {\n constructor(private client: TrpcClient) {}\n\n async list(): Promise<Workspace[]> {\n return await this.client.workspace.list.query() as Workspace[];\n }\n}\n","import Conf from 'conf';\n\nexport interface ExponentialConfig {\n apiUrl: string;\n token: string;\n tokenExpiry?: string;\n defaultWorkspaceId?: string;\n defaultWorkspaceSlug?: string;\n}\n\nconst schema = {\n apiUrl: {\n type: 'string' as const,\n default: '',\n },\n token: {\n type: 'string' as const,\n default: '',\n },\n tokenExpiry: {\n type: 'string' as const,\n default: '',\n },\n defaultWorkspaceId: {\n type: 'string' as const,\n default: '',\n },\n defaultWorkspaceSlug: {\n type: 'string' as const,\n default: '',\n },\n};\n\nfunction createStore(projectName: string) {\n return new Conf<ExponentialConfig>({\n projectName,\n schema,\n });\n}\n\nfunction readConfig(store: Conf<ExponentialConfig>): ExponentialConfig {\n return {\n apiUrl: store.get('apiUrl'),\n token: store.get('token'),\n tokenExpiry: store.get('tokenExpiry'),\n defaultWorkspaceId: store.get('defaultWorkspaceId'),\n defaultWorkspaceSlug: store.get('defaultWorkspaceSlug'),\n };\n}\n\nfunction writeConfig(store: Conf<ExponentialConfig>, values: Partial<ExponentialConfig>): void {\n if (values.apiUrl !== undefined) store.set('apiUrl', values.apiUrl);\n if (values.token !== undefined) store.set('token', values.token);\n if (values.tokenExpiry !== undefined) store.set('tokenExpiry', values.tokenExpiry);\n if (values.defaultWorkspaceId !== undefined) store.set('defaultWorkspaceId', values.defaultWorkspaceId);\n if (values.defaultWorkspaceSlug !== undefined) store.set('defaultWorkspaceSlug', values.defaultWorkspaceSlug);\n}\n\nconst defaultStore = createStore('exponential-sdk');\n\nexport function createConfigStore(options?: { projectName?: string }) {\n const store = createStore(options?.projectName ?? 'exponential-sdk');\n\n return {\n loadConfig: () => readConfig(store),\n saveConfig: (values: Partial<ExponentialConfig>) => writeConfig(store, values),\n clearConfig: () => store.clear(),\n isAuthenticated: () => {\n const cfg = readConfig(store);\n return Boolean(cfg.token && cfg.apiUrl);\n },\n getConfigPath: () => store.path,\n };\n}\n\nexport function loadConfig(): ExponentialConfig {\n return readConfig(defaultStore);\n}\n\nexport function saveConfig(values: Partial<ExponentialConfig>): void {\n writeConfig(defaultStore, values);\n}\n\nexport function clearConfig(): void {\n defaultStore.clear();\n}\n\nexport function isAuthenticated(): boolean {\n const cfg = readConfig(defaultStore);\n return Boolean(cfg.token && cfg.apiUrl);\n}\n\nexport function getConfigPath(): string {\n return defaultStore.path;\n}\n","import { createClient, isTRPCError, TRPCClientError, type TrpcClient } from './client.js';\nimport { ActionsApi } from './actions.js';\nimport { ProjectsApi } from './projects.js';\nimport { WorkspacesApi } from './workspaces.js';\n\nexport class ExponentialClient {\n private client: TrpcClient;\n actions: ActionsApi;\n projects: ProjectsApi;\n workspaces: WorkspacesApi;\n\n constructor(private config: { token: string; apiUrl: string }) {\n this.client = createClient(this.config);\n this.actions = new ActionsApi(this.client);\n this.projects = new ProjectsApi(this.client);\n this.workspaces = new WorkspacesApi(this.client);\n }\n}\n\nexport {\n createConfigStore,\n loadConfig,\n saveConfig,\n clearConfig,\n isAuthenticated,\n getConfigPath,\n} from './config.js';\n\nexport type { ExponentialConfig } from './config.js';\nexport type {\n Action,\n ActionOutput,\n ActionsListOutput,\n KanbanStatus,\n Priority,\n} from './types/action.js';\nexport type { Project, ProjectOutput, ProjectsListOutput } from './types/project.js';\nexport type { Workspace, WorkspaceOutput, WorkspacesListOutput } from './types/workspace.js';\nexport { isTRPCError, TRPCClientError };\n"],"mappings":";AAAA,SAAS,kBAAkB,eAAe,uBAAuB;AACjE,OAAO,eAAe;AA6Cf,SAAS,aAAa,QAAuD;AAClF,QAAM,SAAS,OAAO,OAAO,QAAQ,QAAQ,EAAE;AAE/C,SAAO,iBAAsB;AAAA,IAC3B,OAAO;AAAA,MACL,cAAc;AAAA,QACZ,KAAK,GAAG,MAAM;AAAA,QACd,UAAU;AACR,iBAAO;AAAA,YACL,eAAe,UAAU,OAAO,KAAK;AAAA,UACvC;AAAA,QACF;AAAA,QACA,aAAa;AAAA,MACf,CAAC;AAAA,IACH;AAAA,EACF,CAAC;AACH;AAEO,SAAS,YAAY,OAA+C;AACzE,SAAO,iBAAiB;AAC1B;;;ACnDO,IAAM,aAAN,MAAiB;AAAA,EACtB,YAAoB,QAAoB;AAApB;AAAA,EAAqB;AAAA,EAEzC,MAAM,KAAK,UAA8B,CAAC,GAAsB;AAC9D,UAAM,EAAE,WAAW,QAAQ,WAAW,IAAI;AAC1C,QAAI;AAEJ,QAAI,WAAW;AACb,gBAAU,MAAM,KAAK,OAAO,OAAO,kBAAkB,MAAM;AAAA,QACzD;AAAA,QACA;AAAA,MACF,CAAC;AAAA,IACH,WAAW,QAAQ;AACjB,gBAAU,MAAM,KAAK,OAAO,OAAO,iBAAiB,MAAM;AAAA,QACxD,cAAc;AAAA,QACd;AAAA,MACF,CAAC;AAAA,IACH,OAAO;AACL,gBAAU,MAAM,KAAK,OAAO,OAAO,OAAO,MAAM;AAAA,QAC9C;AAAA,MACF,CAAC;AAAA,IACH;AAGA,QAAI,CAAC,QAAQ;AACX,gBAAU,QAAQ;AAAA,QAAO,YACvB,OAAO,WAAW,eAClB,OAAO,WAAW,eAClB,OAAO,iBAAiB,UACxB,OAAO,iB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AAA,IAC/B,iBAAiB,MAAM;AACrB,YAAM,MAAM,WAAW,KAAK;AAC5B,aAAO,QAAQ,IAAI,SAAS,IAAI,MAAM;AAAA,IACxC;AAAA,IACA,eAAe,MAAM,MAAM;AAAA,EAC7B;AACF;AAEO,SAAS,aAAgC;AAC9C,SAAO,WAAW,YAAY;AAChC;AAEO,SAAS,WAAW,QAA0C;AACnE,cAAY,cAAc,MAAM;AAClC;AAEO,SAAS,cAAoB;AAClC,eAAa,MAAM;AACrB;AAEO,SAAS,kBAA2B;AACzC,QAAM,MAAM,WAAW,YAAY;AACnC,SAAO,QAAQ,IAAI,SAAS,IAAI,MAAM;AACxC;AAEO,SAAS,gBAAwB;AACtC,SAAO,aAAa;AACtB;;;ACzFO,IAAM,oBAAN,MAAwB;AAAA,EAM7B,YAAoB,QAA2C;AAA3C;AAClB,SAAK,SAAS,aAAa,KAAK,MAAM;AACtC,SAAK,UAAU,IAAI,WAAW,KAAK,MAAM;AACzC,SAAK,WAAW,IAAI,YAAY,KAAK,MAAM;AAC3C,SAAK,aAAa,IAAI,cAAc,KAAK,MAAM;AAAA,EACjD;AAAA,EAVQ;AAAA,EACR;AAAA,EACA;AAAA,EACA;AAQF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/client.ts","../src/actions.ts","../src/projects.ts","../src/workspaces.ts","../src/contacts.ts","../src/pipelines.ts","../src/config.ts","../src/index.ts"],"sourcesContent":["import { createTRPCClient, httpBatchLink, TRPCClientError } from '@trpc/client';\nimport superjson from 'superjson';\n\ntype ActionInput = {\n assigneeId?: string;\n};\n\ntype KanbanInput = {\n projectId?: string;\n assigneeId?: string;\n kanbanStatus?: 'BACKLOG' | 'TODO' | 'IN_PROGRESS' | 'IN_REVIEW' | 'DONE' | 'CANCELLED';\n};\n\ntype TodayInput = {\n workspaceId?: string;\n};\n\ntype DateRangeInput = {\n startDate: Date;\n endDate: Date;\n workspaceId?: string;\n};\n\ntype ProjectInput = {\n include?: {\n actions?: boolean;\n };\n workspaceId?: string;\n};\n\ntype ActionStatus = 'ACTIVE' | 'COMPLETED' | 'CANCELLED' | 'DELETED' | 'DRAFT';\ntype ActionKanbanStatus = 'BACKLOG' | 'TODO' | 'IN_PROGRESS' | 'IN_REVIEW' | 'DONE' | 'CANCELLED';\ntype ActionPriority = 'Quick' | 'Scheduled' | '1st Priority' | '2nd Priority' | '3rd Priority' | '4th Priority' | '5th Priority' | 'Errand' | 'Remember' | 'Watch' | 'Someday Maybe';\n\ntype ActionCreateInput = {\n name: string;\n description?: string;\n projectId?: string;\n workspaceId?: string;\n dueDate?: Date;\n scheduledStart?: Date;\n scheduledEnd?: Date;\n duration?: number;\n priority?: ActionPriority;\n status?: ActionStatus;\n epicId?: string;\n effortEstimate?: number;\n blockedByIds?: string[];\n};\n\ntype ActionUpdateInput = {\n id: string;\n name?: string;\n description?: string;\n projectId?: string;\n workspaceId?: string | null;\n dueDate?: Date | null;\n scheduledStart?: Date | null;\n scheduledEnd?: Date | null;\n duration?: number | null;\n priority?: ActionPriority;\n status?: ActionStatus;\n kanbanStatus?: ActionKanbanStatus;\n epicId?: string | null;\n effortEstimate?: number | null;\n blockedByIds?: string[];\n};\n\nexport interface TrpcClient {\n action: {\n getAll: { query: (input?: ActionInput) => Promise<unknown[]> };\n getKanbanActions: { query: (input?: KanbanInput) => Promise<unknown[]> };\n getToday: { query: (input?: TodayInput) => Promise<unknown[]> };\n getByDateRange: { query: (input: DateRangeInput) => Promise<unknown[]> };\n getProjectActions: { query: (input: { projectId: string; assigneeId?: string }) => Promise<unknown[]> };\n create: { mutate: (input: ActionCreateInput) => Promise<unknown> };\n update: { mutate: (input: ActionUpdateInput) => Promise<unknown> };\n };\n project: {\n getAll: { query: (input?: ProjectInput) => Promise<unknown[]> };\n };\n workspace: {\n list: { query: () => Promise<unknown[]> };\n };\n crmApi: {\n contactList: { query: (input: { workspaceId: string; search?: string; tags?: string[]; organizationId?: string; limit?: number; cursor?: string }) => Promise<unknown> };\n contactGet: { query: (input: { id: string; includeInteractions?: boolean }) => Promise<unknown> };\n contactCreate: { mutate: (input: { workspaceId: string; firstName?: string; lastName?: string; email?: string | null; phone?: string; linkedIn?: string; telegram?: string; twitter?: string; github?: string; bluesky?: string; about?: string; profileType?: string; skills?: string[]; tags?: string[]; organizationId?: string }) => Promise<unknown> };\n contactUpdate: { mutate: (input: { id: string; firstName?: string; lastName?: string; email?: string | null; phone?: string | null; linkedIn?: string | null; telegram?: string | null; twitter?: string | null; github?: string | null; bluesky?: string | null; about?: string; profileType?: string; skills?: string[]; tags?: string[]; organizationId?: string | null }) => Promise<unknown> };\n contactDelete: { mutate: (input: { id: string }) => Promise<unknown> };\n contactAddInteraction: { mutate: (input: { contactId: string; type: string; direction: string; subject?: string; notes?: string; metadata?: unknown }) => Promise<unknown> };\n pipelineGet: { query: (input: { workspaceId: string }) => Promise<unknown> };\n pipelineGetStages: { query: (input: { workspaceId: string }) => Promise<unknown[]> };\n dealList: { query: (input: { workspaceId: string }) => Promise<unknown[]> };\n dealGet: { query: (input: { id: string }) => Promise<unknown> };\n dealCreate: { mutate: (input: { workspaceId: string; stageId: string; title: string; description?: string; value?: number; currency?: string; probability?: number; expectedCloseDate?: Date; contactId?: string; organizationId?: string; assignedToId?: string }) => Promise<unknown> };\n dealUpdate: { mutate: (input: { id: string; title?: string; description?: string | null; value?: number | null; currency?: string; probability?: number | null; expectedCloseDate?: Date | null; contactId?: string | null; organizationId?: string | null; assignedToId?: string | null }) => Promise<unknown> };\n dealMove: { mutate: (input: { id: string; stageId: string; stageOrder: number }) => Promise<unknown> };\n dealDelete: { mutate: (input: { id: string }) => Promise<unknown> };\n };\n}\n\nexport function createClient(config: { token: string; apiUrl: string }): TrpcClient {\n const apiUrl = config.apiUrl.replace(/\\/+$/, '');\n\n return createTRPCClient<any>({\n links: [\n httpBatchLink({\n url: `${apiUrl}/api/trpc`,\n headers() {\n return {\n Authorization: `Bearer ${config.token}`,\n };\n },\n transformer: superjson,\n }),\n ],\n }) as unknown as TrpcClient;\n}\n\nexport function isTRPCError(error: unknown): error is TRPCClientError<any> {\n return error instanceof TRPCClientError;\n}\n\nexport { TRPCClientError };\n","import type { TrpcClient } from './client.js';\nimport type { Action, KanbanStatus, Priority } from './types/action.js';\n\nexport interface ActionsListOptions {\n projectId?: string;\n status?: KanbanStatus;\n assigneeId?: string;\n}\n\nexport interface ActionsKanbanOptions {\n projectId?: string;\n status?: KanbanStatus;\n assigneeId?: string;\n}\n\nexport type ActionStatus = 'ACTIVE' | 'COMPLETED' | 'CANCELLED' | 'DELETED' | 'DRAFT';\n\nexport interface ActionCreateInput {\n name: string;\n description?: string;\n projectId?: string;\n workspaceId?: string;\n dueDate?: Date;\n scheduledStart?: Date;\n scheduledEnd?: Date;\n duration?: number;\n priority?: Priority;\n status?: ActionStatus;\n epicId?: string;\n effortEstimate?: number;\n blockedByIds?: string[];\n}\n\nexport interface ActionUpdateInput {\n id: string;\n name?: string;\n description?: string;\n projectId?: string;\n workspaceId?: string | null;\n dueDate?: Date | null;\n scheduledStart?: Date | null;\n scheduledEnd?: Date | null;\n duration?: number | null;\n priority?: Priority;\n status?: ActionStatus;\n kanbanStatus?: KanbanStatus;\n epicId?: string | null;\n effortEstimate?: number | null;\n blockedByIds?: string[];\n}\n\nexport class ActionsApi {\n constructor(private client: TrpcClient) {}\n\n async list(options: ActionsListOptions = {}): Promise<Action[]> {\n const { projectId, status, assigneeId } = options;\n let actions: Action[];\n\n if (projectId) {\n actions = await this.client.action.getProjectActions.query({\n projectId,\n assigneeId,\n }) as Action[];\n } else if (status) {\n actions = await this.client.action.getKanbanActions.query({\n kanbanStatus: status,\n assigneeId,\n }) as Action[];\n } else {\n actions = await this.client.action.getAll.query({\n assigneeId,\n }) as Action[];\n }\n\n // Match CLI behavior: hide completed/cancelled unless status specified\n if (!status) {\n actions = actions.filter(action =>\n action.status !== 'COMPLETED' &&\n action.status !== 'CANCELLED' &&\n action.kanbanStatus !== 'DONE' &&\n action.kanbanStatus !== 'CANCELLED'\n );\n }\n\n return actions;\n }\n\n async getToday(workspaceId?: string): Promise<Action[]> {\n return await this.client.action.getToday.query({\n workspaceId,\n }) as Action[];\n }\n\n async getByDateRange(start: Date, end: Date, workspaceId?: string): Promise<Action[]> {\n return await this.client.action.getByDateRange.query({\n startDate: start,\n endDate: end,\n workspaceId,\n }) as Action[];\n }\n\n async getKanban(options: ActionsKanbanOptions = {}): Promise<Action[]> {\n const { projectId, status, assigneeId } = options;\n\n return await this.client.action.getKanbanActions.query({\n projectId,\n kanbanStatus: status,\n assigneeId,\n }) as Action[];\n }\n\n async getProjectActions(projectId: string, assigneeId?: string): Promise<Action[]> {\n return await this.client.action.getProjectActions.query({\n projectId,\n assigneeId,\n }) as Action[];\n }\n\n async create(input: ActionCreateInput): Promise<Action> {\n return await this.client.action.create.mutate(input) as Action;\n }\n\n async update(input: ActionUpdateInput): Promise<Action> {\n return await this.client.action.update.mutate(input) as Action;\n }\n}\n","import type { TrpcClient } from './client.js';\nimport type { Project } from './types/project.js';\n\nexport interface ProjectsListOptions {\n workspaceId?: string;\n includeActions?: boolean;\n}\n\nexport class ProjectsApi {\n constructor(private client: TrpcClient) {}\n\n async list(options: ProjectsListOptions = {}): Promise<Project[]> {\n const { workspaceId, includeActions } = options;\n\n return await this.client.project.getAll.query({\n workspaceId,\n include: includeActions ? { actions: true } : undefined,\n }) as Project[];\n }\n}\n","import type { TrpcClient } from './client.js';\nimport type { Workspace } from './types/workspace.js';\n\nexport class WorkspacesApi {\n constructor(private client: TrpcClient) {}\n\n async list(): Promise<Workspace[]> {\n return await this.client.workspace.list.query() as Workspace[];\n }\n}\n","import type { TrpcClient } from './client.js';\nimport type { Contact, ContactInteraction, ContactListOutput, InteractionType, InteractionDirection } from './types/contact.js';\n\nexport interface ContactsListOptions {\n workspaceId: string;\n search?: string;\n tags?: string[];\n organizationId?: string;\n limit?: number;\n cursor?: string;\n}\n\nexport interface ContactCreateInput {\n workspaceId: string;\n firstName?: string;\n lastName?: string;\n email?: string | null;\n phone?: string;\n linkedIn?: string;\n telegram?: string;\n twitter?: string;\n github?: string;\n bluesky?: string;\n about?: string;\n profileType?: string;\n skills?: string[];\n tags?: string[];\n organizationId?: string;\n}\n\nexport interface ContactUpdateInput {\n id: string;\n firstName?: string;\n lastName?: string;\n email?: string | null;\n phone?: string | null;\n linkedIn?: string | null;\n telegram?: string | null;\n twitter?: string | null;\n github?: string | null;\n bluesky?: string | null;\n about?: string;\n profileType?: string;\n skills?: string[];\n tags?: string[];\n organizationId?: string | null;\n}\n\nexport interface AddInteractionInput {\n contactId: string;\n type: InteractionType;\n direction: InteractionDirection;\n subject?: string;\n notes?: string;\n metadata?: Record<string, unknown>;\n}\n\nexport class ContactsApi {\n constructor(private client: TrpcClient) {}\n\n async list(options: ContactsListOptions): Promise<ContactListOutput> {\n return await this.client.crmApi.contactList.query(options) as ContactListOutput;\n }\n\n async get(id: string, options?: { includeInteractions?: boolean }): Promise<Contact> {\n return await this.client.crmApi.contactGet.query({\n id,\n includeInteractions: options?.includeInteractions,\n }) as Contact;\n }\n\n async create(input: ContactCreateInput): Promise<Contact> {\n return await this.client.crmApi.contactCreate.mutate(input) as Contact;\n }\n\n async update(input: ContactUpdateInput): Promise<Contact> {\n return await this.client.crmApi.contactUpdate.mutate(input) as Contact;\n }\n\n async delete(id: string): Promise<void> {\n await this.client.crmApi.contactDelete.mutate({ id });\n }\n\n async addInteraction(input: AddInteractionInput): Promise<ContactInteraction> {\n return await this.client.crmApi.contactAddInteraction.mutate(input) as ContactInteraction;\n }\n}\n","import type { TrpcClient } from './client.js';\nimport type { Pipeline, PipelineStage, Deal } from './types/pipeline.js';\n\nexport interface DealCreateInput {\n workspaceId: string;\n stageId: string;\n title: string;\n description?: string;\n value?: number;\n currency?: string;\n probability?: number;\n expectedCloseDate?: Date;\n contactId?: string;\n organizationId?: string;\n assignedToId?: string;\n}\n\nexport interface DealUpdateInput {\n id: string;\n title?: string;\n description?: string | null;\n value?: number | null;\n currency?: string;\n probability?: number | null;\n expectedCloseDate?: Date | null;\n contactId?: string | null;\n organizationId?: string | null;\n assignedToId?: string | null;\n}\n\nexport interface DealMoveInput {\n id: string;\n stageId: string;\n stageOrder: number;\n}\n\nexport class PipelinesApi {\n constructor(private client: TrpcClient) {}\n\n async get(workspaceId: string): Promise<Pipeline | null> {\n return await this.client.crmApi.pipelineGet.query({ workspaceId }) as Pipeline | null;\n }\n\n async getStages(workspaceId: string): Promise<PipelineStage[]> {\n return await this.client.crmApi.pipelineGetStages.query({ workspaceId }) as PipelineStage[];\n }\n\n async listDeals(workspaceId: string): Promise<Deal[]> {\n return await this.client.crmApi.dealList.query({ workspaceId }) as Deal[];\n }\n\n async getDeal(id: string): Promise<Deal> {\n return await this.client.crmApi.dealGet.query({ id }) as Deal;\n }\n\n async createDeal(input: DealCreateInput): Promise<Deal> {\n return await this.client.crmApi.dealCreate.mutate(input) as Deal;\n }\n\n async updateDeal(input: DealUpdateInput): Promise<Deal> {\n return await this.client.crmApi.dealUpdate.mutate(input) as Deal;\n }\n\n async moveDeal(input: DealMoveInput): Promise<Deal> {\n return await this.client.crmApi.dealMove.mutate(input) as Deal;\n }\n\n async deleteDeal(id: string): Promise<void> {\n await this.client.crmApi.dealDelete.mutate({ id });\n }\n}\n","import Conf from 'conf';\n\nexport interface ExponentialConfig {\n apiUrl: string;\n token: string;\n tokenExpiry?: string;\n defaultWorkspaceId?: string;\n defaultWorkspaceSlug?: string;\n}\n\nconst schema = {\n apiUrl: {\n type: 'string' as const,\n default: '',\n },\n token: {\n type: 'string' as const,\n default: '',\n },\n tokenExpiry: {\n type: 'string' as const,\n default: '',\n },\n defaultWorkspaceId: {\n type: 'string' as const,\n default: '',\n },\n defaultWorkspaceSlug: {\n type: 'string' as const,\n default: '',\n },\n};\n\nfunction createStore(projectName: string) {\n return new Conf<ExponentialConfig>({\n projectName,\n schema,\n });\n}\n\nfunction readConfig(store: Conf<ExponentialConfig>): ExponentialConfig {\n return {\n apiUrl: store.get('apiUrl'),\n token: store.get('token'),\n tokenExpiry: store.get('tokenExpiry'),\n defaultWorkspaceId: store.get('defaultWorkspaceId'),\n defaultWorkspaceSlug: store.get('defaultWorkspaceSlug'),\n };\n}\n\nfunction writeConfig(store: Conf<ExponentialConfig>, values: Partial<ExponentialConfig>): void {\n if (values.apiUrl !== undefined) store.set('apiUrl', values.apiUrl);\n if (values.token !== undefined) store.set('token', values.token);\n if (values.tokenExpiry !== undefined) store.set('tokenExpiry', values.tokenExpiry);\n if (values.defaultWorkspaceId !== undefined) store.set('defaultWorkspaceId', values.defaultWorkspaceId);\n if (values.defaultWorkspaceSlug !== undefined) store.set('defaultWorkspaceSlug', values.defaultWorkspaceSlug);\n}\n\nconst defaultStore = createStore('exponential-sdk');\n\nexport function createConfigStore(options?: { projectName?: string }) {\n const store = createStore(options?.projectName ?? 'exponential-sdk');\n\n return {\n loadConfig: () => readConfig(store),\n saveConfig: (values: Partial<ExponentialConfig>) => writeConfig(store, values),\n clearConfig: () => store.clear(),\n isAuthenticated: () => {\n const cfg = readConfig(store);\n return Boolean(cfg.token && cfg.apiUrl);\n },\n getConfigPath: () => store.path,\n };\n}\n\nexport function loadConfig(): ExponentialConfig {\n return readConfig(defaultStore);\n}\n\nexport function saveConfig(values: Partial<ExponentialConfig>): void {\n writeConfig(defaultStore, values);\n}\n\nexport function clearConfig(): void {\n defaultStore.clear();\n}\n\nexport function isAuthenticated(): boolean {\n const cfg = readConfig(defaultStore);\n return Boolean(cfg.token && cfg.apiUrl);\n}\n\nexport function getConfigPath(): string {\n return defaultStore.path;\n}\n","import { createClient, isTRPCError, TRPCClientError, type TrpcClient } from './client.js';\nimport { ActionsApi } from './actions.js';\nimport { ProjectsApi } from './projects.js';\nimport { WorkspacesApi } from './workspaces.js';\nimport { ContactsApi } from './contacts.js';\nimport { PipelinesApi } from './pipelines.js';\n\nexport class ExponentialClient {\n private client: TrpcClient;\n actions: ActionsApi;\n projects: ProjectsApi;\n workspaces: WorkspacesApi;\n contacts: ContactsApi;\n pipelines: PipelinesApi;\n\n constructor(private config: { token: string; apiUrl: string }) {\n this.client = createClient(this.config);\n this.actions = new ActionsApi(this.client);\n this.projects = new ProjectsApi(this.client);\n this.workspaces = new WorkspacesApi(this.client);\n this.contacts = new ContactsApi(this.client);\n this.pipelines = new PipelinesApi(this.client);\n }\n}\n\nexport {\n createConfigStore,\n loadConfig,\n saveConfig,\n clearConfig,\n isAuthenticated,\n getConfigPath,\n} from './config.js';\n\nexport type { ExponentialConfig } from './config.js';\nexport type {\n Action,\n ActionOutput,\n ActionsListOutput,\n KanbanStatus,\n Priority,\n} from './types/action.js';\nexport type {\n ActionCreateInput,\n ActionUpdateInput,\n ActionStatus,\n} from './actions.js';\nexport type { Project, ProjectOutput, ProjectsListOutput } from './types/project.js';\nexport type { Workspace, WorkspaceOutput, WorkspacesListOutput } from './types/workspace.js';\nexport type {\n Contact,\n ContactInteraction,\n ContactListOutput,\n InteractionType,\n InteractionDirection,\n} from './types/contact.js';\nexport type {\n ContactCreateInput,\n ContactUpdateInput,\n AddInteractionInput,\n ContactsListOptions,\n} from './contacts.js';\nexport type {\n Pipeline,\n PipelineStage,\n Deal,\n DealActivity,\n} from './types/pipeline.js';\nexport type {\n DealCreateInput,\n DealUpdateInput,\n DealMoveInput,\n} from './pipelines.js';\nexport { isTRPCError, TRPCClientError };\n"],"mappings":";AAAA,SAAS,kBAAkB,eAAe,uBAAuB;AACjE,OAAO,eAAe;AAqGf,SAAS,aAAa,QAAuD;AAClF,QAAM,SAAS,OAAO,OAAO,QAAQ,QAAQ,EAAE;AAE/C,SAAO,iBAAsB;AAAA,IAC3B,OAAO;AAAA,MACL,cAAc;AAAA,QACZ,KAAK,GAAG,MAAM;AAAA,QACd,UAAU;AACR,iBAAO;AAAA,YACL,eAAe,UAAU,OAAO,KAAK;AAAA,UACvC;AAAA,QACF;AAAA,QACA,aAAa;AAAA,MACf,CAAC;AAAA,IACH;AAAA,EACF,CAAC;AACH;AAEO,SAAS,YAAY,OAA+C;AACzE,SAAO,iBAA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