@nvisy/sdk 0.1.0 → 0.2.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.
@@ -0,0 +1,823 @@
1
+ import { A as Account, U as UpdateAccount, a2 as Pagination, a as Activity, c as Annotation, C as CreateAnnotation, d as UpdateAnnotation, e as ApiToken, h as CreateApiToken, f as ApiTokenWithSecret, i as UpdateApiToken, L as Login, j as AuthToken, S as Signup, k as Comment, l as CreateComment, D as Document, n as CreateDocument, o as UpdateDocument, v as ListFilesQuery, F as File, q as UpdateFile, s as DownloadMultipleFilesRequest, t as DownloadArchivedFilesRequest, H as ListIntegrationsQuery, I as Integration, y as CreateIntegration, z as UpdateIntegration, B as UpdateIntegrationCredentials, V as ListInvitesQuery, J as Invite, K as CreateInvite, R as ReplyInvite, M as GenerateInviteCode, N as InviteCode, Y as Member, _ as ListMembersQuery, Z as UpdateMemberRole, a0 as Notification, a3 as IntegrationRun, a6 as CheckHealth, a4 as MonitorStatus, a7 as Webhook, a9 as CreateWebhook, a8 as WebhookWithSecret, aa as UpdateWebhook, ac as Workspace, ad as CreateWorkspace, ae as UpdateWorkspace, ah as paths } from './workspace-3RLqaMcj.js';
2
+ import { Client as Client$1 } from 'openapi-fetch';
3
+
4
+ /**
5
+ * @fileoverview Configuration types and constants for the Nvisy SDK.
6
+ *
7
+ * This module provides configuration interfaces, default values, and environment
8
+ * variable names used throughout the SDK.
9
+ *
10
+ * @module config
11
+ */
12
+ /**
13
+ * Current SDK version.
14
+ *
15
+ * Used in the default user agent string and for version tracking.
16
+ */
17
+ declare const VERSION = "0.2.0";
18
+ /**
19
+ * Configuration options for creating a Nvisy client.
20
+ *
21
+ * The `apiToken` field is required for authentication. All other fields are optional
22
+ * and will use sensible defaults when omitted.
23
+ *
24
+ * @example
25
+ * ```typescript
26
+ * const config: ClientConfig = {
27
+ * apiToken: "your-api-token",
28
+ * baseUrl: "https://api.nvisy.com",
29
+ * headers: { "X-Custom-Header": "value" },
30
+ * };
31
+ * const client = new Client(config);
32
+ * ```
33
+ */
34
+ interface ClientConfig {
35
+ /**
36
+ * API token for authentication.
37
+ *
38
+ * Tokens can be obtained from the Nvisy dashboard or via the auth endpoints.
39
+ */
40
+ apiToken: string;
41
+ /**
42
+ * Base URL for the Nvisy API.
43
+ *
44
+ * @default "https://api.nvisy.com"
45
+ */
46
+ baseUrl?: string;
47
+ /**
48
+ * Custom headers to include with every request.
49
+ *
50
+ * These headers are merged with the default headers (Content-Type, User-Agent,
51
+ * and Authorization). Custom headers take precedence over defaults if there
52
+ * are conflicts.
53
+ */
54
+ headers?: Record<string, string>;
55
+ /**
56
+ * Custom user agent string to identify your application.
57
+ *
58
+ * @default "@nvisy/sdk v.{version}"
59
+ */
60
+ userAgent?: string;
61
+ }
62
+ /**
63
+ * Default configuration values used when options are not explicitly provided.
64
+ */
65
+ declare const DEFAULTS: {
66
+ /**
67
+ * Default base URL for the Nvisy API.
68
+ */
69
+ readonly BASE_URL: "https://api.nvisy.com";
70
+ /**
71
+ * Default user agent string.
72
+ */
73
+ readonly USER_AGENT: "@nvisy/sdk v.0.2.0";
74
+ };
75
+
76
+ /**
77
+ * Service for handling account operations
78
+ */
79
+ declare class AccountService {
80
+ #private;
81
+ constructor(api: ApiClient);
82
+ /**
83
+ * Get the authenticated user's account details
84
+ * @returns Promise that resolves with the account details
85
+ * @throws {ApiError} if the request fails
86
+ */
87
+ get(): Promise<Account>;
88
+ /**
89
+ * Update the authenticated user's account details
90
+ * @param updates - Account update request
91
+ * @returns Promise that resolves with the updated account
92
+ * @throws {ApiError} if the request fails
93
+ */
94
+ update(updates: UpdateAccount): Promise<Account>;
95
+ /**
96
+ * Delete the authenticated user's account
97
+ * @returns Promise that resolves when the account is deleted
98
+ * @throws {ApiError} if the request fails
99
+ */
100
+ delete(): Promise<void>;
101
+ }
102
+
103
+ /**
104
+ * Service for handling workspace activity operations
105
+ */
106
+ declare class ActivitiesService {
107
+ #private;
108
+ constructor(api: ApiClient);
109
+ /**
110
+ * List activities for a workspace
111
+ * @param workspaceId - Workspace ID
112
+ * @param query - Optional query parameters (offset, limit)
113
+ * @returns Promise that resolves with the list of activities
114
+ * @throws {ApiError} if the request fails
115
+ */
116
+ list(workspaceId: string, query?: Pagination): Promise<Activity[]>;
117
+ }
118
+
119
+ /**
120
+ * Service for handling file annotation operations
121
+ */
122
+ declare class AnnotationsService {
123
+ #private;
124
+ constructor(api: ApiClient);
125
+ /**
126
+ * List annotations for a file
127
+ * @param fileId - File ID
128
+ * @param query - Optional query parameters (offset, limit)
129
+ * @returns Promise that resolves with the list of annotations
130
+ * @throws {ApiError} if the request fails
131
+ */
132
+ list(fileId: string, query?: Pagination): Promise<Annotation[]>;
133
+ /**
134
+ * Get annotation details by ID
135
+ * @param annotationId - Annotation ID
136
+ * @returns Promise that resolves with the annotation details
137
+ * @throws {ApiError} if the request fails
138
+ */
139
+ get(annotationId: string): Promise<Annotation>;
140
+ /**
141
+ * Create a new annotation
142
+ * @param fileId - File ID
143
+ * @param annotation - Annotation creation request
144
+ * @returns Promise that resolves with the created annotation
145
+ * @throws {ApiError} if the request fails
146
+ */
147
+ create(fileId: string, annotation: CreateAnnotation): Promise<Annotation>;
148
+ /**
149
+ * Update an existing annotation
150
+ * @param annotationId - Annotation ID
151
+ * @param updates - Annotation update request
152
+ * @returns Promise that resolves with the updated annotation
153
+ * @throws {ApiError} if the request fails
154
+ */
155
+ update(annotationId: string, updates: UpdateAnnotation): Promise<Annotation>;
156
+ /**
157
+ * Delete an annotation
158
+ * @param annotationId - Annotation ID
159
+ * @returns Promise that resolves when the annotation is deleted
160
+ * @throws {ApiError} if the request fails
161
+ */
162
+ delete(annotationId: string): Promise<void>;
163
+ }
164
+
165
+ /**
166
+ * Service for handling API token operations
167
+ */
168
+ declare class ApiTokensService {
169
+ #private;
170
+ constructor(api: ApiClient);
171
+ /**
172
+ * List all API tokens for the authenticated account
173
+ * @param options - Pagination options
174
+ * @returns Promise that resolves with the list of API tokens
175
+ * @throws {ApiError} if the request fails
176
+ */
177
+ list(options?: {
178
+ offset?: number;
179
+ limit?: number;
180
+ }): Promise<ApiToken[]>;
181
+ /**
182
+ * Get a specific API token by access token
183
+ * @param accessToken - The access token identifier
184
+ * @returns Promise that resolves with the API token details
185
+ * @throws {ApiError} if the request fails
186
+ */
187
+ get(accessToken: string): Promise<ApiToken>;
188
+ /**
189
+ * Create a new API token
190
+ * @param token - Token creation request
191
+ * @returns Promise that resolves with the created token (includes secret, shown only once)
192
+ * @throws {ApiError} if the request fails
193
+ */
194
+ create(token: CreateApiToken): Promise<ApiTokenWithSecret>;
195
+ /**
196
+ * Update an existing API token
197
+ * @param accessToken - The access token identifier
198
+ * @param updates - Token update request
199
+ * @returns Promise that resolves with the updated token
200
+ * @throws {ApiError} if the request fails
201
+ */
202
+ update(accessToken: string, updates: UpdateApiToken): Promise<ApiToken>;
203
+ /**
204
+ * Revoke an API token
205
+ * @param accessToken - The access token identifier
206
+ * @returns Promise that resolves when the token is revoked
207
+ * @throws {ApiError} if the request fails
208
+ */
209
+ revoke(accessToken: string): Promise<void>;
210
+ }
211
+
212
+ /**
213
+ * Service for handling authentication operations
214
+ */
215
+ declare class AuthService {
216
+ #private;
217
+ constructor(api: ApiClient);
218
+ /**
219
+ * Login with email and password
220
+ * @param credentials - Login credentials
221
+ * @returns Promise that resolves with the auth response containing access token
222
+ * @throws {ApiError} if the request fails
223
+ */
224
+ login(credentials: Login): Promise<AuthToken>;
225
+ /**
226
+ * Sign up a new account
227
+ * @param details - Signup details
228
+ * @returns Promise that resolves with the auth response containing access token
229
+ * @throws {ApiError} if the request fails
230
+ */
231
+ signup(details: Signup): Promise<AuthToken>;
232
+ }
233
+
234
+ /**
235
+ * Service for handling file comment operations
236
+ */
237
+ declare class CommentsService {
238
+ #private;
239
+ constructor(api: ApiClient);
240
+ /**
241
+ * List all comments on a file
242
+ * @param fileId - File ID
243
+ * @param query - Optional query parameters (offset, limit)
244
+ * @returns Promise that resolves with the list of comments
245
+ * @throws {ApiError} if the request fails
246
+ */
247
+ list(fileId: string, query?: Pagination): Promise<Comment[]>;
248
+ /**
249
+ * Create a new comment on a file
250
+ * @param fileId - File ID
251
+ * @param comment - Comment creation request
252
+ * @returns Promise that resolves with the created comment
253
+ * @throws {ApiError} if the request fails
254
+ */
255
+ create(fileId: string, comment: CreateComment): Promise<Comment>;
256
+ /**
257
+ * Delete a comment
258
+ * @param fileId - File ID
259
+ * @param commentId - Comment ID
260
+ * @returns Promise that resolves when the comment is deleted
261
+ * @throws {ApiError} if the request fails
262
+ */
263
+ delete(fileId: string, commentId: string): Promise<void>;
264
+ }
265
+
266
+ /**
267
+ * Service for handling document operations
268
+ */
269
+ declare class DocumentsService {
270
+ #private;
271
+ constructor(api: ApiClient);
272
+ /**
273
+ * List documents in a workspace
274
+ * @param workspaceId - Workspace ID
275
+ * @param query - Optional query parameters (offset, limit)
276
+ * @returns Promise that resolves with the list of documents
277
+ * @throws {ApiError} if the request fails
278
+ */
279
+ list(workspaceId: string, query?: Pagination): Promise<Document[]>;
280
+ /**
281
+ * Get document details by ID
282
+ * @param documentId - Document ID
283
+ * @returns Promise that resolves with the document details
284
+ * @throws {ApiError} if the request fails
285
+ */
286
+ get(documentId: string): Promise<Document>;
287
+ /**
288
+ * Create a new document
289
+ * @param workspaceId - Workspace ID
290
+ * @param document - Document creation request
291
+ * @returns Promise that resolves with the created document
292
+ * @throws {ApiError} if the request fails
293
+ */
294
+ create(workspaceId: string, document: CreateDocument): Promise<Document>;
295
+ /**
296
+ * Update an existing document
297
+ * @param documentId - Document ID
298
+ * @param updates - Document update request
299
+ * @returns Promise that resolves with the updated document
300
+ * @throws {ApiError} if the request fails
301
+ */
302
+ update(documentId: string, updates: UpdateDocument): Promise<Document>;
303
+ /**
304
+ * Delete a document
305
+ * @param documentId - Document ID
306
+ * @returns Promise that resolves when the document is deleted
307
+ * @throws {ApiError} if the request fails
308
+ */
309
+ delete(documentId: string): Promise<void>;
310
+ }
311
+
312
+ /**
313
+ * Service for handling file operations
314
+ */
315
+ declare class FilesService {
316
+ #private;
317
+ constructor(api: ApiClient);
318
+ /**
319
+ * List files in a workspace
320
+ * @param workspaceId - Workspace ID
321
+ * @param query - Optional query parameters (formats, sortBy, order, offset, limit)
322
+ * @returns Promise that resolves with the list of files
323
+ * @throws {ApiError} if the request fails
324
+ */
325
+ list(workspaceId: string, query?: ListFilesQuery & Pagination): Promise<File[]>;
326
+ /**
327
+ * Download a file by ID
328
+ * @param fileId - File ID
329
+ * @returns Promise that resolves with the file response
330
+ * @throws {ApiError} if the request fails
331
+ */
332
+ download(fileId: string): Promise<Response>;
333
+ /**
334
+ * Update a file's metadata
335
+ * @param fileId - File ID
336
+ * @param updates - File update request
337
+ * @returns Promise that resolves with the updated file
338
+ * @throws {ApiError} if the request fails
339
+ */
340
+ update(fileId: string, updates: UpdateFile): Promise<File>;
341
+ /**
342
+ * Delete a file
343
+ * @param fileId - File ID
344
+ * @returns Promise that resolves when the file is deleted
345
+ * @throws {ApiError} if the request fails
346
+ */
347
+ delete(fileId: string): Promise<void>;
348
+ /**
349
+ * Download multiple files
350
+ * @param workspaceId - Workspace ID
351
+ * @param request - Download request with file IDs
352
+ * @returns Promise that resolves with the download response
353
+ * @throws {ApiError} if the request fails
354
+ */
355
+ downloadMultiple(workspaceId: string, request: DownloadMultipleFilesRequest): Promise<Response>;
356
+ /**
357
+ * Download files as an archive
358
+ * @param workspaceId - Workspace ID
359
+ * @param request - Archive download request
360
+ * @returns Promise that resolves with the archive response
361
+ * @throws {ApiError} if the request fails
362
+ */
363
+ downloadArchive(workspaceId: string, request: DownloadArchivedFilesRequest): Promise<Response>;
364
+ }
365
+
366
+ /**
367
+ * Service for handling integration operations
368
+ */
369
+ declare class IntegrationsService {
370
+ #private;
371
+ constructor(api: ApiClient);
372
+ /**
373
+ * List integrations for a workspace
374
+ * @param workspaceId - Workspace ID
375
+ * @param query - Optional query parameters (integrationType, offset, limit)
376
+ * @returns Promise that resolves with the list of integrations
377
+ * @throws {ApiError} if the request fails
378
+ */
379
+ list(workspaceId: string, query?: ListIntegrationsQuery & Pagination): Promise<Integration[]>;
380
+ /**
381
+ * Get integration details by ID
382
+ * @param integrationId - Integration ID
383
+ * @returns Promise that resolves with the integration details
384
+ * @throws {ApiError} if the request fails
385
+ */
386
+ get(integrationId: string): Promise<Integration>;
387
+ /**
388
+ * Create a new integration
389
+ * @param workspaceId - Workspace ID
390
+ * @param integration - Integration creation request
391
+ * @returns Promise that resolves with the created integration
392
+ * @throws {ApiError} if the request fails
393
+ */
394
+ create(workspaceId: string, integration: CreateIntegration): Promise<Integration>;
395
+ /**
396
+ * Update an existing integration
397
+ * @param integrationId - Integration ID
398
+ * @param updates - Integration update request
399
+ * @returns Promise that resolves with the updated integration
400
+ * @throws {ApiError} if the request fails
401
+ */
402
+ update(integrationId: string, updates: UpdateIntegration): Promise<Integration>;
403
+ /**
404
+ * Update integration credentials
405
+ * @param integrationId - Integration ID
406
+ * @param credentials - New credentials
407
+ * @returns Promise that resolves with the updated integration
408
+ * @throws {ApiError} if the request fails
409
+ */
410
+ updateCredentials(integrationId: string, credentials: UpdateIntegrationCredentials): Promise<Integration>;
411
+ /**
412
+ * Delete an integration
413
+ * @param integrationId - Integration ID
414
+ * @returns Promise that resolves when the integration is deleted
415
+ * @throws {ApiError} if the request fails
416
+ */
417
+ delete(integrationId: string): Promise<void>;
418
+ }
419
+
420
+ /**
421
+ * Service for handling workspace invitation operations
422
+ */
423
+ declare class InvitesService {
424
+ #private;
425
+ constructor(api: ApiClient);
426
+ /**
427
+ * List all invitations for a workspace
428
+ * @param workspaceId - Workspace ID
429
+ * @param query - Optional query parameters (role, sortBy, order, offset, limit)
430
+ * @returns Promise that resolves with the list of invitations
431
+ * @throws {ApiError} if the request fails
432
+ */
433
+ list(workspaceId: string, query?: ListInvitesQuery & Pagination): Promise<Invite[]>;
434
+ /**
435
+ * Send an invitation to join a workspace
436
+ * @param workspaceId - Workspace ID
437
+ * @param invite - Invitation request
438
+ * @returns Promise that resolves with the created invitation
439
+ * @throws {ApiError} if the request fails
440
+ */
441
+ send(workspaceId: string, invite: CreateInvite): Promise<Invite>;
442
+ /**
443
+ * Cancel a pending invitation
444
+ * @param inviteId - Invite ID
445
+ * @returns Promise that resolves when the invitation is canceled
446
+ * @throws {ApiError} if the request fails
447
+ */
448
+ cancel(inviteId: string): Promise<void>;
449
+ /**
450
+ * Reply to an invitation (accept or decline)
451
+ * @param inviteId - Invite ID
452
+ * @param reply - Reply request
453
+ * @returns Promise that resolves with the updated invitation
454
+ * @throws {ApiError} if the request fails
455
+ */
456
+ reply(inviteId: string, reply: ReplyInvite): Promise<Invite>;
457
+ /**
458
+ * Generate a shareable invite code for a workspace
459
+ * @param workspaceId - Workspace ID
460
+ * @param options - Invite code generation options
461
+ * @returns Promise that resolves with the generated invite code
462
+ * @throws {ApiError} if the request fails
463
+ */
464
+ generateCode(workspaceId: string, options: GenerateInviteCode): Promise<InviteCode>;
465
+ /**
466
+ * Join a workspace using an invite code
467
+ * @param inviteCode - The invite code
468
+ * @returns Promise that resolves with the member details
469
+ * @throws {ApiError} if the request fails
470
+ */
471
+ joinWithCode(inviteCode: string): Promise<Member>;
472
+ }
473
+
474
+ /**
475
+ * Service for handling member operations
476
+ */
477
+ declare class MembersService {
478
+ #private;
479
+ constructor(api: ApiClient);
480
+ /**
481
+ * List members of a workspace
482
+ * @param workspaceId - Workspace ID
483
+ * @param query - Optional query parameters (role, has2fa, sortBy, order, offset, limit)
484
+ * @returns Promise that resolves with the list of members
485
+ * @throws {ApiError} if the request fails
486
+ */
487
+ list(workspaceId: string, query?: ListMembersQuery & Pagination): Promise<Member[]>;
488
+ /**
489
+ * Get member details by account ID
490
+ * @param workspaceId - Workspace ID
491
+ * @param accountId - Account ID
492
+ * @returns Promise that resolves with the member details
493
+ * @throws {ApiError} if the request fails
494
+ */
495
+ get(workspaceId: string, accountId: string): Promise<Member>;
496
+ /**
497
+ * Update a member's role
498
+ * @param workspaceId - Workspace ID
499
+ * @param accountId - Account ID
500
+ * @param role - New role for the member
501
+ * @returns Promise that resolves with the updated member
502
+ * @throws {ApiError} if the request fails
503
+ */
504
+ updateRole(workspaceId: string, accountId: string, role: UpdateMemberRole): Promise<Member>;
505
+ /**
506
+ * Remove a member from a workspace
507
+ * @param workspaceId - Workspace ID
508
+ * @param accountId - Account ID
509
+ * @returns Promise that resolves when the member is removed
510
+ * @throws {ApiError} if the request fails
511
+ */
512
+ remove(workspaceId: string, accountId: string): Promise<void>;
513
+ /**
514
+ * Leave a workspace
515
+ * @param workspaceId - Workspace ID
516
+ * @returns Promise that resolves when the member has left
517
+ * @throws {ApiError} if the request fails
518
+ */
519
+ leave(workspaceId: string): Promise<void>;
520
+ }
521
+
522
+ /**
523
+ * Service for handling account notification operations
524
+ */
525
+ declare class NotificationsService {
526
+ #private;
527
+ constructor(api: ApiClient);
528
+ /**
529
+ * List notifications for the authenticated account
530
+ * @param query - Optional query parameters (offset, limit)
531
+ * @returns Promise that resolves with the list of notifications
532
+ * @throws {ApiError} if the request fails
533
+ */
534
+ list(query?: Pagination): Promise<Notification[]>;
535
+ }
536
+
537
+ /**
538
+ * Service for handling integration run operations
539
+ */
540
+ declare class RunsService {
541
+ #private;
542
+ constructor(api: ApiClient);
543
+ /**
544
+ * List integration runs for a workspace
545
+ * @param workspaceId - Workspace ID
546
+ * @param query - Optional query parameters (offset, limit)
547
+ * @returns Promise that resolves with the list of integration runs
548
+ * @throws {ApiError} if the request fails
549
+ */
550
+ list(workspaceId: string, query?: Pagination): Promise<IntegrationRun[]>;
551
+ /**
552
+ * Get integration run details by ID
553
+ * @param runId - Run ID
554
+ * @returns Promise that resolves with the integration run details
555
+ * @throws {ApiError} if the request fails
556
+ */
557
+ get(runId: string): Promise<IntegrationRun>;
558
+ }
559
+
560
+ /**
561
+ * Service for handling status and health check operations
562
+ */
563
+ declare class StatusService {
564
+ #private;
565
+ constructor(api: ApiClient);
566
+ /**
567
+ * Check the health status of the API
568
+ * @param options - Health check options
569
+ * @returns Promise that resolves with the API health status
570
+ */
571
+ health(options?: CheckHealth): Promise<MonitorStatus>;
572
+ }
573
+
574
+ /**
575
+ * Service for handling webhook operations
576
+ */
577
+ declare class WebhooksService {
578
+ #private;
579
+ constructor(api: ApiClient);
580
+ /**
581
+ * List all webhooks in a workspace
582
+ * @param workspaceId - Workspace ID
583
+ * @returns Promise that resolves with the list of webhooks
584
+ * @throws {ApiError} if the request fails
585
+ */
586
+ list(workspaceId: string): Promise<Webhook[]>;
587
+ /**
588
+ * Get a specific webhook by ID
589
+ * @param webhookId - Webhook ID
590
+ * @returns Promise that resolves with the webhook details
591
+ * @throws {ApiError} if the request fails
592
+ */
593
+ get(webhookId: string): Promise<Webhook>;
594
+ /**
595
+ * Create a new webhook
596
+ * @param workspaceId - Workspace ID
597
+ * @param webhook - Webhook creation request
598
+ * @returns Promise that resolves with the created webhook (includes secret, shown only once)
599
+ * @throws {ApiError} if the request fails
600
+ */
601
+ create(workspaceId: string, webhook: CreateWebhook): Promise<WebhookWithSecret>;
602
+ /**
603
+ * Update an existing webhook
604
+ * @param webhookId - Webhook ID
605
+ * @param updates - Webhook update request
606
+ * @returns Promise that resolves with the updated webhook
607
+ * @throws {ApiError} if the request fails
608
+ */
609
+ update(webhookId: string, updates: UpdateWebhook): Promise<Webhook>;
610
+ /**
611
+ * Delete a webhook
612
+ * @param webhookId - Webhook ID
613
+ * @returns Promise that resolves when the webhook is deleted
614
+ * @throws {ApiError} if the request fails
615
+ */
616
+ delete(webhookId: string): Promise<void>;
617
+ }
618
+
619
+ /**
620
+ * Service for handling workspace operations
621
+ */
622
+ declare class WorkspacesService {
623
+ #private;
624
+ constructor(api: ApiClient);
625
+ /**
626
+ * List all workspaces
627
+ * @param query - Optional query parameters (offset, limit)
628
+ * @returns Promise that resolves with the list of workspaces
629
+ * @throws {ApiError} if the request fails
630
+ */
631
+ list(query?: Pagination): Promise<Workspace[]>;
632
+ /**
633
+ * Get workspace details by ID
634
+ * @param workspaceId - Workspace ID
635
+ * @returns Promise that resolves with the workspace details
636
+ * @throws {ApiError} if the request fails
637
+ */
638
+ get(workspaceId: string): Promise<Workspace>;
639
+ /**
640
+ * Create a new workspace
641
+ * @param workspace - Workspace creation request
642
+ * @returns Promise that resolves with the created workspace
643
+ * @throws {ApiError} if the request fails
644
+ */
645
+ create(workspace: CreateWorkspace): Promise<Workspace>;
646
+ /**
647
+ * Update an existing workspace
648
+ * @param workspaceId - Workspace ID
649
+ * @param updates - Workspace update request
650
+ * @returns Promise that resolves with the updated workspace
651
+ * @throws {ApiError} if the request fails
652
+ */
653
+ update(workspaceId: string, updates: UpdateWorkspace): Promise<Workspace>;
654
+ /**
655
+ * Delete a workspace
656
+ * @param workspaceId - Workspace ID
657
+ * @returns Promise that resolves when the workspace is deleted
658
+ * @throws {ApiError} if the request fails
659
+ */
660
+ delete(workspaceId: string): Promise<void>;
661
+ }
662
+
663
+ /**
664
+ * @fileoverview Main client for the Nvisy SDK.
665
+ *
666
+ * This module exports the {@link Client} class, which is the primary entry point
667
+ * for interacting with the Nvisy document processing API.
668
+ *
669
+ * @module client
670
+ *
671
+ * @example
672
+ * ```typescript
673
+ * const client = new Client({ apiToken: "your-api-token" });
674
+ * const account = await client.account.get();
675
+ * ```
676
+ */
677
+
678
+ /**
679
+ * Typed openapi-fetch client for the Nvisy API.
680
+ *
681
+ * This type represents the low-level HTTP client configured with the Nvisy API schema.
682
+ * It's exposed via {@link Client.api} for advanced use cases requiring direct API access.
683
+ */
684
+ type ApiClient = Client$1<paths>;
685
+ /**
686
+ * Main client class for interacting with the Nvisy document processing API.
687
+ *
688
+ * @example
689
+ * ```typescript
690
+ * const client = new Client({ apiToken: "your-api-token" });
691
+ * const account = await client.account.get();
692
+ * const workspaces = await client.workspaces.list();
693
+ * ```
694
+ */
695
+ declare class Client {
696
+ #private;
697
+ /**
698
+ * Creates a new Nvisy client instance.
699
+ *
700
+ * @param config - Configuration options with required `apiToken`
701
+ * @throws {ConfigError} If the API token is invalid
702
+ *
703
+ * @example
704
+ * ```typescript
705
+ * const client = new Client({
706
+ * apiToken: "your-api-token",
707
+ * baseUrl: "https://custom.api.nvisy.com",
708
+ * });
709
+ * const account = await client.account.get();
710
+ * ```
711
+ */
712
+ constructor(config: ClientConfig);
713
+ /**
714
+ * Creates a new client with a different API token.
715
+ *
716
+ * Returns a new client instance with the new token. The original client
717
+ * remains unchanged. All other configuration (base URL, headers, etc.)
718
+ * is preserved in the new client.
719
+ *
720
+ * @param apiToken - The new API token
721
+ * @returns A new Client instance with the new token
722
+ * @throws {ConfigError} If the API token is invalid
723
+ *
724
+ * @example
725
+ * ```typescript
726
+ * const client = new Client({ apiToken: "original-token" });
727
+ * const newClient = client.withApiToken("new-token");
728
+ *
729
+ * // newClient uses the new token
730
+ * // client still uses the original token
731
+ * ```
732
+ */
733
+ withApiToken(apiToken: string): Client;
734
+ /**
735
+ * The base URL used for API requests.
736
+ *
737
+ * @returns The configured base URL
738
+ */
739
+ get baseUrl(): string;
740
+ /**
741
+ * The underlying openapi-fetch client for direct API access.
742
+ *
743
+ * Use this for advanced scenarios where you need direct access to the
744
+ * HTTP client, such as calling endpoints not covered by the service classes.
745
+ *
746
+ * @returns The configured ApiClient instance
747
+ */
748
+ get api(): ApiClient;
749
+ /**
750
+ * Service for authentication operations (login, signup, logout).
751
+ *
752
+ * @returns The AuthService instance
753
+ */
754
+ get auth(): AuthService;
755
+ /**
756
+ * Service for API status and health checks.
757
+ *
758
+ * @returns The StatusService instance
759
+ */
760
+ get status(): StatusService;
761
+ /**
762
+ * Service for managing the authenticated user's account.
763
+ *
764
+ * @returns The AccountService instance
765
+ */
766
+ get account(): AccountService;
767
+ /**
768
+ * Service for managing API tokens.
769
+ *
770
+ * @returns The ApiTokensService instance
771
+ */
772
+ get apiTokens(): ApiTokensService;
773
+ /**
774
+ * Service for managing file comments.
775
+ *
776
+ * @returns The CommentsService instance
777
+ */
778
+ get comments(): CommentsService;
779
+ /**
780
+ * Service for document operations.
781
+ *
782
+ * @returns The DocumentsService instance
783
+ */
784
+ get documents(): DocumentsService;
785
+ /**
786
+ * Service for file operations (upload, download, delete).
787
+ *
788
+ * @returns The FilesService instance
789
+ */
790
+ get files(): FilesService;
791
+ /**
792
+ * Service for managing integrations.
793
+ *
794
+ * @returns The IntegrationsService instance
795
+ */
796
+ get integrations(): IntegrationsService;
797
+ /**
798
+ * Service for managing workspace invitations.
799
+ *
800
+ * @returns The InvitesService instance
801
+ */
802
+ get invites(): InvitesService;
803
+ /**
804
+ * Service for managing workspace members.
805
+ *
806
+ * @returns The MembersService instance
807
+ */
808
+ get members(): MembersService;
809
+ /**
810
+ * Service for managing webhooks.
811
+ *
812
+ * @returns The WebhooksService instance
813
+ */
814
+ get webhooks(): WebhooksService;
815
+ /**
816
+ * Service for managing workspaces.
817
+ *
818
+ * @returns The WorkspacesService instance
819
+ */
820
+ get workspaces(): WorkspacesService;
821
+ }
822
+
823
+ export { type ApiClient as A, Client as C, DEFAULTS as D, FilesService as F, IntegrationsService as I, MembersService as M, NotificationsService as N, RunsService as R, StatusService as S, VERSION as V, WebhooksService as W, type ClientConfig as a, AccountService as b, ActivitiesService as c, AnnotationsService as d, ApiTokensService as e, AuthService as f, CommentsService as g, DocumentsService as h, InvitesService as i, WorkspacesService as j };