@nvisy/sdk 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,82 +1,12 @@
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
- };
1
+ import { Client } from 'openapi-fetch';
2
+ import { C as ClientConfig } from './config-L7FKq_q5.js';
3
+ import { L as Login, A as AuthToken, S as Signup, p as paths } from './auth-CncOz2vx.js';
4
+ import { A as Account$1, U as UpdateAccount, aa as CursorPagination, c as ActivitiesPage, f as AnnotationsPage, d as Annotation, C as CreateAnnotation, e as UpdateAnnotation, l as ApiTokensPage, g as ApiToken, j as CreateApiToken, h as ApiTokenWithJWT, k as UpdateApiToken, p as CommentsPage, n as CreateComment, m as Comment, o as UpdateComment, s as DocumentsPage, D as Document, q as CreateDocument, r as UpdateDocument, F as File, L as ListFiles, z as FilesPage, t as UpdateFile, v as DownloadFiles, w as DeleteFiles, K as IntegrationsPage, I as Integration, B as CreateIntegration, E as UpdateIntegration, G as UpdateIntegrationCredentials, W as ListInvites, _ as InvitesPage, N as CreateInvite, M as Invite, R as ReplyInvite, O as GenerateInviteCode, Q as InviteCode, $ as Member, Z as InvitePreview, a1 as ListMembers, a3 as MembersPage, a0 as UpdateMember, a9 as NotificationsPage, a8 as UnreadStatus, ac as IntegrationRunsPage, ab as IntegrationRun, af as CheckHealth, ad as MonitorStatus, an as WebhooksPage, ag as Webhook, ah as CreateWebhook, ai as UpdateWebhook, aj as TestWebhook, ak as WebhookResult, as as WorkspacesPage, ao as Workspace, ap as CreateWorkspace, aq as UpdateWorkspace, a6 as NotificationSettings, a7 as UpdateNotificationSettings } from './workspace-BjdbMWsa.js';
75
5
 
76
6
  /**
77
7
  * Service for handling account operations
78
8
  */
79
- declare class AccountService {
9
+ declare class Account {
80
10
  #private;
81
11
  constructor(api: ApiClient);
82
12
  /**
@@ -84,59 +14,59 @@ declare class AccountService {
84
14
  * @returns Promise that resolves with the account details
85
15
  * @throws {ApiError} if the request fails
86
16
  */
87
- get(): Promise<Account>;
17
+ getAccount(): Promise<Account$1>;
88
18
  /**
89
19
  * Update the authenticated user's account details
90
20
  * @param updates - Account update request
91
21
  * @returns Promise that resolves with the updated account
92
22
  * @throws {ApiError} if the request fails
93
23
  */
94
- update(updates: UpdateAccount): Promise<Account>;
24
+ updateAccount(updates: UpdateAccount): Promise<Account$1>;
95
25
  /**
96
26
  * Delete the authenticated user's account
97
27
  * @returns Promise that resolves when the account is deleted
98
28
  * @throws {ApiError} if the request fails
99
29
  */
100
- delete(): Promise<void>;
30
+ deleteAccount(): Promise<void>;
101
31
  }
102
32
 
103
33
  /**
104
34
  * Service for handling workspace activity operations
105
35
  */
106
- declare class ActivitiesService {
36
+ declare class Activities {
107
37
  #private;
108
38
  constructor(api: ApiClient);
109
39
  /**
110
40
  * List activities for a workspace
111
41
  * @param workspaceId - Workspace ID
112
- * @param query - Optional query parameters (offset, limit)
113
- * @returns Promise that resolves with the list of activities
42
+ * @param query - Optional pagination parameters (limit, after)
43
+ * @returns Promise that resolves with a paginated list of activities
114
44
  * @throws {ApiError} if the request fails
115
45
  */
116
- list(workspaceId: string, query?: Pagination): Promise<Activity[]>;
46
+ listActivities(workspaceId: string, query?: CursorPagination): Promise<ActivitiesPage>;
117
47
  }
118
48
 
119
49
  /**
120
50
  * Service for handling file annotation operations
121
51
  */
122
- declare class AnnotationsService {
52
+ declare class Annotations {
123
53
  #private;
124
54
  constructor(api: ApiClient);
125
55
  /**
126
56
  * List annotations for a file
127
57
  * @param fileId - File ID
128
- * @param query - Optional query parameters (offset, limit)
129
- * @returns Promise that resolves with the list of annotations
58
+ * @param query - Optional pagination parameters (limit, after)
59
+ * @returns Promise that resolves with a paginated list of annotations
130
60
  * @throws {ApiError} if the request fails
131
61
  */
132
- list(fileId: string, query?: Pagination): Promise<Annotation[]>;
62
+ listAnnotations(fileId: string, query?: CursorPagination): Promise<AnnotationsPage>;
133
63
  /**
134
64
  * Get annotation details by ID
135
65
  * @param annotationId - Annotation ID
136
66
  * @returns Promise that resolves with the annotation details
137
67
  * @throws {ApiError} if the request fails
138
68
  */
139
- get(annotationId: string): Promise<Annotation>;
69
+ getAnnotation(annotationId: string): Promise<Annotation>;
140
70
  /**
141
71
  * Create a new annotation
142
72
  * @param fileId - File ID
@@ -144,7 +74,7 @@ declare class AnnotationsService {
144
74
  * @returns Promise that resolves with the created annotation
145
75
  * @throws {ApiError} if the request fails
146
76
  */
147
- create(fileId: string, annotation: CreateAnnotation): Promise<Annotation>;
77
+ createAnnotation(fileId: string, annotation: CreateAnnotation): Promise<Annotation>;
148
78
  /**
149
79
  * Update an existing annotation
150
80
  * @param annotationId - Annotation ID
@@ -152,67 +82,64 @@ declare class AnnotationsService {
152
82
  * @returns Promise that resolves with the updated annotation
153
83
  * @throws {ApiError} if the request fails
154
84
  */
155
- update(annotationId: string, updates: UpdateAnnotation): Promise<Annotation>;
85
+ updateAnnotation(annotationId: string, updates: UpdateAnnotation): Promise<Annotation>;
156
86
  /**
157
87
  * Delete an annotation
158
88
  * @param annotationId - Annotation ID
159
89
  * @returns Promise that resolves when the annotation is deleted
160
90
  * @throws {ApiError} if the request fails
161
91
  */
162
- delete(annotationId: string): Promise<void>;
92
+ deleteAnnotation(annotationId: string): Promise<void>;
163
93
  }
164
94
 
165
95
  /**
166
96
  * Service for handling API token operations
167
97
  */
168
- declare class ApiTokensService {
98
+ declare class ApiTokens {
169
99
  #private;
170
100
  constructor(api: ApiClient);
171
101
  /**
172
102
  * List all API tokens for the authenticated account
173
- * @param options - Pagination options
174
- * @returns Promise that resolves with the list of API tokens
103
+ * @param query - Optional pagination parameters (limit, after)
104
+ * @returns Promise that resolves with a paginated list of API tokens
175
105
  * @throws {ApiError} if the request fails
176
106
  */
177
- list(options?: {
178
- offset?: number;
179
- limit?: number;
180
- }): Promise<ApiToken[]>;
107
+ listApiTokens(query?: CursorPagination): Promise<ApiTokensPage>;
181
108
  /**
182
- * Get a specific API token by access token
183
- * @param accessToken - The access token identifier
109
+ * Get a specific API token by token ID
110
+ * @param tokenId - The token identifier
184
111
  * @returns Promise that resolves with the API token details
185
112
  * @throws {ApiError} if the request fails
186
113
  */
187
- get(accessToken: string): Promise<ApiToken>;
114
+ getApiToken(tokenId: string): Promise<ApiToken>;
188
115
  /**
189
116
  * Create a new API token
190
117
  * @param token - Token creation request
191
- * @returns Promise that resolves with the created token (includes secret, shown only once)
118
+ * @returns Promise that resolves with the created token (includes JWT, shown only once)
192
119
  * @throws {ApiError} if the request fails
193
120
  */
194
- create(token: CreateApiToken): Promise<ApiTokenWithSecret>;
121
+ createApiToken(token: CreateApiToken): Promise<ApiTokenWithJWT>;
195
122
  /**
196
123
  * Update an existing API token
197
- * @param accessToken - The access token identifier
124
+ * @param tokenId - The token identifier
198
125
  * @param updates - Token update request
199
126
  * @returns Promise that resolves with the updated token
200
127
  * @throws {ApiError} if the request fails
201
128
  */
202
- update(accessToken: string, updates: UpdateApiToken): Promise<ApiToken>;
129
+ updateApiToken(tokenId: string, updates: UpdateApiToken): Promise<ApiToken>;
203
130
  /**
204
131
  * Revoke an API token
205
- * @param accessToken - The access token identifier
132
+ * @param tokenId - The token identifier
206
133
  * @returns Promise that resolves when the token is revoked
207
134
  * @throws {ApiError} if the request fails
208
135
  */
209
- revoke(accessToken: string): Promise<void>;
136
+ revokeApiToken(tokenId: string): Promise<void>;
210
137
  }
211
138
 
212
139
  /**
213
140
  * Service for handling authentication operations
214
141
  */
215
- declare class AuthService {
142
+ declare class Auth {
216
143
  #private;
217
144
  constructor(api: ApiClient);
218
145
  /**
@@ -221,30 +148,36 @@ declare class AuthService {
221
148
  * @returns Promise that resolves with the auth response containing access token
222
149
  * @throws {ApiError} if the request fails
223
150
  */
224
- login(credentials: Login): Promise<AuthToken>;
151
+ loginAccount(credentials: Login): Promise<AuthToken>;
225
152
  /**
226
153
  * Sign up a new account
227
- * @param details - Signup details
154
+ * @param credentials - Signup details
228
155
  * @returns Promise that resolves with the auth response containing access token
229
156
  * @throws {ApiError} if the request fails
230
157
  */
231
- signup(details: Signup): Promise<AuthToken>;
158
+ signupAccount(credentials: Signup): Promise<AuthToken>;
159
+ /**
160
+ * Logout and invalidate the current access token
161
+ * @returns Promise that resolves when logout is complete
162
+ * @throws {ApiError} if the request fails
163
+ */
164
+ logoutAccount(): Promise<void>;
232
165
  }
233
166
 
234
167
  /**
235
168
  * Service for handling file comment operations
236
169
  */
237
- declare class CommentsService {
170
+ declare class Comments {
238
171
  #private;
239
172
  constructor(api: ApiClient);
240
173
  /**
241
174
  * List all comments on a file
242
175
  * @param fileId - File ID
243
- * @param query - Optional query parameters (offset, limit)
244
- * @returns Promise that resolves with the list of comments
176
+ * @param query - Optional pagination parameters (limit, after)
177
+ * @returns Promise that resolves with a paginated list of comments
245
178
  * @throws {ApiError} if the request fails
246
179
  */
247
- list(fileId: string, query?: Pagination): Promise<Comment[]>;
180
+ listComments(fileId: string, query?: CursorPagination): Promise<CommentsPage>;
248
181
  /**
249
182
  * Create a new comment on a file
250
183
  * @param fileId - File ID
@@ -252,38 +185,45 @@ declare class CommentsService {
252
185
  * @returns Promise that resolves with the created comment
253
186
  * @throws {ApiError} if the request fails
254
187
  */
255
- create(fileId: string, comment: CreateComment): Promise<Comment>;
188
+ createComment(fileId: string, comment: CreateComment): Promise<Comment>;
189
+ /**
190
+ * Update a comment
191
+ * @param commentId - Comment ID
192
+ * @param updates - Comment update request
193
+ * @returns Promise that resolves with the updated comment
194
+ * @throws {ApiError} if the request fails
195
+ */
196
+ updateComment(commentId: string, updates: UpdateComment): Promise<Comment>;
256
197
  /**
257
198
  * Delete a comment
258
- * @param fileId - File ID
259
199
  * @param commentId - Comment ID
260
200
  * @returns Promise that resolves when the comment is deleted
261
201
  * @throws {ApiError} if the request fails
262
202
  */
263
- delete(fileId: string, commentId: string): Promise<void>;
203
+ deleteComment(commentId: string): Promise<void>;
264
204
  }
265
205
 
266
206
  /**
267
207
  * Service for handling document operations
268
208
  */
269
- declare class DocumentsService {
209
+ declare class Documents {
270
210
  #private;
271
211
  constructor(api: ApiClient);
272
212
  /**
273
213
  * List documents in a workspace
274
214
  * @param workspaceId - Workspace ID
275
- * @param query - Optional query parameters (offset, limit)
276
- * @returns Promise that resolves with the list of documents
215
+ * @param query - Optional pagination parameters (limit, after)
216
+ * @returns Promise that resolves with a paginated list of documents
277
217
  * @throws {ApiError} if the request fails
278
218
  */
279
- list(workspaceId: string, query?: Pagination): Promise<Document[]>;
219
+ listDocuments(workspaceId: string, query?: CursorPagination): Promise<DocumentsPage>;
280
220
  /**
281
221
  * Get document details by ID
282
222
  * @param documentId - Document ID
283
223
  * @returns Promise that resolves with the document details
284
224
  * @throws {ApiError} if the request fails
285
225
  */
286
- get(documentId: string): Promise<Document>;
226
+ getDocument(documentId: string): Promise<Document>;
287
227
  /**
288
228
  * Create a new document
289
229
  * @param workspaceId - Workspace ID
@@ -291,7 +231,7 @@ declare class DocumentsService {
291
231
  * @returns Promise that resolves with the created document
292
232
  * @throws {ApiError} if the request fails
293
233
  */
294
- create(workspaceId: string, document: CreateDocument): Promise<Document>;
234
+ createDocument(workspaceId: string, document: CreateDocument): Promise<Document>;
295
235
  /**
296
236
  * Update an existing document
297
237
  * @param documentId - Document ID
@@ -299,37 +239,52 @@ declare class DocumentsService {
299
239
  * @returns Promise that resolves with the updated document
300
240
  * @throws {ApiError} if the request fails
301
241
  */
302
- update(documentId: string, updates: UpdateDocument): Promise<Document>;
242
+ updateDocument(documentId: string, updates: UpdateDocument): Promise<Document>;
303
243
  /**
304
244
  * Delete a document
305
245
  * @param documentId - Document ID
306
246
  * @returns Promise that resolves when the document is deleted
307
247
  * @throws {ApiError} if the request fails
308
248
  */
309
- delete(documentId: string): Promise<void>;
249
+ deleteDocument(documentId: string): Promise<void>;
310
250
  }
311
251
 
312
252
  /**
313
253
  * Service for handling file operations
314
254
  */
315
- declare class FilesService {
255
+ declare class Files {
316
256
  #private;
317
257
  constructor(api: ApiClient);
258
+ /**
259
+ * Upload one or more files to a workspace
260
+ * @param workspaceId - Workspace ID
261
+ * @param files - File or array of files to upload
262
+ * @returns Promise that resolves with the uploaded file metadata
263
+ * @throws {ApiError} if the request fails
264
+ */
265
+ uploadFiles(workspaceId: string, files: Blob | Blob[]): Promise<File[]>;
318
266
  /**
319
267
  * List files in a workspace
320
268
  * @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
269
+ * @param query - Optional query parameters (formats, limit, after)
270
+ * @returns Promise that resolves with a paginated list of files
271
+ * @throws {ApiError} if the request fails
272
+ */
273
+ listFiles(workspaceId: string, query?: ListFiles & CursorPagination): Promise<FilesPage>;
274
+ /**
275
+ * Get file metadata by ID
276
+ * @param fileId - File ID
277
+ * @returns Promise that resolves with the file metadata
323
278
  * @throws {ApiError} if the request fails
324
279
  */
325
- list(workspaceId: string, query?: ListFilesQuery & Pagination): Promise<File[]>;
280
+ getFile(fileId: string): Promise<File>;
326
281
  /**
327
282
  * Download a file by ID
328
283
  * @param fileId - File ID
329
284
  * @returns Promise that resolves with the file response
330
285
  * @throws {ApiError} if the request fails
331
286
  */
332
- download(fileId: string): Promise<Response>;
287
+ downloadFile(fileId: string): Promise<Response>;
333
288
  /**
334
289
  * Update a file's metadata
335
290
  * @param fileId - File ID
@@ -337,53 +292,53 @@ declare class FilesService {
337
292
  * @returns Promise that resolves with the updated file
338
293
  * @throws {ApiError} if the request fails
339
294
  */
340
- update(fileId: string, updates: UpdateFile): Promise<File>;
295
+ updateFile(fileId: string, updates: UpdateFile): Promise<File>;
341
296
  /**
342
297
  * Delete a file
343
298
  * @param fileId - File ID
344
299
  * @returns Promise that resolves when the file is deleted
345
300
  * @throws {ApiError} if the request fails
346
301
  */
347
- delete(fileId: string): Promise<void>;
302
+ deleteFile(fileId: string): Promise<void>;
348
303
  /**
349
- * Download multiple files
304
+ * Download files as an archive
350
305
  * @param workspaceId - Workspace ID
351
- * @param request - Download request with file IDs
352
- * @returns Promise that resolves with the download response
306
+ * @param request - Download request with format and optional file IDs
307
+ * @returns Promise that resolves with the archive response
353
308
  * @throws {ApiError} if the request fails
354
309
  */
355
- downloadMultiple(workspaceId: string, request: DownloadMultipleFilesRequest): Promise<Response>;
310
+ downloadFiles(workspaceId: string, request: DownloadFiles): Promise<Response>;
356
311
  /**
357
- * Download files as an archive
312
+ * Delete multiple files
358
313
  * @param workspaceId - Workspace ID
359
- * @param request - Archive download request
360
- * @returns Promise that resolves with the archive response
314
+ * @param request - Delete request with file IDs
315
+ * @returns Promise that resolves when the files are deleted
361
316
  * @throws {ApiError} if the request fails
362
317
  */
363
- downloadArchive(workspaceId: string, request: DownloadArchivedFilesRequest): Promise<Response>;
318
+ deleteFiles(workspaceId: string, request: DeleteFiles): Promise<void>;
364
319
  }
365
320
 
366
321
  /**
367
322
  * Service for handling integration operations
368
323
  */
369
- declare class IntegrationsService {
324
+ declare class Integrations {
370
325
  #private;
371
326
  constructor(api: ApiClient);
372
327
  /**
373
328
  * List integrations for a workspace
374
329
  * @param workspaceId - Workspace ID
375
- * @param query - Optional query parameters (integrationType, offset, limit)
376
- * @returns Promise that resolves with the list of integrations
330
+ * @param query - Optional pagination parameters (limit, after)
331
+ * @returns Promise that resolves with a paginated list of integrations
377
332
  * @throws {ApiError} if the request fails
378
333
  */
379
- list(workspaceId: string, query?: ListIntegrationsQuery & Pagination): Promise<Integration[]>;
334
+ listIntegrations(workspaceId: string, query?: CursorPagination): Promise<IntegrationsPage>;
380
335
  /**
381
336
  * Get integration details by ID
382
337
  * @param integrationId - Integration ID
383
338
  * @returns Promise that resolves with the integration details
384
339
  * @throws {ApiError} if the request fails
385
340
  */
386
- get(integrationId: string): Promise<Integration>;
341
+ getIntegration(integrationId: string): Promise<Integration>;
387
342
  /**
388
343
  * Create a new integration
389
344
  * @param workspaceId - Workspace ID
@@ -391,7 +346,7 @@ declare class IntegrationsService {
391
346
  * @returns Promise that resolves with the created integration
392
347
  * @throws {ApiError} if the request fails
393
348
  */
394
- create(workspaceId: string, integration: CreateIntegration): Promise<Integration>;
349
+ createIntegration(workspaceId: string, integration: CreateIntegration): Promise<Integration>;
395
350
  /**
396
351
  * Update an existing integration
397
352
  * @param integrationId - Integration ID
@@ -399,7 +354,7 @@ declare class IntegrationsService {
399
354
  * @returns Promise that resolves with the updated integration
400
355
  * @throws {ApiError} if the request fails
401
356
  */
402
- update(integrationId: string, updates: UpdateIntegration): Promise<Integration>;
357
+ updateIntegration(integrationId: string, updates: UpdateIntegration): Promise<Integration>;
403
358
  /**
404
359
  * Update integration credentials
405
360
  * @param integrationId - Integration ID
@@ -407,30 +362,30 @@ declare class IntegrationsService {
407
362
  * @returns Promise that resolves with the updated integration
408
363
  * @throws {ApiError} if the request fails
409
364
  */
410
- updateCredentials(integrationId: string, credentials: UpdateIntegrationCredentials): Promise<Integration>;
365
+ updateIntegrationCredentials(integrationId: string, credentials: UpdateIntegrationCredentials): Promise<Integration>;
411
366
  /**
412
367
  * Delete an integration
413
368
  * @param integrationId - Integration ID
414
369
  * @returns Promise that resolves when the integration is deleted
415
370
  * @throws {ApiError} if the request fails
416
371
  */
417
- delete(integrationId: string): Promise<void>;
372
+ deleteIntegration(integrationId: string): Promise<void>;
418
373
  }
419
374
 
420
375
  /**
421
376
  * Service for handling workspace invitation operations
422
377
  */
423
- declare class InvitesService {
378
+ declare class Invites {
424
379
  #private;
425
380
  constructor(api: ApiClient);
426
381
  /**
427
382
  * List all invitations for a workspace
428
383
  * @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
384
+ * @param query - Optional query parameters (role, sortBy, order, limit, after)
385
+ * @returns Promise that resolves with a paginated list of invitations
431
386
  * @throws {ApiError} if the request fails
432
387
  */
433
- list(workspaceId: string, query?: ListInvitesQuery & Pagination): Promise<Invite[]>;
388
+ listInvites(workspaceId: string, query?: ListInvites & CursorPagination): Promise<InvitesPage>;
434
389
  /**
435
390
  * Send an invitation to join a workspace
436
391
  * @param workspaceId - Workspace ID
@@ -438,14 +393,14 @@ declare class InvitesService {
438
393
  * @returns Promise that resolves with the created invitation
439
394
  * @throws {ApiError} if the request fails
440
395
  */
441
- send(workspaceId: string, invite: CreateInvite): Promise<Invite>;
396
+ sendInvite(workspaceId: string, invite: CreateInvite): Promise<Invite>;
442
397
  /**
443
398
  * Cancel a pending invitation
444
399
  * @param inviteId - Invite ID
445
400
  * @returns Promise that resolves when the invitation is canceled
446
401
  * @throws {ApiError} if the request fails
447
402
  */
448
- cancel(inviteId: string): Promise<void>;
403
+ cancelInvite(inviteId: string): Promise<void>;
449
404
  /**
450
405
  * Reply to an invitation (accept or decline)
451
406
  * @param inviteId - Invite ID
@@ -453,7 +408,7 @@ declare class InvitesService {
453
408
  * @returns Promise that resolves with the updated invitation
454
409
  * @throws {ApiError} if the request fails
455
410
  */
456
- reply(inviteId: string, reply: ReplyInvite): Promise<Invite>;
411
+ replyToInvite(inviteId: string, reply: ReplyInvite): Promise<Invite>;
457
412
  /**
458
413
  * Generate a shareable invite code for a workspace
459
414
  * @param workspaceId - Workspace ID
@@ -461,30 +416,38 @@ declare class InvitesService {
461
416
  * @returns Promise that resolves with the generated invite code
462
417
  * @throws {ApiError} if the request fails
463
418
  */
464
- generateCode(workspaceId: string, options: GenerateInviteCode): Promise<InviteCode>;
419
+ generateInviteCode(workspaceId: string, options: GenerateInviteCode): Promise<InviteCode>;
465
420
  /**
466
- * Join a workspace using an invite code
421
+ * Reply to an invite code (accept or decline)
467
422
  * @param inviteCode - The invite code
468
- * @returns Promise that resolves with the member details
423
+ * @param reply - Optional reply request (defaults to accept if not provided)
424
+ * @returns Promise that resolves with the member details if accepted, null if declined
425
+ * @throws {ApiError} if the request fails
426
+ */
427
+ replyToInviteCode(inviteCode: string, reply?: ReplyInvite | null): Promise<Member | null>;
428
+ /**
429
+ * Preview an invite code without joining
430
+ * @param inviteCode - The invite code
431
+ * @returns Promise that resolves with the invite preview details
469
432
  * @throws {ApiError} if the request fails
470
433
  */
471
- joinWithCode(inviteCode: string): Promise<Member>;
434
+ previewInvite(inviteCode: string): Promise<InvitePreview>;
472
435
  }
473
436
 
474
437
  /**
475
438
  * Service for handling member operations
476
439
  */
477
- declare class MembersService {
440
+ declare class Members {
478
441
  #private;
479
442
  constructor(api: ApiClient);
480
443
  /**
481
444
  * List members of a workspace
482
445
  * @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
446
+ * @param query - Optional query parameters (role, has2fa, sortBy, order, limit, after)
447
+ * @returns Promise that resolves with a paginated list of members
485
448
  * @throws {ApiError} if the request fails
486
449
  */
487
- list(workspaceId: string, query?: ListMembersQuery & Pagination): Promise<Member[]>;
450
+ listMembers(workspaceId: string, query?: ListMembers & CursorPagination): Promise<MembersPage>;
488
451
  /**
489
452
  * Get member details by account ID
490
453
  * @param workspaceId - Workspace ID
@@ -492,16 +455,16 @@ declare class MembersService {
492
455
  * @returns Promise that resolves with the member details
493
456
  * @throws {ApiError} if the request fails
494
457
  */
495
- get(workspaceId: string, accountId: string): Promise<Member>;
458
+ getMember(workspaceId: string, accountId: string): Promise<Member>;
496
459
  /**
497
460
  * Update a member's role
498
461
  * @param workspaceId - Workspace ID
499
462
  * @param accountId - Account ID
500
- * @param role - New role for the member
463
+ * @param updates - New role for the member
501
464
  * @returns Promise that resolves with the updated member
502
465
  * @throws {ApiError} if the request fails
503
466
  */
504
- updateRole(workspaceId: string, accountId: string, role: UpdateMemberRole): Promise<Member>;
467
+ updateMember(workspaceId: string, accountId: string, updates: UpdateMember): Promise<Member>;
505
468
  /**
506
469
  * Remove a member from a workspace
507
470
  * @param workspaceId - Workspace ID
@@ -509,58 +472,64 @@ declare class MembersService {
509
472
  * @returns Promise that resolves when the member is removed
510
473
  * @throws {ApiError} if the request fails
511
474
  */
512
- remove(workspaceId: string, accountId: string): Promise<void>;
475
+ removeMember(workspaceId: string, accountId: string): Promise<void>;
513
476
  /**
514
477
  * Leave a workspace
515
478
  * @param workspaceId - Workspace ID
516
479
  * @returns Promise that resolves when the member has left
517
480
  * @throws {ApiError} if the request fails
518
481
  */
519
- leave(workspaceId: string): Promise<void>;
482
+ leaveWorkspace(workspaceId: string): Promise<void>;
520
483
  }
521
484
 
522
485
  /**
523
486
  * Service for handling account notification operations
524
487
  */
525
- declare class NotificationsService {
488
+ declare class Notifications {
526
489
  #private;
527
490
  constructor(api: ApiClient);
528
491
  /**
529
492
  * List notifications for the authenticated account
530
- * @param query - Optional query parameters (offset, limit)
531
- * @returns Promise that resolves with the list of notifications
493
+ * @param query - Optional pagination parameters (limit, after)
494
+ * @returns Promise that resolves with a paginated list of notifications
532
495
  * @throws {ApiError} if the request fails
533
496
  */
534
- list(query?: Pagination): Promise<Notification[]>;
497
+ listNotifications(query?: CursorPagination): Promise<NotificationsPage>;
498
+ /**
499
+ * Get the unread notifications count for the authenticated account
500
+ * @returns Promise that resolves with the unread status
501
+ * @throws {ApiError} if the request fails
502
+ */
503
+ getUnreadNotificationsStatus(): Promise<UnreadStatus>;
535
504
  }
536
505
 
537
506
  /**
538
507
  * Service for handling integration run operations
539
508
  */
540
- declare class RunsService {
509
+ declare class Runs {
541
510
  #private;
542
511
  constructor(api: ApiClient);
543
512
  /**
544
513
  * List integration runs for a workspace
545
514
  * @param workspaceId - Workspace ID
546
- * @param query - Optional query parameters (offset, limit)
547
- * @returns Promise that resolves with the list of integration runs
515
+ * @param query - Optional pagination parameters (limit, after)
516
+ * @returns Promise that resolves with a paginated list of integration runs
548
517
  * @throws {ApiError} if the request fails
549
518
  */
550
- list(workspaceId: string, query?: Pagination): Promise<IntegrationRun[]>;
519
+ listRuns(workspaceId: string, query?: CursorPagination): Promise<IntegrationRunsPage>;
551
520
  /**
552
521
  * Get integration run details by ID
553
522
  * @param runId - Run ID
554
523
  * @returns Promise that resolves with the integration run details
555
524
  * @throws {ApiError} if the request fails
556
525
  */
557
- get(runId: string): Promise<IntegrationRun>;
526
+ getRun(runId: string): Promise<IntegrationRun>;
558
527
  }
559
528
 
560
529
  /**
561
530
  * Service for handling status and health check operations
562
531
  */
563
- declare class StatusService {
532
+ declare class Status {
564
533
  #private;
565
534
  constructor(api: ApiClient);
566
535
  /**
@@ -568,37 +537,38 @@ declare class StatusService {
568
537
  * @param options - Health check options
569
538
  * @returns Promise that resolves with the API health status
570
539
  */
571
- health(options?: CheckHealth): Promise<MonitorStatus>;
540
+ checkHealth(options?: CheckHealth): Promise<MonitorStatus>;
572
541
  }
573
542
 
574
543
  /**
575
544
  * Service for handling webhook operations
576
545
  */
577
- declare class WebhooksService {
546
+ declare class Webhooks {
578
547
  #private;
579
548
  constructor(api: ApiClient);
580
549
  /**
581
550
  * List all webhooks in a workspace
582
551
  * @param workspaceId - Workspace ID
583
- * @returns Promise that resolves with the list of webhooks
552
+ * @param query - Optional pagination parameters (limit, after)
553
+ * @returns Promise that resolves with a paginated list of webhooks
584
554
  * @throws {ApiError} if the request fails
585
555
  */
586
- list(workspaceId: string): Promise<Webhook[]>;
556
+ listWebhooks(workspaceId: string, query?: CursorPagination): Promise<WebhooksPage>;
587
557
  /**
588
558
  * Get a specific webhook by ID
589
559
  * @param webhookId - Webhook ID
590
560
  * @returns Promise that resolves with the webhook details
591
561
  * @throws {ApiError} if the request fails
592
562
  */
593
- get(webhookId: string): Promise<Webhook>;
563
+ getWebhook(webhookId: string): Promise<Webhook>;
594
564
  /**
595
565
  * Create a new webhook
596
566
  * @param workspaceId - Workspace ID
597
567
  * @param webhook - Webhook creation request
598
- * @returns Promise that resolves with the created webhook (includes secret, shown only once)
568
+ * @returns Promise that resolves with the created webhook
599
569
  * @throws {ApiError} if the request fails
600
570
  */
601
- create(workspaceId: string, webhook: CreateWebhook): Promise<WebhookWithSecret>;
571
+ createWebhook(workspaceId: string, webhook: CreateWebhook): Promise<Webhook>;
602
572
  /**
603
573
  * Update an existing webhook
604
574
  * @param webhookId - Webhook ID
@@ -606,43 +576,51 @@ declare class WebhooksService {
606
576
  * @returns Promise that resolves with the updated webhook
607
577
  * @throws {ApiError} if the request fails
608
578
  */
609
- update(webhookId: string, updates: UpdateWebhook): Promise<Webhook>;
579
+ updateWebhook(webhookId: string, updates: UpdateWebhook): Promise<Webhook>;
610
580
  /**
611
581
  * Delete a webhook
612
582
  * @param webhookId - Webhook ID
613
583
  * @returns Promise that resolves when the webhook is deleted
614
584
  * @throws {ApiError} if the request fails
615
585
  */
616
- delete(webhookId: string): Promise<void>;
586
+ deleteWebhook(webhookId: string): Promise<void>;
587
+ /**
588
+ * Test a webhook by sending a test payload
589
+ * @param webhookId - Webhook ID
590
+ * @param options - Test webhook options
591
+ * @returns Promise that resolves with the test result
592
+ * @throws {ApiError} if the request fails
593
+ */
594
+ testWebhook(webhookId: string, options?: TestWebhook): Promise<WebhookResult>;
617
595
  }
618
596
 
619
597
  /**
620
598
  * Service for handling workspace operations
621
599
  */
622
- declare class WorkspacesService {
600
+ declare class Workspaces {
623
601
  #private;
624
602
  constructor(api: ApiClient);
625
603
  /**
626
604
  * List all workspaces
627
- * @param query - Optional query parameters (offset, limit)
628
- * @returns Promise that resolves with the list of workspaces
605
+ * @param query - Optional pagination parameters (limit, after)
606
+ * @returns Promise that resolves with a paginated list of workspaces
629
607
  * @throws {ApiError} if the request fails
630
608
  */
631
- list(query?: Pagination): Promise<Workspace[]>;
609
+ listWorkspaces(query?: CursorPagination): Promise<WorkspacesPage>;
632
610
  /**
633
611
  * Get workspace details by ID
634
612
  * @param workspaceId - Workspace ID
635
613
  * @returns Promise that resolves with the workspace details
636
614
  * @throws {ApiError} if the request fails
637
615
  */
638
- get(workspaceId: string): Promise<Workspace>;
616
+ getWorkspace(workspaceId: string): Promise<Workspace>;
639
617
  /**
640
618
  * Create a new workspace
641
619
  * @param workspace - Workspace creation request
642
620
  * @returns Promise that resolves with the created workspace
643
621
  * @throws {ApiError} if the request fails
644
622
  */
645
- create(workspace: CreateWorkspace): Promise<Workspace>;
623
+ createWorkspace(workspace: CreateWorkspace): Promise<Workspace>;
646
624
  /**
647
625
  * Update an existing workspace
648
626
  * @param workspaceId - Workspace ID
@@ -650,28 +628,43 @@ declare class WorkspacesService {
650
628
  * @returns Promise that resolves with the updated workspace
651
629
  * @throws {ApiError} if the request fails
652
630
  */
653
- update(workspaceId: string, updates: UpdateWorkspace): Promise<Workspace>;
631
+ updateWorkspace(workspaceId: string, updates: UpdateWorkspace): Promise<Workspace>;
654
632
  /**
655
633
  * Delete a workspace
656
634
  * @param workspaceId - Workspace ID
657
635
  * @returns Promise that resolves when the workspace is deleted
658
636
  * @throws {ApiError} if the request fails
659
637
  */
660
- delete(workspaceId: string): Promise<void>;
638
+ deleteWorkspace(workspaceId: string): Promise<void>;
639
+ /**
640
+ * Get notification settings for the authenticated user in a workspace
641
+ * @param workspaceId - Workspace ID
642
+ * @returns Promise that resolves with the notification settings
643
+ * @throws {ApiError} if the request fails
644
+ */
645
+ getNotificationSettings(workspaceId: string): Promise<NotificationSettings>;
646
+ /**
647
+ * Update notification settings for the authenticated user in a workspace
648
+ * @param workspaceId - Workspace ID
649
+ * @param settings - Notification settings update request
650
+ * @returns Promise that resolves with the updated notification settings
651
+ * @throws {ApiError} if the request fails
652
+ */
653
+ updateNotificationSettings(workspaceId: string, settings: UpdateNotificationSettings): Promise<NotificationSettings>;
661
654
  }
662
655
 
663
656
  /**
664
657
  * @fileoverview Main client for the Nvisy SDK.
665
658
  *
666
- * This module exports the {@link Client} class, which is the primary entry point
659
+ * This module exports the {@link Nvisy} class, which is the primary entry point
667
660
  * for interacting with the Nvisy document processing API.
668
661
  *
669
662
  * @module client
670
663
  *
671
664
  * @example
672
665
  * ```typescript
673
- * const client = new Client({ apiToken: "your-api-token" });
674
- * const account = await client.account.get();
666
+ * const nvisy = new Nvisy({ apiToken: "your-api-token" });
667
+ * const account = await nvisy.account.getAccount();
675
668
  * ```
676
669
  */
677
670
 
@@ -679,34 +672,34 @@ declare class WorkspacesService {
679
672
  * Typed openapi-fetch client for the Nvisy API.
680
673
  *
681
674
  * 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.
675
+ * It's exposed via {@link Nvisy.api} for advanced use cases requiring direct API access.
683
676
  */
684
- type ApiClient = Client$1<paths>;
677
+ type ApiClient = Client<paths>;
685
678
  /**
686
679
  * Main client class for interacting with the Nvisy document processing API.
687
680
  *
688
681
  * @example
689
682
  * ```typescript
690
- * const client = new Client({ apiToken: "your-api-token" });
691
- * const account = await client.account.get();
692
- * const workspaces = await client.workspaces.list();
683
+ * const nvisy = new Nvisy({ apiToken: "your-api-token" });
684
+ * const account = await nvisy.account.getAccount();
685
+ * const workspaces = await nvisy.workspaces.listWorkspaces();
693
686
  * ```
694
687
  */
695
- declare class Client {
688
+ declare class Nvisy {
696
689
  #private;
697
690
  /**
698
691
  * Creates a new Nvisy client instance.
699
692
  *
700
693
  * @param config - Configuration options with required `apiToken`
701
- * @throws {ConfigError} If the API token is invalid
694
+ * @throws {NvisyError} If the API token is invalid
702
695
  *
703
696
  * @example
704
697
  * ```typescript
705
- * const client = new Client({
698
+ * const nvisy = new Nvisy({
706
699
  * apiToken: "your-api-token",
707
700
  * baseUrl: "https://custom.api.nvisy.com",
708
701
  * });
709
- * const account = await client.account.get();
702
+ * const account = await nvisy.account.getAccount();
710
703
  * ```
711
704
  */
712
705
  constructor(config: ClientConfig);
@@ -718,19 +711,19 @@ declare class Client {
718
711
  * is preserved in the new client.
719
712
  *
720
713
  * @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
714
+ * @returns A new Nvisy instance with the new token
715
+ * @throws {NvisyError} If the API token is invalid
723
716
  *
724
717
  * @example
725
718
  * ```typescript
726
- * const client = new Client({ apiToken: "original-token" });
727
- * const newClient = client.withApiToken("new-token");
719
+ * const nvisy = new Nvisy({ apiToken: "original-token" });
720
+ * const newNvisy = nvisy.withApiToken("new-token");
728
721
  *
729
- * // newClient uses the new token
730
- * // client still uses the original token
722
+ * // newNvisy uses the new token
723
+ * // nvisy still uses the original token
731
724
  * ```
732
725
  */
733
- withApiToken(apiToken: string): Client;
726
+ withApiToken(apiToken: string): Nvisy;
734
727
  /**
735
728
  * The base URL used for API requests.
736
729
  *
@@ -748,76 +741,68 @@ declare class Client {
748
741
  get api(): ApiClient;
749
742
  /**
750
743
  * Service for authentication operations (login, signup, logout).
751
- *
752
- * @returns The AuthService instance
753
744
  */
754
- get auth(): AuthService;
745
+ get auth(): Auth;
755
746
  /**
756
747
  * Service for API status and health checks.
757
- *
758
- * @returns The StatusService instance
759
748
  */
760
- get status(): StatusService;
749
+ get status(): Status;
761
750
  /**
762
751
  * Service for managing the authenticated user's account.
763
- *
764
- * @returns The AccountService instance
765
752
  */
766
- get account(): AccountService;
753
+ get account(): Account;
754
+ /**
755
+ * Service for viewing workspace activities.
756
+ */
757
+ get activities(): Activities;
758
+ /**
759
+ * Service for managing file annotations.
760
+ */
761
+ get annotations(): Annotations;
767
762
  /**
768
763
  * Service for managing API tokens.
769
- *
770
- * @returns The ApiTokensService instance
771
764
  */
772
- get apiTokens(): ApiTokensService;
765
+ get apiTokens(): ApiTokens;
773
766
  /**
774
767
  * Service for managing file comments.
775
- *
776
- * @returns The CommentsService instance
777
768
  */
778
- get comments(): CommentsService;
769
+ get comments(): Comments;
779
770
  /**
780
771
  * Service for document operations.
781
- *
782
- * @returns The DocumentsService instance
783
772
  */
784
- get documents(): DocumentsService;
773
+ get documents(): Documents;
785
774
  /**
786
775
  * Service for file operations (upload, download, delete).
787
- *
788
- * @returns The FilesService instance
789
776
  */
790
- get files(): FilesService;
777
+ get files(): Files;
791
778
  /**
792
779
  * Service for managing integrations.
793
- *
794
- * @returns The IntegrationsService instance
795
780
  */
796
- get integrations(): IntegrationsService;
781
+ get integrations(): Integrations;
797
782
  /**
798
783
  * Service for managing workspace invitations.
799
- *
800
- * @returns The InvitesService instance
801
784
  */
802
- get invites(): InvitesService;
785
+ get invites(): Invites;
803
786
  /**
804
787
  * Service for managing workspace members.
805
- *
806
- * @returns The MembersService instance
807
788
  */
808
- get members(): MembersService;
789
+ get members(): Members;
790
+ /**
791
+ * Service for managing notifications.
792
+ */
793
+ get notifications(): Notifications;
794
+ /**
795
+ * Service for managing processing runs.
796
+ */
797
+ get runs(): Runs;
809
798
  /**
810
799
  * Service for managing webhooks.
811
- *
812
- * @returns The WebhooksService instance
813
800
  */
814
- get webhooks(): WebhooksService;
801
+ get webhooks(): Webhooks;
815
802
  /**
816
803
  * Service for managing workspaces.
817
- *
818
- * @returns The WorkspacesService instance
819
804
  */
820
- get workspaces(): WorkspacesService;
805
+ get workspaces(): Workspaces;
821
806
  }
822
807
 
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 };
808
+ export { type ApiClient as A, Comments as C, Documents as D, Files as F, Integrations as I, Members as M, Nvisy as N, Runs as R, Status as S, Webhooks as W, Account as a, Activities as b, Annotations as c, ApiTokens as d, Auth as e, Invites as f, Notifications as g, Workspaces as h };