@gravity-rail/sdk 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +423 -0
- package/dist/chunk-KQJR26B5.js +88 -0
- package/dist/chunk-KQJR26B5.js.map +1 -0
- package/dist/index.cjs +8885 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +11151 -0
- package/dist/index.d.ts +11151 -0
- package/dist/index.js +8683 -0
- package/dist/index.js.map +1 -0
- package/dist/inquiries-BGoNkl8N.d.cts +1695 -0
- package/dist/inquiries-BGoNkl8N.d.ts +1695 -0
- package/dist/schemas.cjs +2279 -0
- package/dist/schemas.cjs.map +1 -0
- package/dist/schemas.d.cts +3101 -0
- package/dist/schemas.d.ts +3101 -0
- package/dist/schemas.js +1946 -0
- package/dist/schemas.js.map +1 -0
- package/package.json +52 -0
|
@@ -0,0 +1,1695 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
interface PaginatedResponse<T> {
|
|
4
|
+
items: T[];
|
|
5
|
+
total: number;
|
|
6
|
+
page: number;
|
|
7
|
+
pageSize: number;
|
|
8
|
+
totalPages: number;
|
|
9
|
+
}
|
|
10
|
+
interface CursorPaginatedResponse<T> {
|
|
11
|
+
items: T[];
|
|
12
|
+
nextCursor: string | null;
|
|
13
|
+
hasMore: boolean;
|
|
14
|
+
pageSize: number;
|
|
15
|
+
}
|
|
16
|
+
type SortOrder = 'asc' | 'desc';
|
|
17
|
+
declare enum AccessLevel {
|
|
18
|
+
PRIVATE = "private",
|
|
19
|
+
PUBLIC = "public",
|
|
20
|
+
WORKSPACE = "workspace"
|
|
21
|
+
}
|
|
22
|
+
declare const PERMISSION_NONE = 0;
|
|
23
|
+
declare const PERMISSION_USE = 1;
|
|
24
|
+
declare const PERMISSION_EDIT = 2;
|
|
25
|
+
declare const PERMISSION_CREATE = 4;
|
|
26
|
+
declare const PERMISSION_LIST = 8;
|
|
27
|
+
declare const PERMISSION_ADMIN = 16;
|
|
28
|
+
declare const PERMISSION_VERIFY = 32;
|
|
29
|
+
declare const PERMISSION_GEOLOCATE = 128;
|
|
30
|
+
declare const PERMISSION_LIST_ALL = 256;
|
|
31
|
+
declare const PERMISSION_DELETE = 512;
|
|
32
|
+
interface ObjectPermissionFlags {
|
|
33
|
+
use: boolean;
|
|
34
|
+
edit: boolean;
|
|
35
|
+
create: boolean;
|
|
36
|
+
list: boolean;
|
|
37
|
+
verify: boolean;
|
|
38
|
+
geolocate: boolean;
|
|
39
|
+
listAll: boolean;
|
|
40
|
+
delete: boolean;
|
|
41
|
+
}
|
|
42
|
+
declare function decodePermissions(accessMode: number): ObjectPermissionFlags;
|
|
43
|
+
declare function encodePermissions(permissions: ObjectPermissionFlags): number;
|
|
44
|
+
type ObjectPermission = 'use' | 'edit' | 'create' | 'list' | 'verify' | 'geolocate' | 'listAll' | 'delete';
|
|
45
|
+
/**
|
|
46
|
+
* Permission scopes for workspace access control.
|
|
47
|
+
* Maps to lib/context/scopes.py - keep in sync.
|
|
48
|
+
*
|
|
49
|
+
* Naming convention: NAMESPACE_ACTION
|
|
50
|
+
* Actions: READ, WRITE, ADMIN
|
|
51
|
+
*/
|
|
52
|
+
declare enum Scope {
|
|
53
|
+
WORKSPACE_READ = "workspace:read",
|
|
54
|
+
WORKSPACE_WRITE = "workspace:write",
|
|
55
|
+
WORKSPACE_ADMIN = "workspace:admin",
|
|
56
|
+
MEMBERS_READ = "members:read",
|
|
57
|
+
MEMBERS_WRITE = "members:write",
|
|
58
|
+
MEMBERS_ADMIN = "members:admin",
|
|
59
|
+
MEMBER_FILTERS_READ = "member_filters:read",
|
|
60
|
+
MEMBER_FILTERS_WRITE = "member_filters:write",
|
|
61
|
+
MEMBER_FILTERS_ADMIN = "member_filters:admin",
|
|
62
|
+
MEMBER_ROLES_READ = "member_roles:read",
|
|
63
|
+
MEMBER_ROLES_WRITE = "member_roles:write",
|
|
64
|
+
MEMBER_ROLES_ADMIN = "member_roles:admin",
|
|
65
|
+
CHATS_READ = "chats:read",
|
|
66
|
+
CHATS_WRITE = "chats:write",
|
|
67
|
+
CHATS_ADMIN = "chats:admin",
|
|
68
|
+
DIRECT_MESSAGES_READ = "dm:read",
|
|
69
|
+
DIRECT_MESSAGES_WRITE = "dm:write",
|
|
70
|
+
DIRECT_MESSAGES_ADMIN = "dm:admin",
|
|
71
|
+
ASSISTANTS_READ = "assistants:read",
|
|
72
|
+
ASSISTANTS_WRITE = "assistants:write",
|
|
73
|
+
ASSISTANTS_ADMIN = "assistants:admin",
|
|
74
|
+
WORKFLOWS_READ = "workflows:read",
|
|
75
|
+
WORKFLOWS_WRITE = "workflows:write",
|
|
76
|
+
WORKFLOWS_ADMIN = "workflows:admin",
|
|
77
|
+
ASSIGNMENTS_READ = "assignments:read",
|
|
78
|
+
ASSIGNMENTS_WRITE = "assignments:write",
|
|
79
|
+
ASSIGNMENTS_ADMIN = "assignments:admin",
|
|
80
|
+
AUTOMATIONS_READ = "automations:read",
|
|
81
|
+
AUTOMATIONS_WRITE = "automations:write",
|
|
82
|
+
AUTOMATIONS_ADMIN = "automations:admin",
|
|
83
|
+
DATATYPES_READ = "datatypes:read",
|
|
84
|
+
DATATYPES_WRITE = "datatypes:write",
|
|
85
|
+
DATATYPES_ADMIN = "datatypes:admin",
|
|
86
|
+
RECORDS_READ = "records:read",
|
|
87
|
+
RECORDS_WRITE = "records:write",
|
|
88
|
+
RECORDS_ADMIN = "records:admin",
|
|
89
|
+
FILES_READ = "files:read",
|
|
90
|
+
FILES_WRITE = "files:write",
|
|
91
|
+
FILES_ADMIN = "files:admin",
|
|
92
|
+
SITES_READ = "sites:read",
|
|
93
|
+
SITES_WRITE = "sites:write",
|
|
94
|
+
SITES_ADMIN = "sites:admin",
|
|
95
|
+
AGENTS_READ = "agents:read",
|
|
96
|
+
AGENTS_WRITE = "agents:write",
|
|
97
|
+
AGENTS_ADMIN = "agents:admin",
|
|
98
|
+
CALENDARS_READ = "calendars:read",
|
|
99
|
+
CALENDARS_WRITE = "calendars:write",
|
|
100
|
+
CALENDARS_ADMIN = "calendars:admin",
|
|
101
|
+
INBOXES_READ = "inboxes:read",
|
|
102
|
+
INBOXES_WRITE = "inboxes:write",
|
|
103
|
+
INBOXES_ADMIN = "inboxes:admin",
|
|
104
|
+
PHONES_READ = "phones:read",
|
|
105
|
+
PHONES_WRITE = "phones:write",
|
|
106
|
+
PHONES_ADMIN = "phones:admin",
|
|
107
|
+
WEBHOOKS_READ = "webhooks:read",
|
|
108
|
+
WEBHOOKS_WRITE = "webhooks:write",
|
|
109
|
+
WEBHOOKS_ADMIN = "webhooks:admin",
|
|
110
|
+
WEBHOOKS_RAW = "webhooks:raw",// Access to raw webhook payloads
|
|
111
|
+
APPS_READ = "apps:read",
|
|
112
|
+
APPS_WRITE = "apps:write",
|
|
113
|
+
APPS_ADMIN = "apps:admin",
|
|
114
|
+
LABELS_READ = "labels:read",
|
|
115
|
+
LABELS_WRITE = "labels:write",
|
|
116
|
+
ANALYTICS_READ = "analytics:read",
|
|
117
|
+
OPERATOR_READ = "operator:read",
|
|
118
|
+
OPERATOR_WRITE = "operator:write",
|
|
119
|
+
ORG_INFO = "org:info",
|
|
120
|
+
ORG_READ = "org:read",
|
|
121
|
+
ORG_WRITE = "org:write",
|
|
122
|
+
ORG_ADMIN = "org:admin",
|
|
123
|
+
ORG_BILLING = "org:billing",
|
|
124
|
+
ORG_DELETE = "org:delete"
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
type ChatSortField = 'createdAt' | 'updatedAt' | 'title' | 'mostRecentMessage';
|
|
128
|
+
type AssignmentSortField = 'createdAt' | 'updatedAt';
|
|
129
|
+
type MemberSortField = 'createdAt' | 'updatedAt' | 'name' | 'email';
|
|
130
|
+
type AssistantSortField = 'createdAt' | 'updatedAt' | 'name';
|
|
131
|
+
type SiteSortField = 'createdAt' | 'updatedAt' | 'name';
|
|
132
|
+
type FileSortField = 'createdAt' | 'updatedAt' | 'name';
|
|
133
|
+
type PageSortField = 'createdAt' | 'updatedAt' | 'title';
|
|
134
|
+
type WebhookLogSortField = 'createdAt' | 'eventType' | 'success';
|
|
135
|
+
type RuleExecutionSortField = 'createdAt' | 'completedAt' | 'durationMs' | 'status';
|
|
136
|
+
type EventSortField = 'createdAt' | 'updatedAt' | 'name' | 'scheduledTime';
|
|
137
|
+
type EventRunSortField = 'createdAt';
|
|
138
|
+
type MilestoneSortField = 'createdAt' | 'updatedAt' | 'name' | 'targetDate';
|
|
139
|
+
type AccountSortField = 'createdAt' | 'updatedAt' | 'name' | 'email';
|
|
140
|
+
type WorkspaceSortField = 'createdAt' | 'updatedAt' | 'name';
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Account interface.
|
|
144
|
+
*
|
|
145
|
+
* Note: With Verified Credential Architecture, if email/phone is set, it's verified
|
|
146
|
+
* by construction. Credentials are IMMUTABLE once set. The *VerifiedAt timestamps
|
|
147
|
+
* record when verification occurred.
|
|
148
|
+
*/
|
|
149
|
+
interface Account {
|
|
150
|
+
id: number;
|
|
151
|
+
loggedIn: boolean;
|
|
152
|
+
avatarUrl: string | null;
|
|
153
|
+
email: string | null;
|
|
154
|
+
phone: string | null;
|
|
155
|
+
emailVerifiedAt: string | null;
|
|
156
|
+
phoneVerifiedAt: string | null;
|
|
157
|
+
name: string | null;
|
|
158
|
+
uuid: string;
|
|
159
|
+
createdAt: string;
|
|
160
|
+
isSuperuser: boolean;
|
|
161
|
+
enabled: boolean;
|
|
162
|
+
tosAccepted: boolean;
|
|
163
|
+
optedOut: boolean;
|
|
164
|
+
signupWorkspaceId: number | null;
|
|
165
|
+
stripeCustomerId: string | null;
|
|
166
|
+
locale: string | null;
|
|
167
|
+
timezone: string | null;
|
|
168
|
+
}
|
|
169
|
+
interface AccountFormData {
|
|
170
|
+
name?: string;
|
|
171
|
+
tosAccepted?: boolean;
|
|
172
|
+
optedOut?: boolean;
|
|
173
|
+
locale?: string;
|
|
174
|
+
timezone?: string;
|
|
175
|
+
}
|
|
176
|
+
interface AdminAccountFormData extends AccountFormData {
|
|
177
|
+
email?: string;
|
|
178
|
+
phone?: string;
|
|
179
|
+
isSuperuser?: boolean;
|
|
180
|
+
enabled?: boolean;
|
|
181
|
+
stripeCustomerId?: string | null;
|
|
182
|
+
}
|
|
183
|
+
interface AdminAccount extends Account {
|
|
184
|
+
workspaceUuids: string[];
|
|
185
|
+
tosAccepted: boolean;
|
|
186
|
+
optedOut: boolean;
|
|
187
|
+
}
|
|
188
|
+
interface DetailedAccount extends AdminAccount {
|
|
189
|
+
}
|
|
190
|
+
interface AccountState {
|
|
191
|
+
items: Account[];
|
|
192
|
+
total: number;
|
|
193
|
+
page: number;
|
|
194
|
+
pageSize: number;
|
|
195
|
+
totalPages: number;
|
|
196
|
+
sortBy: AccountSortField;
|
|
197
|
+
sortOrder: SortOrder;
|
|
198
|
+
}
|
|
199
|
+
interface LoginRequest {
|
|
200
|
+
phoneNumber: string;
|
|
201
|
+
organizationUuid?: string;
|
|
202
|
+
}
|
|
203
|
+
interface VerifyCodeRequest {
|
|
204
|
+
phoneNumber: string;
|
|
205
|
+
code: string;
|
|
206
|
+
organizationUuid?: string;
|
|
207
|
+
}
|
|
208
|
+
interface VerifyCodeResponse {
|
|
209
|
+
token: string;
|
|
210
|
+
accountId: number;
|
|
211
|
+
accountName?: string | null;
|
|
212
|
+
accountUuid?: string | null;
|
|
213
|
+
requiresTwoFactor?: boolean;
|
|
214
|
+
availableTwoFactorMethods?: any[];
|
|
215
|
+
}
|
|
216
|
+
interface LoginResponse {
|
|
217
|
+
token?: string;
|
|
218
|
+
accountId?: number;
|
|
219
|
+
}
|
|
220
|
+
interface SMSLoginResponse {
|
|
221
|
+
success: boolean;
|
|
222
|
+
message?: string;
|
|
223
|
+
}
|
|
224
|
+
interface SendEmailVerificationRequest {
|
|
225
|
+
email: string;
|
|
226
|
+
organizationUuid?: string;
|
|
227
|
+
}
|
|
228
|
+
interface VerifyEmailRequest {
|
|
229
|
+
email: string;
|
|
230
|
+
code: string;
|
|
231
|
+
organizationUuid?: string;
|
|
232
|
+
}
|
|
233
|
+
interface ErrorResponse {
|
|
234
|
+
detail: string;
|
|
235
|
+
}
|
|
236
|
+
interface RequestMagicLinkRequest {
|
|
237
|
+
email: string;
|
|
238
|
+
organizationUuid?: string;
|
|
239
|
+
redirectUrl?: string;
|
|
240
|
+
}
|
|
241
|
+
interface RequestMagicLinkResponse {
|
|
242
|
+
success: boolean;
|
|
243
|
+
message: string;
|
|
244
|
+
}
|
|
245
|
+
interface ValidateMagicLinkRequest {
|
|
246
|
+
token: string;
|
|
247
|
+
otp?: string;
|
|
248
|
+
}
|
|
249
|
+
interface ValidateMagicLinkResponse extends VerifyCodeResponse {
|
|
250
|
+
success: boolean;
|
|
251
|
+
requiresOtp?: boolean;
|
|
252
|
+
otpAttemptsRemaining?: number;
|
|
253
|
+
redirectUrl?: string;
|
|
254
|
+
}
|
|
255
|
+
interface ApiKey {
|
|
256
|
+
id: number;
|
|
257
|
+
uuid: string;
|
|
258
|
+
name: string;
|
|
259
|
+
keyPrefix: string;
|
|
260
|
+
createdAt: string;
|
|
261
|
+
expiresAt: string | null;
|
|
262
|
+
lastUsedAt: string | null;
|
|
263
|
+
enabled: boolean;
|
|
264
|
+
scopes: string[];
|
|
265
|
+
appId?: number | null;
|
|
266
|
+
}
|
|
267
|
+
interface ApiKeyCreated extends ApiKey {
|
|
268
|
+
key: string;
|
|
269
|
+
}
|
|
270
|
+
interface ApiKeyFormData {
|
|
271
|
+
name: string;
|
|
272
|
+
expiresInDays: number;
|
|
273
|
+
scopes: string[];
|
|
274
|
+
}
|
|
275
|
+
interface ApiKeyScope {
|
|
276
|
+
name: string;
|
|
277
|
+
description: string;
|
|
278
|
+
value: number;
|
|
279
|
+
}
|
|
280
|
+
interface ApiKeyScopesResponse {
|
|
281
|
+
scopes: ApiKeyScope[];
|
|
282
|
+
}
|
|
283
|
+
interface SSOConfigData {
|
|
284
|
+
providerType?: string | null;
|
|
285
|
+
autoProvision?: boolean;
|
|
286
|
+
roleMapping?: Record<string, string> | null;
|
|
287
|
+
}
|
|
288
|
+
interface SSOConfig {
|
|
289
|
+
provider: string | null;
|
|
290
|
+
domain: string | null;
|
|
291
|
+
required: boolean;
|
|
292
|
+
enabledAt: string | null;
|
|
293
|
+
config: SSOConfigData | null;
|
|
294
|
+
}
|
|
295
|
+
interface Organization {
|
|
296
|
+
id: number;
|
|
297
|
+
uuid: string;
|
|
298
|
+
name: string;
|
|
299
|
+
slug: string;
|
|
300
|
+
primary: boolean;
|
|
301
|
+
logoUrl?: string;
|
|
302
|
+
contactEmail?: string;
|
|
303
|
+
contactPhone?: string;
|
|
304
|
+
createdAt: string;
|
|
305
|
+
creatorId: number;
|
|
306
|
+
creatorName?: string;
|
|
307
|
+
resellerWorkspaceId?: number;
|
|
308
|
+
resellerWorkspaceUuid?: string;
|
|
309
|
+
sso?: SSOConfig | null;
|
|
310
|
+
}
|
|
311
|
+
interface AdminOrganization extends Organization {
|
|
312
|
+
viewType: 'admin';
|
|
313
|
+
accountCount: number;
|
|
314
|
+
workspaceCount: number;
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Workspace info for member view
|
|
318
|
+
*/
|
|
319
|
+
interface MemberWorkspaceInfo {
|
|
320
|
+
uuid: string;
|
|
321
|
+
name: string;
|
|
322
|
+
slug: string;
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Organization info for non-admin members
|
|
326
|
+
* Shows basic org info and user's workspace memberships
|
|
327
|
+
*/
|
|
328
|
+
interface MemberOrgView {
|
|
329
|
+
viewType: 'member';
|
|
330
|
+
id: number;
|
|
331
|
+
uuid: string;
|
|
332
|
+
name: string;
|
|
333
|
+
slug: string | null;
|
|
334
|
+
logoUrl: string | null;
|
|
335
|
+
role: string;
|
|
336
|
+
workspaces: MemberWorkspaceInfo[];
|
|
337
|
+
}
|
|
338
|
+
interface CreateOrganizationRequest {
|
|
339
|
+
name: string;
|
|
340
|
+
slug?: string;
|
|
341
|
+
primary?: boolean;
|
|
342
|
+
contactEmail?: string;
|
|
343
|
+
contactPhone?: string;
|
|
344
|
+
logo?: string;
|
|
345
|
+
logoMimeType?: string;
|
|
346
|
+
}
|
|
347
|
+
interface UpdateOrganizationRequest {
|
|
348
|
+
name?: string;
|
|
349
|
+
slug?: string;
|
|
350
|
+
primary?: boolean;
|
|
351
|
+
logoUrl?: string;
|
|
352
|
+
contactEmail?: string;
|
|
353
|
+
contactPhone?: string;
|
|
354
|
+
logo?: string;
|
|
355
|
+
logoMimeType?: string;
|
|
356
|
+
ssoProvider?: string | null;
|
|
357
|
+
ssoDomain?: string | null;
|
|
358
|
+
ssoRequired?: boolean;
|
|
359
|
+
ssoAutoProvision?: boolean;
|
|
360
|
+
}
|
|
361
|
+
interface LogoUploadRequest {
|
|
362
|
+
contentType: string;
|
|
363
|
+
fileExtension: string;
|
|
364
|
+
}
|
|
365
|
+
interface LogoUploadResponse {
|
|
366
|
+
uploadUrl: string;
|
|
367
|
+
fields: Record<string, string>;
|
|
368
|
+
fileUrl: string;
|
|
369
|
+
}
|
|
370
|
+
interface AdminAccountMembership {
|
|
371
|
+
workspaceUuid: string;
|
|
372
|
+
workspaceName: string;
|
|
373
|
+
workspaceSlug?: string | null;
|
|
374
|
+
role: string;
|
|
375
|
+
memberRoleName?: string | null;
|
|
376
|
+
createdAt: string;
|
|
377
|
+
tosAccepted: boolean;
|
|
378
|
+
memberRoleId: number | null;
|
|
379
|
+
memberId: number;
|
|
380
|
+
}
|
|
381
|
+
interface AdminWorkspaceMemberFormData {
|
|
382
|
+
tosAccepted?: boolean;
|
|
383
|
+
role?: string;
|
|
384
|
+
memberRoleId?: number;
|
|
385
|
+
}
|
|
386
|
+
interface AdminAccountOrgMembership {
|
|
387
|
+
organizationId: number;
|
|
388
|
+
organizationUuid: string;
|
|
389
|
+
organizationName: string;
|
|
390
|
+
organizationSlug: string;
|
|
391
|
+
organizationLogoUrl: string | null;
|
|
392
|
+
role: string;
|
|
393
|
+
name: string | null;
|
|
394
|
+
accountName: string | null;
|
|
395
|
+
externalId: string | null;
|
|
396
|
+
createdAt: string;
|
|
397
|
+
updatedAt: string;
|
|
398
|
+
}
|
|
399
|
+
interface AccountReportItem {
|
|
400
|
+
id: number;
|
|
401
|
+
uuid: string;
|
|
402
|
+
email?: string | null;
|
|
403
|
+
phone?: string | null;
|
|
404
|
+
name?: string | null;
|
|
405
|
+
created_at: string;
|
|
406
|
+
organization_id?: number | null;
|
|
407
|
+
}
|
|
408
|
+
interface DuplicateAccountInfo {
|
|
409
|
+
id: number;
|
|
410
|
+
name: string | null;
|
|
411
|
+
email: string | null;
|
|
412
|
+
phone: string | null;
|
|
413
|
+
organizationId: number | null;
|
|
414
|
+
organizationName: string | null;
|
|
415
|
+
createdAt: string;
|
|
416
|
+
}
|
|
417
|
+
interface TwoFactorMethod {
|
|
418
|
+
id: number;
|
|
419
|
+
methodType: 'TOTP' | 'WEBAUTHN';
|
|
420
|
+
name: string;
|
|
421
|
+
enabled: boolean;
|
|
422
|
+
createdAt: string;
|
|
423
|
+
lastUsedAt?: string;
|
|
424
|
+
}
|
|
425
|
+
interface TwoFactorStatus {
|
|
426
|
+
enabled: boolean;
|
|
427
|
+
methods: TwoFactorMethod[];
|
|
428
|
+
recoveryCodesCount: number;
|
|
429
|
+
lastRecoveryCodesGenerated?: string;
|
|
430
|
+
}
|
|
431
|
+
interface TOTPSetupResponse {
|
|
432
|
+
setupId: string;
|
|
433
|
+
secret: string;
|
|
434
|
+
qrCodeUrl: string;
|
|
435
|
+
manualEntryKey: string;
|
|
436
|
+
issuer: string;
|
|
437
|
+
}
|
|
438
|
+
interface RecoveryCodesResponse {
|
|
439
|
+
codes: string[];
|
|
440
|
+
generatedAt: string;
|
|
441
|
+
warning: string;
|
|
442
|
+
}
|
|
443
|
+
interface TwoFactorOperationResponse {
|
|
444
|
+
success: boolean;
|
|
445
|
+
message: string;
|
|
446
|
+
methodId?: number;
|
|
447
|
+
}
|
|
448
|
+
interface SetupTOTPRequest {
|
|
449
|
+
name: string;
|
|
450
|
+
}
|
|
451
|
+
interface VerifyTOTPSetupRequest {
|
|
452
|
+
setupId: string;
|
|
453
|
+
code: string;
|
|
454
|
+
name: string;
|
|
455
|
+
}
|
|
456
|
+
interface SetupWebAuthnRequest {
|
|
457
|
+
name: string;
|
|
458
|
+
}
|
|
459
|
+
interface VerifyWebAuthnSetupRequest {
|
|
460
|
+
setupId: string;
|
|
461
|
+
credentialResponse: any;
|
|
462
|
+
name: string;
|
|
463
|
+
}
|
|
464
|
+
interface GenerateRecoveryCodesRequest {
|
|
465
|
+
regenerate?: boolean;
|
|
466
|
+
}
|
|
467
|
+
interface UpdateTwoFactorMethodRequest {
|
|
468
|
+
methodId: number;
|
|
469
|
+
name?: string;
|
|
470
|
+
}
|
|
471
|
+
interface MissingMembershipItem {
|
|
472
|
+
member_id: number;
|
|
473
|
+
member_name: string;
|
|
474
|
+
account_id: number;
|
|
475
|
+
account_uuid: string;
|
|
476
|
+
}
|
|
477
|
+
type OrgMemberRole = 'member' | 'admin' | 'owner';
|
|
478
|
+
interface OrgMember {
|
|
479
|
+
id: number;
|
|
480
|
+
accountId: number;
|
|
481
|
+
organizationId: number;
|
|
482
|
+
role: OrgMemberRole;
|
|
483
|
+
name?: string | null;
|
|
484
|
+
externalId?: string | null;
|
|
485
|
+
createdAt: string;
|
|
486
|
+
updatedAt: string;
|
|
487
|
+
accountName?: string | null;
|
|
488
|
+
accountEmail?: string | null;
|
|
489
|
+
accountPhone?: string | null;
|
|
490
|
+
accountUuid?: string | null;
|
|
491
|
+
}
|
|
492
|
+
/**
|
|
493
|
+
* Response for the current user's org membership (/me endpoint).
|
|
494
|
+
* Extends OrgMember with scopes - the effective permissions
|
|
495
|
+
* the API honors for this user in this organization context.
|
|
496
|
+
*/
|
|
497
|
+
interface CurrentOrgMember extends OrgMember {
|
|
498
|
+
scopes: string[];
|
|
499
|
+
}
|
|
500
|
+
interface OrgMemberListResponse {
|
|
501
|
+
items: OrgMember[];
|
|
502
|
+
total: number;
|
|
503
|
+
page: number;
|
|
504
|
+
pageSize: number;
|
|
505
|
+
}
|
|
506
|
+
interface AddAccountToOrgRequest {
|
|
507
|
+
email?: string;
|
|
508
|
+
phone?: string;
|
|
509
|
+
name?: string;
|
|
510
|
+
role?: OrgMemberRole;
|
|
511
|
+
}
|
|
512
|
+
interface UpdateOrgMemberRequest {
|
|
513
|
+
role: OrgMemberRole;
|
|
514
|
+
}
|
|
515
|
+
interface AccountLookupResponse {
|
|
516
|
+
found: boolean;
|
|
517
|
+
accountId?: number;
|
|
518
|
+
accountUuid?: string;
|
|
519
|
+
name?: string | null;
|
|
520
|
+
}
|
|
521
|
+
interface CreateAccountOrgMembershipRequest {
|
|
522
|
+
organizationId: number;
|
|
523
|
+
role: OrgMemberRole;
|
|
524
|
+
}
|
|
525
|
+
interface CreateAccountOrgMembershipResponse {
|
|
526
|
+
accountId: number;
|
|
527
|
+
organizationId: number;
|
|
528
|
+
organizationUuid: string;
|
|
529
|
+
organizationName: string;
|
|
530
|
+
role: string;
|
|
531
|
+
message: string;
|
|
532
|
+
}
|
|
533
|
+
interface DeleteAccountOrgMembershipResponse {
|
|
534
|
+
status: string;
|
|
535
|
+
message: string;
|
|
536
|
+
workspaceMembershipsRemoved: number;
|
|
537
|
+
}
|
|
538
|
+
type CredentialType = 'email' | 'phone';
|
|
539
|
+
interface RequestCredentialChangeRequest {
|
|
540
|
+
credentialType: CredentialType;
|
|
541
|
+
newValue: string;
|
|
542
|
+
}
|
|
543
|
+
interface CredentialChangeRequestResponse {
|
|
544
|
+
id: number;
|
|
545
|
+
credentialType: CredentialType;
|
|
546
|
+
expiresAt: string;
|
|
547
|
+
message: string;
|
|
548
|
+
}
|
|
549
|
+
interface VerifyCredentialChangeRequest {
|
|
550
|
+
requestId: number;
|
|
551
|
+
otpCode: string;
|
|
552
|
+
}
|
|
553
|
+
interface CredentialChangeVerifyResponse {
|
|
554
|
+
success: boolean;
|
|
555
|
+
message: string;
|
|
556
|
+
credentialType?: CredentialType;
|
|
557
|
+
}
|
|
558
|
+
interface PendingCredentialChange {
|
|
559
|
+
id: number;
|
|
560
|
+
credentialType: CredentialType;
|
|
561
|
+
maskedNewValue: string;
|
|
562
|
+
createdAt: string;
|
|
563
|
+
expiresAt: string;
|
|
564
|
+
isExpired: boolean;
|
|
565
|
+
attempts: number;
|
|
566
|
+
}
|
|
567
|
+
interface CancelCredentialChangeResponse {
|
|
568
|
+
success: boolean;
|
|
569
|
+
message: string;
|
|
570
|
+
}
|
|
571
|
+
interface CreateCredentialChangeInviteRequest {
|
|
572
|
+
credentialType: CredentialType;
|
|
573
|
+
newValue: string;
|
|
574
|
+
}
|
|
575
|
+
interface CredentialChangeInviteResponse {
|
|
576
|
+
id: number;
|
|
577
|
+
credentialType: CredentialType;
|
|
578
|
+
maskedNewValue: string;
|
|
579
|
+
expiresAt: string;
|
|
580
|
+
message: string;
|
|
581
|
+
}
|
|
582
|
+
interface CredentialChangeInviteDetails {
|
|
583
|
+
id: number;
|
|
584
|
+
credentialType: CredentialType;
|
|
585
|
+
newValue: string;
|
|
586
|
+
workspaceName: string;
|
|
587
|
+
workspaceUuid: string;
|
|
588
|
+
initiatedByName: string | null;
|
|
589
|
+
createdAt: string;
|
|
590
|
+
expiresAt: string;
|
|
591
|
+
isExpired: boolean;
|
|
592
|
+
isValid: boolean;
|
|
593
|
+
}
|
|
594
|
+
interface CredentialChangeInviteConfirmResponse {
|
|
595
|
+
success: boolean;
|
|
596
|
+
message: string;
|
|
597
|
+
credentialType?: CredentialType;
|
|
598
|
+
}
|
|
599
|
+
interface PendingCredentialChangeInvite {
|
|
600
|
+
id: number;
|
|
601
|
+
credentialType: CredentialType;
|
|
602
|
+
maskedNewValue: string;
|
|
603
|
+
workspaceName: string;
|
|
604
|
+
initiatedByName: string | null;
|
|
605
|
+
createdAt: string;
|
|
606
|
+
expiresAt: string;
|
|
607
|
+
isExpired: boolean;
|
|
608
|
+
status: string;
|
|
609
|
+
}
|
|
610
|
+
interface CancelCredentialChangeInviteResponse {
|
|
611
|
+
success: boolean;
|
|
612
|
+
message: string;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
declare const MilestoneGoalFormDataSchema: z.ZodObject<{
|
|
616
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
617
|
+
name: z.ZodString;
|
|
618
|
+
description: z.ZodOptional<z.ZodString>;
|
|
619
|
+
memberFilterId: z.ZodNumber;
|
|
620
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
621
|
+
}, z.core.$strip>;
|
|
622
|
+
declare const MilestoneFormDataSchema: z.ZodObject<{
|
|
623
|
+
name: z.ZodString;
|
|
624
|
+
description: z.ZodOptional<z.ZodString>;
|
|
625
|
+
targetDate: z.ZodString;
|
|
626
|
+
ownerId: z.ZodNumber;
|
|
627
|
+
goals: z.ZodArray<z.ZodObject<{
|
|
628
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
629
|
+
name: z.ZodString;
|
|
630
|
+
description: z.ZodOptional<z.ZodString>;
|
|
631
|
+
memberFilterId: z.ZodNumber;
|
|
632
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
633
|
+
}, z.core.$strip>>;
|
|
634
|
+
}, z.core.$strip>;
|
|
635
|
+
declare const ListMilestonesSchema: z.ZodObject<{
|
|
636
|
+
wid: z.ZodString;
|
|
637
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
638
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
639
|
+
sortBy: z.ZodOptional<z.ZodString>;
|
|
640
|
+
sortOrder: z.ZodOptional<z.ZodEnum<{
|
|
641
|
+
asc: "asc";
|
|
642
|
+
desc: "desc";
|
|
643
|
+
}>>;
|
|
644
|
+
}, z.core.$strip>;
|
|
645
|
+
declare const GetMilestoneSchema: z.ZodObject<{
|
|
646
|
+
wid: z.ZodString;
|
|
647
|
+
milestoneId: z.ZodNumber;
|
|
648
|
+
}, z.core.$strip>;
|
|
649
|
+
declare const CreateMilestoneSchema: z.ZodObject<{
|
|
650
|
+
wid: z.ZodString;
|
|
651
|
+
name: z.ZodString;
|
|
652
|
+
description: z.ZodOptional<z.ZodString>;
|
|
653
|
+
targetDate: z.ZodString;
|
|
654
|
+
ownerId: z.ZodNumber;
|
|
655
|
+
goals: z.ZodArray<z.ZodObject<{
|
|
656
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
657
|
+
name: z.ZodString;
|
|
658
|
+
description: z.ZodOptional<z.ZodString>;
|
|
659
|
+
memberFilterId: z.ZodNumber;
|
|
660
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
661
|
+
}, z.core.$strip>>;
|
|
662
|
+
}, z.core.$strip>;
|
|
663
|
+
declare const UpdateMilestoneSchema: z.ZodObject<{
|
|
664
|
+
wid: z.ZodString;
|
|
665
|
+
milestoneId: z.ZodNumber;
|
|
666
|
+
name: z.ZodOptional<z.ZodString>;
|
|
667
|
+
description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
668
|
+
targetDate: z.ZodOptional<z.ZodString>;
|
|
669
|
+
ownerId: z.ZodOptional<z.ZodNumber>;
|
|
670
|
+
goals: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
671
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
672
|
+
name: z.ZodString;
|
|
673
|
+
description: z.ZodOptional<z.ZodString>;
|
|
674
|
+
memberFilterId: z.ZodNumber;
|
|
675
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
676
|
+
}, z.core.$strip>>>;
|
|
677
|
+
}, z.core.$strip>;
|
|
678
|
+
declare const DeleteMilestoneSchema: z.ZodObject<{
|
|
679
|
+
wid: z.ZodString;
|
|
680
|
+
milestoneId: z.ZodNumber;
|
|
681
|
+
}, z.core.$strip>;
|
|
682
|
+
type MilestoneFormData = z.infer<typeof MilestoneFormDataSchema>;
|
|
683
|
+
type ListMilestonesInput = z.infer<typeof ListMilestonesSchema>;
|
|
684
|
+
type GetMilestoneInput = z.infer<typeof GetMilestoneSchema>;
|
|
685
|
+
type CreateMilestoneInput = z.infer<typeof CreateMilestoneSchema>;
|
|
686
|
+
type UpdateMilestoneInput = z.infer<typeof UpdateMilestoneSchema>;
|
|
687
|
+
type DeleteMilestoneInput = z.infer<typeof DeleteMilestoneSchema>;
|
|
688
|
+
|
|
689
|
+
/**
|
|
690
|
+
* Member lifecycle states with increasing levels of permanence.
|
|
691
|
+
* Matches the Python MemberType enum in lib/constants.py
|
|
692
|
+
*/
|
|
693
|
+
declare enum MemberType {
|
|
694
|
+
/** Temporary, unverified caller (e.g., unknown phone number). Does not require an account. */
|
|
695
|
+
ANONYMOUS = "anonymous",
|
|
696
|
+
/** Sandbox account for testing. Does not require an account. Excluded from billing/analytics. */
|
|
697
|
+
TEST = "test",
|
|
698
|
+
/** Real, verified user. Requires an account. Counted in billing and analytics. */
|
|
699
|
+
MEMBER = "member",
|
|
700
|
+
/** AI agent that can communicate via DMs, email, SMS, voice. Has an AgentConfig. */
|
|
701
|
+
AGENT = "agent"
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
/**
|
|
705
|
+
* Agent-specific configuration for members with member_type='agent'.
|
|
706
|
+
* Stores AI model configuration and behavior settings.
|
|
707
|
+
*/
|
|
708
|
+
interface AgentConfig {
|
|
709
|
+
id: number;
|
|
710
|
+
memberId: number;
|
|
711
|
+
chatModelId: string;
|
|
712
|
+
chatModelConfig?: Record<string, unknown>;
|
|
713
|
+
realtimeModelId?: string;
|
|
714
|
+
realtimeModelConfig?: Record<string, unknown>;
|
|
715
|
+
systemPrompt: string;
|
|
716
|
+
heartbeatEnabled: boolean;
|
|
717
|
+
heartbeatCron?: string;
|
|
718
|
+
heartbeatPrompt?: string;
|
|
719
|
+
maxDailyActions?: number;
|
|
720
|
+
tools?: string[];
|
|
721
|
+
codeInterpreterEnabled?: boolean;
|
|
722
|
+
createdAt: string;
|
|
723
|
+
updatedAt: string;
|
|
724
|
+
}
|
|
725
|
+
interface AgentConfigFormData {
|
|
726
|
+
chatModelId: string;
|
|
727
|
+
chatModelConfig?: Record<string, unknown>;
|
|
728
|
+
realtimeModelId?: string;
|
|
729
|
+
realtimeModelConfig?: Record<string, unknown>;
|
|
730
|
+
systemPrompt: string;
|
|
731
|
+
heartbeatEnabled?: boolean;
|
|
732
|
+
heartbeatCron?: string;
|
|
733
|
+
heartbeatPrompt?: string;
|
|
734
|
+
maxDailyActions?: number;
|
|
735
|
+
tools?: string[];
|
|
736
|
+
codeInterpreterEnabled?: boolean;
|
|
737
|
+
}
|
|
738
|
+
interface MemberLabel {
|
|
739
|
+
id: number;
|
|
740
|
+
uuid: string;
|
|
741
|
+
name: string;
|
|
742
|
+
slug: string;
|
|
743
|
+
color: string;
|
|
744
|
+
description?: string;
|
|
745
|
+
}
|
|
746
|
+
interface MemberLabelFormData {
|
|
747
|
+
name: string;
|
|
748
|
+
slug?: string;
|
|
749
|
+
description?: string;
|
|
750
|
+
color: string;
|
|
751
|
+
}
|
|
752
|
+
type MemberFilterObjectType = 'label' | 'dataType' | 'member' | 'memberRole' | 'name' | 'email' | 'phone' | 'phoneType' | 'workflow' | 'tosAccepted' | 'notifySms' | 'notifyEmail' | 'calendarEvent' | 'chatEngagement' | 'lastMessageActivity' | 'memberCreated' | 'isDefault' | 'memberType' | 'memberField';
|
|
753
|
+
type MemberFilterFilterType = 'any' | 'all' | 'none' | 'partial' | 'notPartial' | 'exact' | 'equals' | 'notEquals' | 'notContains' | 'atLeast' | 'atMost' | 'field' | 'dateFilter' | 'greaterThan' | 'greaterThanOrEqual' | 'lessThan' | 'lessThanOrEqual' | 'within' | 'olderThan' | 'never' | 'isEmpty' | 'notEmpty' | 'before' | 'after' | 'between' | 'daysAgo' | 'hasKey' | 'hasKeyValue';
|
|
754
|
+
interface MemberFilterRule {
|
|
755
|
+
id: number;
|
|
756
|
+
uuid: string;
|
|
757
|
+
objectType: MemberFilterObjectType;
|
|
758
|
+
filterType: MemberFilterFilterType;
|
|
759
|
+
objectIds?: number[];
|
|
760
|
+
query?: string;
|
|
761
|
+
}
|
|
762
|
+
interface MemberFilterRuleFormData {
|
|
763
|
+
objectType: MemberFilterObjectType;
|
|
764
|
+
filterType: MemberFilterFilterType;
|
|
765
|
+
objectIds?: number[];
|
|
766
|
+
query?: string;
|
|
767
|
+
}
|
|
768
|
+
interface MemberFilter {
|
|
769
|
+
id: number;
|
|
770
|
+
name: string;
|
|
771
|
+
uuid: string;
|
|
772
|
+
description?: string;
|
|
773
|
+
pinned?: boolean;
|
|
774
|
+
createdAt: string;
|
|
775
|
+
updatedAt: string;
|
|
776
|
+
rules: MemberFilterRule[];
|
|
777
|
+
}
|
|
778
|
+
interface MemberFilterFormData {
|
|
779
|
+
name: string;
|
|
780
|
+
description?: string;
|
|
781
|
+
pinned?: boolean;
|
|
782
|
+
rules: MemberFilterRuleFormData[];
|
|
783
|
+
}
|
|
784
|
+
interface MemberRoleTaskAccess {
|
|
785
|
+
taskId: number;
|
|
786
|
+
accessMode: number;
|
|
787
|
+
}
|
|
788
|
+
interface MemberRoleSiteAccess {
|
|
789
|
+
siteId: number;
|
|
790
|
+
accessMode: number;
|
|
791
|
+
}
|
|
792
|
+
interface MemberRoleDataTypeAccess {
|
|
793
|
+
dataTypeId: number;
|
|
794
|
+
accessMode: number;
|
|
795
|
+
}
|
|
796
|
+
interface MemberRoleWorkflowAccess {
|
|
797
|
+
workflowId: number;
|
|
798
|
+
accessMode: number;
|
|
799
|
+
}
|
|
800
|
+
interface MemberRoleInboxAccess {
|
|
801
|
+
inboxId: number;
|
|
802
|
+
accessMode: number;
|
|
803
|
+
}
|
|
804
|
+
interface MemberRoleFileAccess {
|
|
805
|
+
fileId: number;
|
|
806
|
+
accessMode: number;
|
|
807
|
+
}
|
|
808
|
+
interface MemberRoleFolderAccess {
|
|
809
|
+
folderId: number;
|
|
810
|
+
accessMode: number;
|
|
811
|
+
}
|
|
812
|
+
interface MemberRoleCalendarAccess {
|
|
813
|
+
calendarId: number;
|
|
814
|
+
accessMode: number;
|
|
815
|
+
}
|
|
816
|
+
interface MemberRole {
|
|
817
|
+
id: number;
|
|
818
|
+
uuid: string;
|
|
819
|
+
name: string;
|
|
820
|
+
grantedScopes: string[];
|
|
821
|
+
taskAccess: MemberRoleTaskAccess[];
|
|
822
|
+
siteAccess: MemberRoleSiteAccess[];
|
|
823
|
+
dataTypeAccess: MemberRoleDataTypeAccess[];
|
|
824
|
+
workflowAccess: MemberRoleWorkflowAccess[];
|
|
825
|
+
inboxAccess: MemberRoleInboxAccess[];
|
|
826
|
+
fileAccess: MemberRoleFileAccess[];
|
|
827
|
+
folderAccess: MemberRoleFolderAccess[];
|
|
828
|
+
calendarAccess: MemberRoleCalendarAccess[];
|
|
829
|
+
memberCount: number;
|
|
830
|
+
createdAt: string;
|
|
831
|
+
updatedAt: string;
|
|
832
|
+
}
|
|
833
|
+
interface MemberRoleFormData {
|
|
834
|
+
name?: string;
|
|
835
|
+
grantedScopes?: string[];
|
|
836
|
+
taskAccess?: MemberRoleTaskAccess[];
|
|
837
|
+
siteAccess?: MemberRoleSiteAccess[];
|
|
838
|
+
dataTypeAccess?: MemberRoleDataTypeAccess[];
|
|
839
|
+
workflowAccess?: MemberRoleWorkflowAccess[];
|
|
840
|
+
inboxAccess?: MemberRoleInboxAccess[];
|
|
841
|
+
fileAccess?: MemberRoleFileAccess[];
|
|
842
|
+
folderAccess?: MemberRoleFolderAccess[];
|
|
843
|
+
calendarAccess?: MemberRoleCalendarAccess[];
|
|
844
|
+
}
|
|
845
|
+
interface Member {
|
|
846
|
+
id: number;
|
|
847
|
+
uuid: string;
|
|
848
|
+
accountUuid?: string | null;
|
|
849
|
+
memberRoleId: number;
|
|
850
|
+
name?: string;
|
|
851
|
+
description?: string;
|
|
852
|
+
phone?: string;
|
|
853
|
+
phoneType?: string;
|
|
854
|
+
email?: string;
|
|
855
|
+
externalId?: string;
|
|
856
|
+
emailTrusted?: boolean;
|
|
857
|
+
phoneTrusted?: boolean;
|
|
858
|
+
tosAccepted?: boolean;
|
|
859
|
+
accountTosAccepted?: boolean;
|
|
860
|
+
memberRoleName?: string;
|
|
861
|
+
notifySms?: boolean;
|
|
862
|
+
notifyEmail?: boolean;
|
|
863
|
+
notifyVoice?: boolean;
|
|
864
|
+
accountEnabled?: boolean;
|
|
865
|
+
isOrgOwner?: boolean;
|
|
866
|
+
isSuperuser?: boolean;
|
|
867
|
+
orgRole?: 'owner' | 'admin' | 'member' | null;
|
|
868
|
+
memberType?: MemberType;
|
|
869
|
+
isArchived?: boolean;
|
|
870
|
+
agentConfig?: AgentConfig | null;
|
|
871
|
+
ownerId?: number | null;
|
|
872
|
+
ownerName?: string | null;
|
|
873
|
+
canLogin?: boolean;
|
|
874
|
+
locale: string | null;
|
|
875
|
+
timezone?: string;
|
|
876
|
+
createdAt?: string;
|
|
877
|
+
updatedAt?: string;
|
|
878
|
+
labels?: MemberLabel[];
|
|
879
|
+
}
|
|
880
|
+
/**
|
|
881
|
+
* Response for the current user's member profile (/me endpoint).
|
|
882
|
+
* Extends Member with scopes and org role - the effective permissions the API honors.
|
|
883
|
+
*/
|
|
884
|
+
interface CurrentMember extends Member {
|
|
885
|
+
scopes: string[];
|
|
886
|
+
orgRole: 'owner' | 'admin' | 'member' | null;
|
|
887
|
+
}
|
|
888
|
+
interface MemberFormData {
|
|
889
|
+
tosAccepted?: boolean;
|
|
890
|
+
memberRoleId?: number;
|
|
891
|
+
notifySms?: boolean;
|
|
892
|
+
notifyEmail?: boolean;
|
|
893
|
+
notifyVoice?: boolean;
|
|
894
|
+
name?: string;
|
|
895
|
+
description?: string;
|
|
896
|
+
phone?: string;
|
|
897
|
+
email?: string;
|
|
898
|
+
externalId?: string;
|
|
899
|
+
}
|
|
900
|
+
interface CreateWorkspaceMemberRequest {
|
|
901
|
+
email?: string;
|
|
902
|
+
phone?: string;
|
|
903
|
+
accountUuid?: string;
|
|
904
|
+
emailTrusted?: boolean;
|
|
905
|
+
phoneTrusted?: boolean;
|
|
906
|
+
name?: string;
|
|
907
|
+
description?: string;
|
|
908
|
+
externalId?: string;
|
|
909
|
+
memberRoleId: number;
|
|
910
|
+
notifySms?: boolean;
|
|
911
|
+
notifyEmail?: boolean;
|
|
912
|
+
notifyVoice?: boolean;
|
|
913
|
+
locale?: string;
|
|
914
|
+
timezone?: string;
|
|
915
|
+
labelIds?: number[];
|
|
916
|
+
tosAccepted?: boolean;
|
|
917
|
+
accountEnabled?: boolean;
|
|
918
|
+
isOrgOwner?: boolean;
|
|
919
|
+
accountTosAccepted?: boolean;
|
|
920
|
+
memberType?: MemberType;
|
|
921
|
+
ownerId?: number;
|
|
922
|
+
}
|
|
923
|
+
interface UpdateWorkspaceMemberRequest {
|
|
924
|
+
name?: string | null;
|
|
925
|
+
description?: string | null;
|
|
926
|
+
phone?: string | null;
|
|
927
|
+
email?: string | null;
|
|
928
|
+
externalId?: string | null;
|
|
929
|
+
memberRoleId?: number;
|
|
930
|
+
labelIds?: number[];
|
|
931
|
+
notifySms?: boolean;
|
|
932
|
+
notifyEmail?: boolean;
|
|
933
|
+
notifyVoice?: boolean;
|
|
934
|
+
emailTrusted?: boolean;
|
|
935
|
+
phoneTrusted?: boolean;
|
|
936
|
+
locale?: string | null;
|
|
937
|
+
timezone?: string | null;
|
|
938
|
+
tosAccepted?: boolean;
|
|
939
|
+
accountEnabled?: boolean;
|
|
940
|
+
isOrgOwner?: boolean;
|
|
941
|
+
isSuperuser?: boolean;
|
|
942
|
+
accountTosAccepted?: boolean;
|
|
943
|
+
memberType?: MemberType;
|
|
944
|
+
}
|
|
945
|
+
interface MergeMembersRequest {
|
|
946
|
+
targetMemberId: number;
|
|
947
|
+
sourceMemberIds: number[];
|
|
948
|
+
}
|
|
949
|
+
interface MergeMembersResponse {
|
|
950
|
+
member: Member;
|
|
951
|
+
mergedCount: number;
|
|
952
|
+
dataRecordsTransferred: number;
|
|
953
|
+
}
|
|
954
|
+
interface NormalizeMemberRequest {
|
|
955
|
+
memberId: number;
|
|
956
|
+
}
|
|
957
|
+
interface NormalizeMemberResponse {
|
|
958
|
+
member: Member;
|
|
959
|
+
changes: Record<string, {
|
|
960
|
+
old: string;
|
|
961
|
+
new: string;
|
|
962
|
+
}>;
|
|
963
|
+
}
|
|
964
|
+
interface MemberReportItem {
|
|
965
|
+
id: number;
|
|
966
|
+
account_uuid: string;
|
|
967
|
+
email?: string | null;
|
|
968
|
+
phone?: string | null;
|
|
969
|
+
name?: string | null;
|
|
970
|
+
external_id?: string | null;
|
|
971
|
+
created_at: string;
|
|
972
|
+
updated_at: string;
|
|
973
|
+
member_role_id: number;
|
|
974
|
+
member_role_name: string;
|
|
975
|
+
}
|
|
976
|
+
interface SignupMemberResponse {
|
|
977
|
+
id: number;
|
|
978
|
+
name?: string;
|
|
979
|
+
description?: string;
|
|
980
|
+
phone?: string;
|
|
981
|
+
email?: string;
|
|
982
|
+
labels: string[];
|
|
983
|
+
externalId?: string;
|
|
984
|
+
memberRoleId: number;
|
|
985
|
+
createdAt: string;
|
|
986
|
+
tosAccepted: boolean;
|
|
987
|
+
}
|
|
988
|
+
interface SignupAccountResponse {
|
|
989
|
+
id: number;
|
|
990
|
+
uuid: string;
|
|
991
|
+
email?: string;
|
|
992
|
+
phone?: string;
|
|
993
|
+
name?: string;
|
|
994
|
+
createdAt: Date;
|
|
995
|
+
}
|
|
996
|
+
interface CreateSignupResponse {
|
|
997
|
+
token: string;
|
|
998
|
+
account: SignupAccountResponse;
|
|
999
|
+
member: SignupMemberResponse;
|
|
1000
|
+
wasCreated: boolean;
|
|
1001
|
+
}
|
|
1002
|
+
interface MembersQueryParams {
|
|
1003
|
+
page?: number;
|
|
1004
|
+
pageSize?: number;
|
|
1005
|
+
sortBy?: MemberSortField;
|
|
1006
|
+
sortOrder?: SortOrder;
|
|
1007
|
+
search?: string;
|
|
1008
|
+
labelIds?: number[];
|
|
1009
|
+
memberRoleId?: number;
|
|
1010
|
+
memberType?: string;
|
|
1011
|
+
hasAccount?: boolean;
|
|
1012
|
+
}
|
|
1013
|
+
interface MemberMessageActivity {
|
|
1014
|
+
[memberId: number]: number[];
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
type AnonymousMemberResolutionStatus = 'pending' | 'resolved' | 'expired';
|
|
1018
|
+
/** Summary of the anonymous member's interaction (usually a single call). */
|
|
1019
|
+
interface AnonymousInteraction {
|
|
1020
|
+
chatId?: number;
|
|
1021
|
+
chatTitle?: string;
|
|
1022
|
+
chatSummary?: string;
|
|
1023
|
+
callId?: number;
|
|
1024
|
+
callStatus?: string;
|
|
1025
|
+
callCreatedAt?: string;
|
|
1026
|
+
callDurationSeconds?: number;
|
|
1027
|
+
}
|
|
1028
|
+
interface AnonymousMemberResolution {
|
|
1029
|
+
id: number;
|
|
1030
|
+
anonymousMemberId?: number;
|
|
1031
|
+
anonymousMemberName?: string;
|
|
1032
|
+
identifierType: string;
|
|
1033
|
+
identifierValue: string;
|
|
1034
|
+
status: AnonymousMemberResolutionStatus;
|
|
1035
|
+
resolvedToMemberId?: number;
|
|
1036
|
+
resolvedToMemberName?: string;
|
|
1037
|
+
resolvedByMemberId?: number;
|
|
1038
|
+
resolvedByMemberName?: string;
|
|
1039
|
+
resolutionNotes?: string;
|
|
1040
|
+
createdAt: string;
|
|
1041
|
+
resolvedAt?: string;
|
|
1042
|
+
/** The call/chat that created this anonymous member */
|
|
1043
|
+
interaction?: AnonymousInteraction;
|
|
1044
|
+
}
|
|
1045
|
+
interface ResolveAnonymousMemberRequest {
|
|
1046
|
+
targetMemberId: number;
|
|
1047
|
+
notes?: string;
|
|
1048
|
+
}
|
|
1049
|
+
interface ExpireAnonymousMemberRequest {
|
|
1050
|
+
notes?: string;
|
|
1051
|
+
}
|
|
1052
|
+
interface CreateAnonymousMemberRequest {
|
|
1053
|
+
identifierType: string;
|
|
1054
|
+
identifierValue: string;
|
|
1055
|
+
name?: string;
|
|
1056
|
+
memberRoleId?: number;
|
|
1057
|
+
}
|
|
1058
|
+
interface PendingAnonymousMembersResponse {
|
|
1059
|
+
items: AnonymousMemberResolution[];
|
|
1060
|
+
total: number;
|
|
1061
|
+
}
|
|
1062
|
+
/**
|
|
1063
|
+
* Agent response model - represents a Member with member_type='agent' and its AgentConfig.
|
|
1064
|
+
* Agents are AI personas that can communicate via DMs, email, SMS, and voice.
|
|
1065
|
+
*/
|
|
1066
|
+
interface Agent {
|
|
1067
|
+
id: number;
|
|
1068
|
+
uuid: string;
|
|
1069
|
+
name?: string;
|
|
1070
|
+
description?: string;
|
|
1071
|
+
email?: string;
|
|
1072
|
+
phone?: string;
|
|
1073
|
+
externalId?: string;
|
|
1074
|
+
memberRoleId: number;
|
|
1075
|
+
memberRoleName: string;
|
|
1076
|
+
memberType: MemberType.AGENT;
|
|
1077
|
+
isArchived: boolean;
|
|
1078
|
+
ownerId?: number | null;
|
|
1079
|
+
ownerName?: string | null;
|
|
1080
|
+
createdAt: string;
|
|
1081
|
+
updatedAt: string;
|
|
1082
|
+
labels: MemberLabel[];
|
|
1083
|
+
config: AgentConfig;
|
|
1084
|
+
}
|
|
1085
|
+
interface CreateAgentRequest {
|
|
1086
|
+
name: string;
|
|
1087
|
+
description?: string;
|
|
1088
|
+
email?: string;
|
|
1089
|
+
phone?: string;
|
|
1090
|
+
externalId?: string;
|
|
1091
|
+
memberRoleId: number;
|
|
1092
|
+
labelIds?: number[];
|
|
1093
|
+
ownerId?: number;
|
|
1094
|
+
chatModelId: string;
|
|
1095
|
+
chatModelConfig?: Record<string, unknown>;
|
|
1096
|
+
realtimeModelId?: string;
|
|
1097
|
+
realtimeModelConfig?: Record<string, unknown>;
|
|
1098
|
+
systemPrompt: string;
|
|
1099
|
+
heartbeatEnabled?: boolean;
|
|
1100
|
+
heartbeatCron?: string;
|
|
1101
|
+
heartbeatPrompt?: string;
|
|
1102
|
+
maxDailyActions?: number;
|
|
1103
|
+
tools?: string[];
|
|
1104
|
+
codeInterpreterEnabled?: boolean;
|
|
1105
|
+
}
|
|
1106
|
+
interface UpdateAgentRequest {
|
|
1107
|
+
name?: string;
|
|
1108
|
+
description?: string;
|
|
1109
|
+
email?: string;
|
|
1110
|
+
phone?: string;
|
|
1111
|
+
externalId?: string;
|
|
1112
|
+
memberRoleId?: number;
|
|
1113
|
+
labelIds?: number[];
|
|
1114
|
+
archived?: boolean;
|
|
1115
|
+
chatModelId?: string;
|
|
1116
|
+
chatModelConfig?: Record<string, unknown>;
|
|
1117
|
+
realtimeModelId?: string;
|
|
1118
|
+
realtimeModelConfig?: Record<string, unknown>;
|
|
1119
|
+
systemPrompt?: string;
|
|
1120
|
+
heartbeatEnabled?: boolean;
|
|
1121
|
+
heartbeatCron?: string;
|
|
1122
|
+
heartbeatPrompt?: string;
|
|
1123
|
+
maxDailyActions?: number;
|
|
1124
|
+
tools?: string[];
|
|
1125
|
+
codeInterpreterEnabled?: boolean;
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
declare enum DataFieldType {
|
|
1129
|
+
ENUM = "enum",
|
|
1130
|
+
EMAIL = "email",
|
|
1131
|
+
PHONE = "phone",
|
|
1132
|
+
TEXT = "text",
|
|
1133
|
+
LONGTEXT = "longtext",
|
|
1134
|
+
NUMBER = "number",
|
|
1135
|
+
DATE = "date",
|
|
1136
|
+
DATETIME = "datetime",
|
|
1137
|
+
TIME_OF_DAY = "time_of_day",
|
|
1138
|
+
US_ZIP_CODE = "us_zip_code",
|
|
1139
|
+
INTEGER = "integer",
|
|
1140
|
+
BOOLEAN = "boolean",
|
|
1141
|
+
ARRAY = "array",
|
|
1142
|
+
OBJECT = "object",
|
|
1143
|
+
FUNCTION = "function"
|
|
1144
|
+
}
|
|
1145
|
+
declare enum IndexStatus {
|
|
1146
|
+
NONE = "none",
|
|
1147
|
+
PENDING = "pending",
|
|
1148
|
+
CREATING = "creating",
|
|
1149
|
+
REMOVING = "removing",
|
|
1150
|
+
READY = "ready",
|
|
1151
|
+
ERROR = "error"
|
|
1152
|
+
}
|
|
1153
|
+
interface DataField {
|
|
1154
|
+
id?: number;
|
|
1155
|
+
name: string;
|
|
1156
|
+
slug: string;
|
|
1157
|
+
description?: string;
|
|
1158
|
+
required: boolean;
|
|
1159
|
+
fieldType: DataFieldType;
|
|
1160
|
+
options?: EnumOption[];
|
|
1161
|
+
referencedTypeId?: number;
|
|
1162
|
+
shouldIndex?: boolean;
|
|
1163
|
+
indexStatus?: IndexStatus;
|
|
1164
|
+
adminOnly?: boolean;
|
|
1165
|
+
defaultValue?: any;
|
|
1166
|
+
order: number;
|
|
1167
|
+
createdAt: string;
|
|
1168
|
+
updatedAt: string;
|
|
1169
|
+
}
|
|
1170
|
+
interface DataFieldFormData {
|
|
1171
|
+
name: string;
|
|
1172
|
+
slug: string;
|
|
1173
|
+
description?: string;
|
|
1174
|
+
required: boolean;
|
|
1175
|
+
fieldType: DataFieldType;
|
|
1176
|
+
options?: EnumOption[];
|
|
1177
|
+
referencedTypeId?: number;
|
|
1178
|
+
shouldIndex?: boolean;
|
|
1179
|
+
indexStatus?: IndexStatus;
|
|
1180
|
+
adminOnly?: boolean;
|
|
1181
|
+
defaultValue?: any;
|
|
1182
|
+
}
|
|
1183
|
+
/**
|
|
1184
|
+
* Label-value pair for enum field options.
|
|
1185
|
+
* Allows enum fields to have user-friendly labels while storing clean values
|
|
1186
|
+
* (e.g., numbers for scoring calculations in CEL expressions).
|
|
1187
|
+
*/
|
|
1188
|
+
interface EnumOption {
|
|
1189
|
+
/** Display label shown to users */
|
|
1190
|
+
label: string;
|
|
1191
|
+
/** Stored value (can be string or number) */
|
|
1192
|
+
value: string | number;
|
|
1193
|
+
/**
|
|
1194
|
+
* CEL expression that must return true for this option to be visible.
|
|
1195
|
+
* Uses record.data.<field_slug> syntax to reference other field values.
|
|
1196
|
+
* CONSTRAINT: Can only reference non-FUNCTION fields.
|
|
1197
|
+
*/
|
|
1198
|
+
visibleWhen?: string;
|
|
1199
|
+
}
|
|
1200
|
+
/**
|
|
1201
|
+
* SchemaField is the canonical representation of a data type field.
|
|
1202
|
+
* This is the type returned by the API and stored in the database.
|
|
1203
|
+
* Display order is determined by array position, not the order field.
|
|
1204
|
+
*/
|
|
1205
|
+
interface SchemaField {
|
|
1206
|
+
/** Unique field identifier */
|
|
1207
|
+
slug: string;
|
|
1208
|
+
/** Display name for the field */
|
|
1209
|
+
name: string;
|
|
1210
|
+
/** Optional field description */
|
|
1211
|
+
description?: string;
|
|
1212
|
+
/** Field type (text, email, enum, etc.) */
|
|
1213
|
+
fieldType: DataFieldType;
|
|
1214
|
+
/** Whether field is required */
|
|
1215
|
+
required: boolean;
|
|
1216
|
+
/** @deprecated Display order is now determined by array position */
|
|
1217
|
+
order?: number;
|
|
1218
|
+
/** Options for enum fields as {label, value} objects. */
|
|
1219
|
+
options?: EnumOption[];
|
|
1220
|
+
/** Referenced DataType ID for reference fields */
|
|
1221
|
+
referencedTypeId?: number;
|
|
1222
|
+
/** Whether to index this field */
|
|
1223
|
+
shouldIndex?: boolean;
|
|
1224
|
+
/** Whether only admins can see this field */
|
|
1225
|
+
adminOnly?: boolean;
|
|
1226
|
+
/** Default value for the field */
|
|
1227
|
+
defaultValue?: any;
|
|
1228
|
+
/** CEL expression that computes this field's value from other fields */
|
|
1229
|
+
celFunction?: string;
|
|
1230
|
+
/**
|
|
1231
|
+
* CEL expression for cross-field validation.
|
|
1232
|
+
* Context: 'value' (current field value), 'record.data.<field_slug>' (other fields).
|
|
1233
|
+
* Returns: true if valid, or a string error message if invalid.
|
|
1234
|
+
* CONSTRAINT: Can only reference non-FUNCTION fields.
|
|
1235
|
+
*/
|
|
1236
|
+
validateCel?: string;
|
|
1237
|
+
}
|
|
1238
|
+
interface DataType {
|
|
1239
|
+
id: number;
|
|
1240
|
+
name: string;
|
|
1241
|
+
slug: string;
|
|
1242
|
+
uuid: string;
|
|
1243
|
+
description?: string;
|
|
1244
|
+
prompt?: string;
|
|
1245
|
+
isCollection: boolean;
|
|
1246
|
+
pinned?: boolean;
|
|
1247
|
+
archived: boolean;
|
|
1248
|
+
ownerId: number | null;
|
|
1249
|
+
createdAt: string;
|
|
1250
|
+
updatedAt: string;
|
|
1251
|
+
/** Typed field definitions */
|
|
1252
|
+
fields: SchemaField[];
|
|
1253
|
+
}
|
|
1254
|
+
interface DataTypeFormData {
|
|
1255
|
+
name: string;
|
|
1256
|
+
slug: string;
|
|
1257
|
+
description?: string;
|
|
1258
|
+
prompt?: string;
|
|
1259
|
+
isCollection: boolean;
|
|
1260
|
+
pinned?: boolean;
|
|
1261
|
+
/** Typed field definitions */
|
|
1262
|
+
fields: SchemaField[];
|
|
1263
|
+
ownerId?: number | null;
|
|
1264
|
+
}
|
|
1265
|
+
interface DataRecord {
|
|
1266
|
+
id: number;
|
|
1267
|
+
dataTypeId: number;
|
|
1268
|
+
memberId: number;
|
|
1269
|
+
fieldValues: Record<string, any>;
|
|
1270
|
+
externalId?: string;
|
|
1271
|
+
assignmentTaskId?: number;
|
|
1272
|
+
createdAt: string;
|
|
1273
|
+
updatedAt: string;
|
|
1274
|
+
}
|
|
1275
|
+
interface DataRecordFormData {
|
|
1276
|
+
memberId?: number;
|
|
1277
|
+
/** Member external ID (alternative to memberId). Cannot be used with memberId. */
|
|
1278
|
+
memberExternalId?: string;
|
|
1279
|
+
fieldValues: Record<string, any>;
|
|
1280
|
+
externalId?: string;
|
|
1281
|
+
assignmentTaskId?: number;
|
|
1282
|
+
}
|
|
1283
|
+
interface DataRecordUpdate {
|
|
1284
|
+
id: number;
|
|
1285
|
+
dataRecordId: number;
|
|
1286
|
+
memberId: number;
|
|
1287
|
+
fieldName: string;
|
|
1288
|
+
oldValue?: string | null;
|
|
1289
|
+
newValue?: string | null;
|
|
1290
|
+
createdAt: string;
|
|
1291
|
+
updatedAt: string;
|
|
1292
|
+
assignmentTaskId?: number | null;
|
|
1293
|
+
memberName?: string | null;
|
|
1294
|
+
}
|
|
1295
|
+
interface DataRecordsPaginatedResponse {
|
|
1296
|
+
records: DataRecord[];
|
|
1297
|
+
pagination: {
|
|
1298
|
+
page: number;
|
|
1299
|
+
page_size: number;
|
|
1300
|
+
total_count: number;
|
|
1301
|
+
total_pages: number;
|
|
1302
|
+
has_next: boolean;
|
|
1303
|
+
has_prev: boolean;
|
|
1304
|
+
};
|
|
1305
|
+
}
|
|
1306
|
+
interface DataRecordWithAccessMode extends DataRecord {
|
|
1307
|
+
accessMode: number;
|
|
1308
|
+
}
|
|
1309
|
+
interface DataRecordAssociationFormData {
|
|
1310
|
+
id: number;
|
|
1311
|
+
accessMode: number;
|
|
1312
|
+
}
|
|
1313
|
+
interface DataRecordReportItem {
|
|
1314
|
+
id: number;
|
|
1315
|
+
data_type_id: number;
|
|
1316
|
+
data_type_name: string;
|
|
1317
|
+
data_type_slug: string;
|
|
1318
|
+
values: Record<string, any>;
|
|
1319
|
+
created_at: string;
|
|
1320
|
+
updated_at: string;
|
|
1321
|
+
external_id?: string | null;
|
|
1322
|
+
}
|
|
1323
|
+
interface DataIntegrityReportItem {
|
|
1324
|
+
member: MemberReportItem;
|
|
1325
|
+
account: AccountReportItem;
|
|
1326
|
+
data_records: DataRecordReportItem[];
|
|
1327
|
+
possible_matches: DataIntegrityReportItem[];
|
|
1328
|
+
issues: string[];
|
|
1329
|
+
normalized_phone?: string | null;
|
|
1330
|
+
}
|
|
1331
|
+
interface DataTypeExportItem {
|
|
1332
|
+
uuid: string;
|
|
1333
|
+
name: string;
|
|
1334
|
+
description: string | null;
|
|
1335
|
+
}
|
|
1336
|
+
interface TaskExportDataTypeRelation {
|
|
1337
|
+
taskUuid: string;
|
|
1338
|
+
dataTypeUuid: string;
|
|
1339
|
+
accessMode: number;
|
|
1340
|
+
}
|
|
1341
|
+
/**
|
|
1342
|
+
* Result for a single record in a bulk import operation.
|
|
1343
|
+
*/
|
|
1344
|
+
interface BulkRecordResult {
|
|
1345
|
+
index: number;
|
|
1346
|
+
status: 'created' | 'updated' | 'failed';
|
|
1347
|
+
recordId?: number | null;
|
|
1348
|
+
externalId?: string | null;
|
|
1349
|
+
error?: string | null;
|
|
1350
|
+
}
|
|
1351
|
+
/**
|
|
1352
|
+
* Response for bulk create data records operation.
|
|
1353
|
+
*/
|
|
1354
|
+
interface BulkCreateDataRecordResponse {
|
|
1355
|
+
importedCount: number;
|
|
1356
|
+
totalCount: number;
|
|
1357
|
+
success: boolean;
|
|
1358
|
+
results: BulkRecordResult[];
|
|
1359
|
+
errors?: string[] | null;
|
|
1360
|
+
}
|
|
1361
|
+
/**
|
|
1362
|
+
* Request body for bulk create data records.
|
|
1363
|
+
*/
|
|
1364
|
+
interface BulkCreateDataRecordRequest {
|
|
1365
|
+
records: DataRecordFormData[];
|
|
1366
|
+
upsert?: boolean;
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
/**
|
|
1370
|
+
* Calendar-related types for the Gravity Rail calendar and appointment booking system.
|
|
1371
|
+
*/
|
|
1372
|
+
declare enum CalendarPermissionType {
|
|
1373
|
+
NONE = "NONE",
|
|
1374
|
+
FREE_BUSY = "FREE_BUSY",
|
|
1375
|
+
READ = "READ",
|
|
1376
|
+
WRITE = "WRITE",
|
|
1377
|
+
ADMIN = "ADMIN"
|
|
1378
|
+
}
|
|
1379
|
+
declare enum CalendarSource {
|
|
1380
|
+
INTERNAL = "internal",
|
|
1381
|
+
GOOGLE = "google",
|
|
1382
|
+
OUTLOOK = "outlook"
|
|
1383
|
+
}
|
|
1384
|
+
interface Calendar {
|
|
1385
|
+
id: number;
|
|
1386
|
+
uuid: string;
|
|
1387
|
+
templateUuid: string | null;
|
|
1388
|
+
name: string;
|
|
1389
|
+
slug: string;
|
|
1390
|
+
description: string | null;
|
|
1391
|
+
timezone: string;
|
|
1392
|
+
color: string | null;
|
|
1393
|
+
isPublic: boolean;
|
|
1394
|
+
ownerId: number;
|
|
1395
|
+
ownerName: string | null;
|
|
1396
|
+
remoteCalendarId?: string | null;
|
|
1397
|
+
syncStatus?: string | null;
|
|
1398
|
+
syncError?: string | null;
|
|
1399
|
+
lastSyncedAt?: string | null;
|
|
1400
|
+
calendarSource: CalendarSource;
|
|
1401
|
+
eventTypeIds: number[];
|
|
1402
|
+
schedules: CalendarSchedule[];
|
|
1403
|
+
createdAt: string;
|
|
1404
|
+
updatedAt: string;
|
|
1405
|
+
}
|
|
1406
|
+
interface CalendarFormData {
|
|
1407
|
+
name: string;
|
|
1408
|
+
slug?: string;
|
|
1409
|
+
description?: string | null;
|
|
1410
|
+
timezone?: string;
|
|
1411
|
+
color?: string | null;
|
|
1412
|
+
isPublic?: boolean;
|
|
1413
|
+
eventTypeIds?: number[];
|
|
1414
|
+
}
|
|
1415
|
+
interface CalendarSchedule {
|
|
1416
|
+
id: number;
|
|
1417
|
+
uuid: string;
|
|
1418
|
+
name: string;
|
|
1419
|
+
description: string | null;
|
|
1420
|
+
availabilityType: CalendarScheduleAvailabilityType;
|
|
1421
|
+
recurrenceType: CalendarScheduleRecurrence;
|
|
1422
|
+
startTime: string;
|
|
1423
|
+
endTime: string;
|
|
1424
|
+
recurrenceRule: Record<string, any> | null;
|
|
1425
|
+
recurrenceEndDate: string | null;
|
|
1426
|
+
daysOfWeek: string[] | null;
|
|
1427
|
+
priority: number;
|
|
1428
|
+
eventTypeIds: number[];
|
|
1429
|
+
createdAt: string;
|
|
1430
|
+
updatedAt: string;
|
|
1431
|
+
}
|
|
1432
|
+
interface CalendarScheduleFormData {
|
|
1433
|
+
name: string;
|
|
1434
|
+
description?: string | null;
|
|
1435
|
+
availabilityType: CalendarScheduleAvailabilityType;
|
|
1436
|
+
recurrenceType: CalendarScheduleRecurrence;
|
|
1437
|
+
startTime: string;
|
|
1438
|
+
endTime: string;
|
|
1439
|
+
recurrenceRule?: Record<string, any> | null;
|
|
1440
|
+
recurrenceEndDate?: string | null;
|
|
1441
|
+
daysOfWeek?: string[] | null;
|
|
1442
|
+
priority?: number;
|
|
1443
|
+
eventTypeIds?: number[] | null;
|
|
1444
|
+
}
|
|
1445
|
+
declare enum CalendarScheduleRecurrence {
|
|
1446
|
+
ONCE = "ONCE",
|
|
1447
|
+
DAILY = "DAILY",
|
|
1448
|
+
WEEKLY = "WEEKLY",
|
|
1449
|
+
MONTHLY = "MONTHLY",
|
|
1450
|
+
CUSTOM = "CUSTOM"
|
|
1451
|
+
}
|
|
1452
|
+
declare enum CalendarScheduleAvailabilityType {
|
|
1453
|
+
AVAILABLE = "AVAILABLE",
|
|
1454
|
+
UNAVAILABLE = "UNAVAILABLE"
|
|
1455
|
+
}
|
|
1456
|
+
interface CalendarEventType {
|
|
1457
|
+
id: number;
|
|
1458
|
+
uuid: string;
|
|
1459
|
+
templateUuid: string | null;
|
|
1460
|
+
name: string;
|
|
1461
|
+
slug: string;
|
|
1462
|
+
description: string | null;
|
|
1463
|
+
defaultDurationMinutes: number;
|
|
1464
|
+
bufferBeforeMinutes: number;
|
|
1465
|
+
bufferAfterMinutes: number;
|
|
1466
|
+
minAttendees: number;
|
|
1467
|
+
maxAttendees: number | null;
|
|
1468
|
+
color: string | null;
|
|
1469
|
+
active: boolean;
|
|
1470
|
+
createdAt: string;
|
|
1471
|
+
updatedAt: string;
|
|
1472
|
+
}
|
|
1473
|
+
interface CalendarEventTypeFormData {
|
|
1474
|
+
name: string;
|
|
1475
|
+
slug?: string;
|
|
1476
|
+
description?: string | null;
|
|
1477
|
+
defaultDurationMinutes: number;
|
|
1478
|
+
bufferBeforeMinutes?: number;
|
|
1479
|
+
bufferAfterMinutes?: number;
|
|
1480
|
+
minAttendees?: number;
|
|
1481
|
+
maxAttendees?: number | null;
|
|
1482
|
+
color?: string | null;
|
|
1483
|
+
active?: boolean;
|
|
1484
|
+
}
|
|
1485
|
+
interface CalendarEvent {
|
|
1486
|
+
id: number;
|
|
1487
|
+
uuid: string;
|
|
1488
|
+
calendarId: number;
|
|
1489
|
+
calendarName: string;
|
|
1490
|
+
eventTypeId: number;
|
|
1491
|
+
eventTypeName: string;
|
|
1492
|
+
eventTypeColor: string | null;
|
|
1493
|
+
title: string;
|
|
1494
|
+
description: string | null;
|
|
1495
|
+
location: string | null;
|
|
1496
|
+
startTime: string;
|
|
1497
|
+
endTime: string;
|
|
1498
|
+
status: CalendarEventStatus;
|
|
1499
|
+
creatorMemberId: number | null;
|
|
1500
|
+
creatorAssistantId: number | null;
|
|
1501
|
+
workflowId: number | null;
|
|
1502
|
+
taskId: number | null;
|
|
1503
|
+
assignmentId: number | null;
|
|
1504
|
+
chatId: number | null;
|
|
1505
|
+
messageId: number | null;
|
|
1506
|
+
cancelledAt: string | null;
|
|
1507
|
+
cancelledByMemberId: number | null;
|
|
1508
|
+
cancellationReason: string | null;
|
|
1509
|
+
recurrenceRule: string | null;
|
|
1510
|
+
recurringEventId: string | null;
|
|
1511
|
+
isRecurringInstance: boolean;
|
|
1512
|
+
originalStartTime: string | null;
|
|
1513
|
+
remoteEventId: string | null;
|
|
1514
|
+
attendees: CalendarEventAttendee[];
|
|
1515
|
+
createdAt: string;
|
|
1516
|
+
updatedAt: string;
|
|
1517
|
+
}
|
|
1518
|
+
interface CalendarEventFormData {
|
|
1519
|
+
calendarId: number;
|
|
1520
|
+
eventTypeId: number;
|
|
1521
|
+
title: string;
|
|
1522
|
+
description?: string | null;
|
|
1523
|
+
location?: string | null;
|
|
1524
|
+
startTime: string;
|
|
1525
|
+
attendeeIds: number[];
|
|
1526
|
+
workflowId?: number | null;
|
|
1527
|
+
taskId?: number | null;
|
|
1528
|
+
assignmentId?: number | null;
|
|
1529
|
+
}
|
|
1530
|
+
declare enum CalendarEventStatus {
|
|
1531
|
+
TENTATIVE = "TENTATIVE",
|
|
1532
|
+
CONFIRMED = "CONFIRMED",
|
|
1533
|
+
CANCELLED = "CANCELLED",
|
|
1534
|
+
NO_SHOW = "NO_SHOW",
|
|
1535
|
+
COMPLETED = "COMPLETED"
|
|
1536
|
+
}
|
|
1537
|
+
interface CalendarEventAttendee {
|
|
1538
|
+
id: number;
|
|
1539
|
+
memberId: number;
|
|
1540
|
+
status: AttendeeStatus;
|
|
1541
|
+
responseStatus: AttendeeResponseStatus;
|
|
1542
|
+
responseAt: string | null;
|
|
1543
|
+
note: string | null;
|
|
1544
|
+
}
|
|
1545
|
+
declare enum AttendeeStatus {
|
|
1546
|
+
REQUIRED = "REQUIRED",
|
|
1547
|
+
OPTIONAL = "OPTIONAL"
|
|
1548
|
+
}
|
|
1549
|
+
declare enum AttendeeResponseStatus {
|
|
1550
|
+
PENDING = "PENDING",
|
|
1551
|
+
ACCEPTED = "ACCEPTED",
|
|
1552
|
+
DECLINED = "DECLINED",
|
|
1553
|
+
TENTATIVE = "TENTATIVE"
|
|
1554
|
+
}
|
|
1555
|
+
interface ICalFeedTokenResponse {
|
|
1556
|
+
feedUrl: string;
|
|
1557
|
+
tokenGeneratedAt: string;
|
|
1558
|
+
calendarId: number;
|
|
1559
|
+
calendarUuid: string;
|
|
1560
|
+
}
|
|
1561
|
+
interface ICalFeedUrlResponse {
|
|
1562
|
+
feedUrl: string | null;
|
|
1563
|
+
hasToken: boolean;
|
|
1564
|
+
tokenGeneratedAt: string | null;
|
|
1565
|
+
}
|
|
1566
|
+
interface UpdateAttendeeRequest {
|
|
1567
|
+
responseStatus: AttendeeResponseStatus;
|
|
1568
|
+
note?: string | null;
|
|
1569
|
+
}
|
|
1570
|
+
interface AvailabilityCheck {
|
|
1571
|
+
eventTypeId: number;
|
|
1572
|
+
startTime: string;
|
|
1573
|
+
endTime?: string | null;
|
|
1574
|
+
}
|
|
1575
|
+
interface AvailabilityResponse {
|
|
1576
|
+
available: boolean;
|
|
1577
|
+
reason?: string | null;
|
|
1578
|
+
}
|
|
1579
|
+
interface AvailableSlotsRequest {
|
|
1580
|
+
eventTypeId: number;
|
|
1581
|
+
startDate: string;
|
|
1582
|
+
endDate: string;
|
|
1583
|
+
slotIntervalMinutes?: number;
|
|
1584
|
+
}
|
|
1585
|
+
interface AvailableSlotsResponse {
|
|
1586
|
+
slots: string[];
|
|
1587
|
+
eventTypeId: number;
|
|
1588
|
+
calendarId: number;
|
|
1589
|
+
}
|
|
1590
|
+
interface CalendarEventsQueryParams {
|
|
1591
|
+
calendarId?: number;
|
|
1592
|
+
startDate?: string;
|
|
1593
|
+
endDate?: string;
|
|
1594
|
+
status?: CalendarEventStatus;
|
|
1595
|
+
memberId?: number;
|
|
1596
|
+
limit?: number;
|
|
1597
|
+
offset?: number;
|
|
1598
|
+
}
|
|
1599
|
+
interface GoogleCalendarInfo {
|
|
1600
|
+
id: string;
|
|
1601
|
+
summary: string;
|
|
1602
|
+
description?: string;
|
|
1603
|
+
timeZone: string;
|
|
1604
|
+
backgroundColor?: string;
|
|
1605
|
+
accessRole: string;
|
|
1606
|
+
primary: boolean;
|
|
1607
|
+
}
|
|
1608
|
+
interface GoogleCalendarStatusResponse {
|
|
1609
|
+
connected: boolean;
|
|
1610
|
+
email?: string;
|
|
1611
|
+
calendars: GoogleCalendarInfo[];
|
|
1612
|
+
insufficientScopes?: boolean;
|
|
1613
|
+
}
|
|
1614
|
+
interface GoogleCalendarInsufficientScopesResponse {
|
|
1615
|
+
connected: boolean;
|
|
1616
|
+
insufficientScopes: true;
|
|
1617
|
+
email?: string;
|
|
1618
|
+
reAuthUrl: string;
|
|
1619
|
+
}
|
|
1620
|
+
interface LinkCalendarRequest {
|
|
1621
|
+
googleCalendarId: string;
|
|
1622
|
+
}
|
|
1623
|
+
interface LinkCalendarResponse {
|
|
1624
|
+
status: string;
|
|
1625
|
+
message: string;
|
|
1626
|
+
googleCalendarId: string;
|
|
1627
|
+
googleCalendarName?: string;
|
|
1628
|
+
}
|
|
1629
|
+
interface UnlinkCalendarResponse {
|
|
1630
|
+
status: string;
|
|
1631
|
+
message: string;
|
|
1632
|
+
}
|
|
1633
|
+
interface SyncCalendarResponse {
|
|
1634
|
+
status: string;
|
|
1635
|
+
message: string;
|
|
1636
|
+
created: number;
|
|
1637
|
+
updated: number;
|
|
1638
|
+
errors: Array<{
|
|
1639
|
+
event_id: string;
|
|
1640
|
+
error: string;
|
|
1641
|
+
}>;
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
declare const CreateInquirySchema: z.ZodObject<{
|
|
1645
|
+
name: z.ZodString;
|
|
1646
|
+
inquiryType: z.ZodEnum<{
|
|
1647
|
+
customer: "customer";
|
|
1648
|
+
builder: "builder";
|
|
1649
|
+
partner: "partner";
|
|
1650
|
+
other: "other";
|
|
1651
|
+
}>;
|
|
1652
|
+
cellNumber: z.ZodOptional<z.ZodString>;
|
|
1653
|
+
businessNumber: z.ZodOptional<z.ZodString>;
|
|
1654
|
+
businessName: z.ZodOptional<z.ZodString>;
|
|
1655
|
+
country: z.ZodOptional<z.ZodString>;
|
|
1656
|
+
state: z.ZodOptional<z.ZodString>;
|
|
1657
|
+
message: z.ZodOptional<z.ZodString>;
|
|
1658
|
+
productId: z.ZodOptional<z.ZodNumber>;
|
|
1659
|
+
recaptchaToken: z.ZodOptional<z.ZodString>;
|
|
1660
|
+
}, z.core.$strip>;
|
|
1661
|
+
declare const ListInquiriesSchema: z.ZodObject<{
|
|
1662
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
1663
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
1664
|
+
inquiryType: z.ZodOptional<z.ZodString>;
|
|
1665
|
+
}, z.core.$strip>;
|
|
1666
|
+
declare const GetInquirySchema: z.ZodObject<{
|
|
1667
|
+
inquiryId: z.ZodNumber;
|
|
1668
|
+
}, z.core.$strip>;
|
|
1669
|
+
declare const UpdateInquiryRequestSchema: z.ZodObject<{
|
|
1670
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
1671
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
1672
|
+
in_progress: "in_progress";
|
|
1673
|
+
new: "new";
|
|
1674
|
+
done: "done";
|
|
1675
|
+
}>>;
|
|
1676
|
+
}, z.core.$strip>;
|
|
1677
|
+
declare const UpdateInquirySchema: z.ZodObject<{
|
|
1678
|
+
inquiryId: z.ZodNumber;
|
|
1679
|
+
notes: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
1680
|
+
status: z.ZodOptional<z.ZodOptional<z.ZodEnum<{
|
|
1681
|
+
in_progress: "in_progress";
|
|
1682
|
+
new: "new";
|
|
1683
|
+
done: "done";
|
|
1684
|
+
}>>>;
|
|
1685
|
+
}, z.core.$strip>;
|
|
1686
|
+
declare const DeleteInquirySchema: z.ZodObject<{
|
|
1687
|
+
inquiryId: z.ZodNumber;
|
|
1688
|
+
}, z.core.$strip>;
|
|
1689
|
+
type ListInquiriesInput = z.infer<typeof ListInquiriesSchema>;
|
|
1690
|
+
type GetInquiryInput = z.infer<typeof GetInquirySchema>;
|
|
1691
|
+
type CreateInquiryInput = z.infer<typeof CreateInquirySchema>;
|
|
1692
|
+
type UpdateInquiryInput = z.infer<typeof UpdateInquirySchema>;
|
|
1693
|
+
type DeleteInquiryInput = z.infer<typeof DeleteInquirySchema>;
|
|
1694
|
+
|
|
1695
|
+
export { type TOTPSetupResponse as $, AccessLevel as A, type CreateAgentRequest as B, type ChatSortField as C, type DataRecord as D, type EventSortField as E, type FileSortField as F, type UpdateAgentRequest as G, type ApiKey as H, type ApiKeyFormData as I, type ApiKeyCreated as J, type AssistantSortField as K, type LogoUploadRequest as L, MilestoneFormDataSchema as M, type AccountFormData as N, type OrgMemberRole as O, type PageSortField as P, type SMSLoginResponse as Q, type RuleExecutionSortField as R, type SortOrder as S, type CreateSignupResponse as T, type UpdateOrganizationRequest as U, type VerifyCodeResponse as V, type WebhookLogSortField as W, type RequestMagicLinkResponse as X, type ValidateMagicLinkResponse as Y, type TwoFactorStatus as Z, type SetupTOTPRequest as _, MilestoneGoalFormDataSchema as a, type OrgMemberListResponse as a$, type VerifyTOTPSetupRequest as a0, type TwoFactorOperationResponse as a1, type SetupWebAuthnRequest as a2, type VerifyWebAuthnSetupRequest as a3, type GenerateRecoveryCodesRequest as a4, type RecoveryCodesResponse as a5, type UpdateTwoFactorMethodRequest as a6, type CredentialType as a7, type CredentialChangeRequestResponse as a8, type CredentialChangeVerifyResponse as a9, type SyncCalendarResponse as aA, type DataType as aB, type DataTypeFormData as aC, type DataRecordsPaginatedResponse as aD, type DataRecordFormData as aE, type DataRecordUpdate as aF, type CursorPaginatedResponse as aG, CreateInquirySchema as aH, UpdateInquiryRequestSchema as aI, type CurrentMember as aJ, type MemberFormData as aK, type MemberSortField as aL, type CreateWorkspaceMemberRequest as aM, type UpdateWorkspaceMemberRequest as aN, type MemberFilter as aO, type MemberFilterFormData as aP, type MemberLabel as aQ, type MemberLabelFormData as aR, type MemberRoleFormData as aS, type CredentialChangeInviteResponse as aT, type CancelCredentialChangeInviteResponse as aU, type PendingCredentialChangeInvite as aV, type PendingAnonymousMembersResponse as aW, type AnonymousMemberResolution as aX, type ResolveAnonymousMemberRequest as aY, type ExpireAnonymousMemberRequest as aZ, type CurrentOrgMember as a_, type PendingCredentialChange as aa, type CancelCredentialChangeResponse as ab, type CredentialChangeInviteDetails as ac, type CredentialChangeInviteConfirmResponse as ad, type Calendar as ae, type CalendarFormData as af, type CalendarSchedule as ag, type CalendarScheduleFormData as ah, type AvailabilityCheck as ai, type AvailabilityResponse as aj, type AvailableSlotsRequest as ak, type AvailableSlotsResponse as al, type CalendarEventsQueryParams as am, type CalendarEvent as an, type CalendarEventFormData as ao, type UpdateAttendeeRequest as ap, type CalendarEventType as aq, type CalendarEventTypeFormData as ar, type ICalFeedTokenResponse as as, type ICalFeedUrlResponse as at, type GoogleCalendarInfo as au, type GoogleCalendarStatusResponse as av, type GoogleCalendarInsufficientScopesResponse as aw, type LinkCalendarRequest as ax, type LinkCalendarResponse as ay, type UnlinkCalendarResponse as az, type MilestoneSortField as b, type BulkCreateDataRecordRequest as b$, type AddAccountToOrgRequest as b0, type OrgMember as b1, type UpdateOrgMemberRequest as b2, type AccountReportItem as b3, type AccountState as b4, type ApiKeyScope as b5, type ApiKeyScopesResponse as b6, type CreateAccountOrgMembershipRequest as b7, type CreateAccountOrgMembershipResponse as b8, type CreateCredentialChangeInviteRequest as b9, PERMISSION_NONE as bA, PERMISSION_USE as bB, PERMISSION_EDIT as bC, PERMISSION_CREATE as bD, PERMISSION_LIST as bE, PERMISSION_ADMIN as bF, PERMISSION_VERIFY as bG, PERMISSION_GEOLOCATE as bH, PERMISSION_LIST_ALL as bI, PERMISSION_DELETE as bJ, type ObjectPermissionFlags as bK, decodePermissions as bL, encodePermissions as bM, type ObjectPermission as bN, Scope as bO, DataFieldType as bP, IndexStatus as bQ, type DataField as bR, type DataFieldFormData as bS, type EnumOption as bT, type SchemaField as bU, type DataRecordReportItem as bV, type DataIntegrityReportItem as bW, type DataTypeExportItem as bX, type TaskExportDataTypeRelation as bY, type BulkRecordResult as bZ, type BulkCreateDataRecordResponse as b_, type DeleteAccountOrgMembershipResponse as ba, type DetailedAccount as bb, type DuplicateAccountInfo as bc, type ErrorResponse as bd, type LoginRequest as be, type LoginResponse as bf, type MemberWorkspaceInfo as bg, type Organization as bh, type RequestCredentialChangeRequest as bi, type RequestMagicLinkRequest as bj, type SSOConfig as bk, type SSOConfigData as bl, type SendEmailVerificationRequest as bm, type TwoFactorMethod as bn, type ValidateMagicLinkRequest as bo, type VerifyCodeRequest as bp, type VerifyCredentialChangeRequest as bq, type VerifyEmailRequest as br, CalendarPermissionType as bs, CalendarSource as bt, CalendarScheduleRecurrence as bu, CalendarScheduleAvailabilityType as bv, CalendarEventStatus as bw, type CalendarEventAttendee as bx, AttendeeStatus as by, AttendeeResponseStatus as bz, type Member as c, MemberType as c0, type AgentConfig as c1, type AgentConfigFormData as c2, type MemberFilterObjectType as c3, type MemberFilterFilterType as c4, type MemberFilterRule as c5, type MemberFilterRuleFormData as c6, type MemberRoleTaskAccess as c7, type MemberRoleSiteAccess as c8, type MemberRoleDataTypeAccess as c9, GetMilestoneSchema as cA, CreateMilestoneSchema as cB, UpdateMilestoneSchema as cC, DeleteMilestoneSchema as cD, type MilestoneFormData as cE, type ListMilestonesInput as cF, type GetMilestoneInput as cG, type CreateMilestoneInput as cH, type UpdateMilestoneInput as cI, type DeleteMilestoneInput as cJ, type MemberRoleWorkflowAccess as ca, type MemberRoleInboxAccess as cb, type MemberRoleFileAccess as cc, type MemberRoleFolderAccess as cd, type MemberRoleCalendarAccess as ce, type NormalizeMemberRequest as cf, type NormalizeMemberResponse as cg, type MemberReportItem as ch, type SignupMemberResponse as ci, type SignupAccountResponse as cj, type MembersQueryParams as ck, type MemberMessageActivity as cl, type AnonymousMemberResolutionStatus as cm, type AnonymousInteraction as cn, type CreateAnonymousMemberRequest as co, type SiteSortField as cp, ListInquiriesSchema as cq, GetInquirySchema as cr, UpdateInquirySchema as cs, DeleteInquirySchema as ct, type ListInquiriesInput as cu, type GetInquiryInput as cv, type CreateInquiryInput as cw, type UpdateInquiryInput as cx, type DeleteInquiryInput as cy, ListMilestonesSchema as cz, type EventRunSortField as d, type AssignmentSortField as e, type DataRecordWithAccessMode as f, type DataRecordAssociationFormData as g, type PaginatedResponse as h, type AccountSortField as i, type Account as j, type AdminAccount as k, type AdminAccountMembership as l, type AdminAccountOrgMembership as m, type AdminWorkspaceMemberFormData as n, type AdminAccountFormData as o, type AccountLookupResponse as p, type AdminOrganization as q, type MemberOrgView as r, type CreateOrganizationRequest as s, type LogoUploadResponse as t, type WorkspaceSortField as u, type MergeMembersRequest as v, type MergeMembersResponse as w, type MemberRole as x, type MissingMembershipItem as y, type Agent as z };
|