@lidia.poet/sdk 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.
Files changed (92) hide show
  1. package/README.md +605 -0
  2. package/dist/LidiaSDK.d.ts +62 -0
  3. package/dist/LidiaSDK.d.ts.map +1 -0
  4. package/dist/client/LidiaClient.d.ts +24 -0
  5. package/dist/client/LidiaClient.d.ts.map +1 -0
  6. package/dist/errors/LidiaError.d.ts +31 -0
  7. package/dist/errors/LidiaError.d.ts.map +1 -0
  8. package/dist/errors/NetworkError.d.ts +17 -0
  9. package/dist/errors/NetworkError.d.ts.map +1 -0
  10. package/dist/errors/ValidationError.d.ts +26 -0
  11. package/dist/errors/ValidationError.d.ts.map +1 -0
  12. package/dist/index.d.ts +48 -0
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/index.esm.js +1463 -0
  15. package/dist/index.js +1524 -0
  16. package/dist/services/AuthorizationService.d.ts +87 -0
  17. package/dist/services/AuthorizationService.d.ts.map +1 -0
  18. package/dist/services/CaseService.d.ts +24 -0
  19. package/dist/services/CaseService.d.ts.map +1 -0
  20. package/dist/services/ConversationService.d.ts +43 -0
  21. package/dist/services/ConversationService.d.ts.map +1 -0
  22. package/dist/services/ConversationTemplateService.d.ts +17 -0
  23. package/dist/services/ConversationTemplateService.d.ts.map +1 -0
  24. package/dist/services/DocumentService.d.ts +37 -0
  25. package/dist/services/DocumentService.d.ts.map +1 -0
  26. package/dist/services/FavoritesService.d.ts +15 -0
  27. package/dist/services/FavoritesService.d.ts.map +1 -0
  28. package/dist/services/FolderService.d.ts +15 -0
  29. package/dist/services/FolderService.d.ts.map +1 -0
  30. package/dist/services/HealthService.d.ts +8 -0
  31. package/dist/services/HealthService.d.ts.map +1 -0
  32. package/dist/services/LegisratioService.d.ts +11 -0
  33. package/dist/services/LegisratioService.d.ts.map +1 -0
  34. package/dist/services/MessageService.d.ts +27 -0
  35. package/dist/services/MessageService.d.ts.map +1 -0
  36. package/dist/services/NotificationService.d.ts +15 -0
  37. package/dist/services/NotificationService.d.ts.map +1 -0
  38. package/dist/services/OrganizationService.d.ts +23 -0
  39. package/dist/services/OrganizationService.d.ts.map +1 -0
  40. package/dist/services/SmartAnswerService.d.ts +13 -0
  41. package/dist/services/SmartAnswerService.d.ts.map +1 -0
  42. package/dist/services/TagService.d.ts +13 -0
  43. package/dist/services/TagService.d.ts.map +1 -0
  44. package/dist/services/UserService.d.ts +21 -0
  45. package/dist/services/UserService.d.ts.map +1 -0
  46. package/dist/services/WebSearchService.d.ts +13 -0
  47. package/dist/services/WebSearchService.d.ts.map +1 -0
  48. package/dist/services/WorkflowService.d.ts +21 -0
  49. package/dist/services/WorkflowService.d.ts.map +1 -0
  50. package/dist/types/auth.d.ts +22 -0
  51. package/dist/types/auth.d.ts.map +1 -0
  52. package/dist/types/case.d.ts +50 -0
  53. package/dist/types/case.d.ts.map +1 -0
  54. package/dist/types/common.d.ts +43 -0
  55. package/dist/types/common.d.ts.map +1 -0
  56. package/dist/types/config.d.ts +41 -0
  57. package/dist/types/config.d.ts.map +1 -0
  58. package/dist/types/conversation.d.ts +107 -0
  59. package/dist/types/conversation.d.ts.map +1 -0
  60. package/dist/types/conversationTemplate.d.ts +31 -0
  61. package/dist/types/conversationTemplate.d.ts.map +1 -0
  62. package/dist/types/document.d.ts +163 -0
  63. package/dist/types/document.d.ts.map +1 -0
  64. package/dist/types/favorites.d.ts +21 -0
  65. package/dist/types/favorites.d.ts.map +1 -0
  66. package/dist/types/folder.d.ts +53 -0
  67. package/dist/types/folder.d.ts.map +1 -0
  68. package/dist/types/legisratio.d.ts +18 -0
  69. package/dist/types/legisratio.d.ts.map +1 -0
  70. package/dist/types/message.d.ts +117 -0
  71. package/dist/types/message.d.ts.map +1 -0
  72. package/dist/types/notification.d.ts +19 -0
  73. package/dist/types/notification.d.ts.map +1 -0
  74. package/dist/types/organization.d.ts +94 -0
  75. package/dist/types/organization.d.ts.map +1 -0
  76. package/dist/types/smartAnswer.d.ts +30 -0
  77. package/dist/types/smartAnswer.d.ts.map +1 -0
  78. package/dist/types/user.d.ts +74 -0
  79. package/dist/types/user.d.ts.map +1 -0
  80. package/dist/types/webSearch.d.ts +28 -0
  81. package/dist/types/webSearch.d.ts.map +1 -0
  82. package/dist/types/workflow.d.ts +82 -0
  83. package/dist/types/workflow.d.ts.map +1 -0
  84. package/dist/utils/env.d.ts +14 -0
  85. package/dist/utils/env.d.ts.map +1 -0
  86. package/dist/utils/helpers.d.ts +9 -0
  87. package/dist/utils/helpers.d.ts.map +1 -0
  88. package/dist/utils/query.d.ts +7 -0
  89. package/dist/utils/query.d.ts.map +1 -0
  90. package/dist/utils/validation.d.ts +10 -0
  91. package/dist/utils/validation.d.ts.map +1 -0
  92. package/package.json +63 -0
package/README.md ADDED
@@ -0,0 +1,605 @@
1
+ # Lidia TypeScript SDK
2
+
3
+ A comprehensive TypeScript SDK for the Lidia API, providing type-safe access to all Lidia services including cases, documents, conversations, messages, workflows, users, organizations, folders, tags, and more.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @lidia/sdk
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ ```typescript
14
+ import { LidiaSDK } from '@lidia/sdk';
15
+
16
+ const sdk = new LidiaSDK({
17
+ baseUrl: 'https://api.lidiatech.ai',
18
+ cognito: {
19
+ region: 'eu-central-1',
20
+ clientId: 'your-cognito-client-id',
21
+ },
22
+ });
23
+
24
+ // Login with username and password
25
+ await sdk.login({
26
+ username: 'your-email@example.com',
27
+ password: 'your-password',
28
+ });
29
+
30
+ // Get all cases
31
+ const cases = await sdk.cases.find();
32
+
33
+ // Get conversations
34
+ const conversations = await sdk.conversations.find();
35
+
36
+ // Get current user
37
+ const user = await sdk.users.me();
38
+ ```
39
+
40
+ ## Configuration
41
+
42
+ The SDK supports multiple ways to provide configuration:
43
+
44
+ ### 1. Explicit Configuration
45
+
46
+ ```typescript
47
+ import { LidiaSDK, LidiaConfig } from '@lidia/sdk';
48
+
49
+ const config: LidiaConfig = {
50
+ baseUrl: 'https://api.lidiatech.ai',
51
+ cognito: {
52
+ region: 'eu-central-1',
53
+ clientId: 'your-cognito-client-id',
54
+ },
55
+ timeout: 30000,
56
+ debug: false,
57
+ retry: {
58
+ attempts: 3,
59
+ delay: 1000,
60
+ backoff: 2,
61
+ },
62
+ headers: {
63
+ 'Custom-Header': 'value',
64
+ },
65
+ };
66
+
67
+ const sdk = new LidiaSDK(config);
68
+ ```
69
+
70
+ ### 2. Environment Variables
71
+
72
+ The SDK can automatically read configuration from environment variables:
73
+
74
+ ```bash
75
+ # Required for Cognito authentication
76
+ AWS_REGION=eu-central-1
77
+ COGNITO_CLIENT_ID=your-cognito-client-id
78
+
79
+ # Optional
80
+ LIDIA_BASE_URL=https://api.lidiatech.ai
81
+ COGNITO_USER_POOL_ID=your-user-pool-id
82
+
83
+ # Auto-login credentials (optional)
84
+ LIDIA_USERNAME=your-email@example.com
85
+ LIDIA_PASSWORD=your-password
86
+ ```
87
+
88
+ ```typescript
89
+ // Minimal configuration - SDK reads the rest from environment
90
+ const sdk = new LidiaSDK({
91
+ baseUrl: 'https://api.lidiatech.ai',
92
+ });
93
+ ```
94
+
95
+ **Note**: Environment variables are only read in Node.js environments. In browser environments, you must provide configuration explicitly.
96
+
97
+ ## Authentication
98
+
99
+ The SDK uses AWS Cognito for authentication with the USER_PASSWORD_AUTH flow.
100
+
101
+ ### Login Flow
102
+
103
+ ```typescript
104
+ // Initialize SDK
105
+ const sdk = new LidiaSDK({
106
+ baseUrl: 'https://api.lidiatech.ai',
107
+ cognito: {
108
+ region: 'eu-central-1',
109
+ clientId: 'your-cognito-client-id',
110
+ },
111
+ });
112
+
113
+ // Login
114
+ const tokens = await sdk.login({
115
+ username: 'your-email@example.com',
116
+ password: 'your-password',
117
+ });
118
+
119
+ // Check authentication status
120
+ console.log('Authenticated:', sdk.isAuthenticated());
121
+
122
+ // Get current tokens
123
+ const authTokens = sdk.getAuthTokens();
124
+
125
+ // Refresh tokens when needed
126
+ await sdk.refreshTokens();
127
+
128
+ // Logout
129
+ sdk.logout();
130
+ ```
131
+
132
+ ### Auto-Login
133
+
134
+ If you provide username and password in the config or environment variables, the SDK will automatically login:
135
+
136
+ ```typescript
137
+ const sdk = new LidiaSDK({
138
+ baseUrl: 'https://api.lidiatech.ai',
139
+ cognito: {
140
+ region: 'eu-central-1',
141
+ clientId: 'your-cognito-client-id',
142
+ },
143
+ username: 'your-email@example.com',
144
+ password: 'your-password',
145
+ });
146
+
147
+ // Wait for auto-login to complete
148
+ await sdk.waitForAuthentication();
149
+ ```
150
+
151
+ ## Services
152
+
153
+ ### Cases
154
+
155
+ ```typescript
156
+ // Get paginated cases
157
+ const cases = await sdk.cases.find({
158
+ page: 1,
159
+ pageSize: 10,
160
+ search: ['important'],
161
+ onlyMine: true,
162
+ });
163
+
164
+ // Create a case
165
+ const newCase = await sdk.cases.create({
166
+ title: 'New Case',
167
+ });
168
+
169
+ // Get a specific case
170
+ const caseDetails = await sdk.cases.findOne('case-id');
171
+
172
+ // Update a case
173
+ await sdk.cases.update('case-id', { title: 'Updated Title' });
174
+
175
+ // Delete a case
176
+ await sdk.cases.delete('case-id');
177
+
178
+ // Get case participations
179
+ const participations = await sdk.cases.getParticipations('case-id');
180
+
181
+ // Replace participations
182
+ await sdk.cases.replaceParticipations('case-id', [
183
+ {
184
+ participantId: 'user-id',
185
+ CaseParticipationType: 'USER',
186
+ CaseRole: 'ADMIN',
187
+ },
188
+ ]);
189
+ ```
190
+
191
+ ### Conversations
192
+
193
+ ```typescript
194
+ // Get conversations
195
+ const conversations = await sdk.conversations.find({
196
+ page: 1,
197
+ pageSize: 20,
198
+ search: ['query'],
199
+ caseId: 'case-id',
200
+ starred: true,
201
+ });
202
+
203
+ // Create a conversation
204
+ const conversation = await sdk.conversations.create({
205
+ caseId: 'case-id',
206
+ title: 'New Conversation',
207
+ type: 'CHAT',
208
+ });
209
+
210
+ // Get a specific conversation
211
+ const conv = await sdk.conversations.findOne('conversation-id');
212
+
213
+ // Update conversation
214
+ await sdk.conversations.update('conversation-id', {
215
+ title: 'Updated Title',
216
+ });
217
+
218
+ // Delete conversation
219
+ await sdk.conversations.delete('conversation-id');
220
+
221
+ // Star/unstar a conversation
222
+ await sdk.conversations.star('conversation-id');
223
+ await sdk.conversations.unstar('conversation-id');
224
+
225
+ // Manage assignments
226
+ await sdk.conversations.assign('conversation-id', ['user-id-1', 'user-id-2']);
227
+ await sdk.conversations.unassign('conversation-id', ['user-id-1']);
228
+
229
+ // Add/remove documents
230
+ await sdk.conversations.addDocuments('conversation-id', ['doc-id-1', 'doc-id-2']);
231
+ await sdk.conversations.removeDocuments('conversation-id', ['doc-id-1']);
232
+
233
+ // Move conversation to another case
234
+ await sdk.conversations.move('conversation-id', 'new-case-id');
235
+
236
+ // Create from template
237
+ const fromTemplate = await sdk.conversations.createFromTemplate({
238
+ caseId: 'case-id',
239
+ templateId: 'template-id',
240
+ });
241
+
242
+ // Export conversation
243
+ const exportData = await sdk.conversations.export('conversation-id');
244
+ ```
245
+
246
+ ### Messages
247
+
248
+ ```typescript
249
+ // Get messages for a conversation
250
+ const messages = await sdk.messages.find({
251
+ conversationId: 'conversation-id',
252
+ page: 1,
253
+ pageSize: 50,
254
+ });
255
+
256
+ // Create a message
257
+ const message = await sdk.messages.create({
258
+ conversationId: 'conversation-id',
259
+ content: 'Hello!',
260
+ role: 'USER',
261
+ });
262
+
263
+ // Get a specific message
264
+ const msg = await sdk.messages.findOne('message-id');
265
+
266
+ // Delete a message
267
+ await sdk.messages.delete('message-id');
268
+
269
+ // Add reaction to a message
270
+ await sdk.messages.addReaction('message-id', { emoji: 'thumbsup' });
271
+
272
+ // Request AI completion
273
+ const completion = await sdk.messages.complete('conversation-id', {
274
+ content: 'Generate a summary',
275
+ });
276
+ ```
277
+
278
+ ### Documents
279
+
280
+ ```typescript
281
+ // Get documents
282
+ const documents = await sdk.documents.findAll({
283
+ caseId: 'case-id',
284
+ type: 'DOCUMENT',
285
+ visibility: 'PRIVATE',
286
+ search: ['report'],
287
+ });
288
+
289
+ // Create a document
290
+ const document = await sdk.documents.create({
291
+ name: 'Important Document',
292
+ type: 'DOCUMENT',
293
+ visibility: 'PRIVATE',
294
+ folderId: null,
295
+ tagIds: ['tag-id'],
296
+ path: '/documents/report.pdf',
297
+ });
298
+
299
+ // Get a specific document
300
+ const doc = await sdk.documents.findOne('document-id');
301
+
302
+ // Update a document
303
+ await sdk.documents.update('document-id', { name: 'New Name' });
304
+
305
+ // Delete a document
306
+ await sdk.documents.delete('document-id');
307
+
308
+ // Download a document
309
+ const blob = await sdk.documents.download('document-id');
310
+ ```
311
+
312
+ ### Folders
313
+
314
+ ```typescript
315
+ // Get folders
316
+ const folders = await sdk.folders.find({
317
+ parentFolderId: 'parent-id',
318
+ });
319
+
320
+ // Create a folder
321
+ const folder = await sdk.folders.create({
322
+ name: 'New Folder',
323
+ parentFolderId: null,
324
+ });
325
+
326
+ // Get folder details
327
+ const folderDetails = await sdk.folders.findOne('folder-id');
328
+
329
+ // Delete a folder
330
+ await sdk.folders.delete('folder-id');
331
+ ```
332
+
333
+ ### Tags
334
+
335
+ ```typescript
336
+ // Get all available tags
337
+ const tags = await sdk.tags.find();
338
+ ```
339
+
340
+ ### Conversation Templates
341
+
342
+ ```typescript
343
+ // Get templates
344
+ const templates = await sdk.conversationTemplates.find({
345
+ search: ['template'],
346
+ caseId: 'case-id',
347
+ });
348
+
349
+ // Create a template
350
+ const template = await sdk.conversationTemplates.create({
351
+ name: 'Support Template',
352
+ description: 'Template for support conversations',
353
+ messages: [
354
+ { role: 'SYSTEM', content: 'You are a helpful assistant.' },
355
+ ],
356
+ });
357
+
358
+ // Get a specific template
359
+ const tmpl = await sdk.conversationTemplates.findOne('template-id');
360
+
361
+ // Update a template
362
+ await sdk.conversationTemplates.update('template-id', {
363
+ name: 'Updated Template',
364
+ });
365
+
366
+ // Delete a template
367
+ await sdk.conversationTemplates.delete('template-id');
368
+ ```
369
+
370
+ ### Smart Answers
371
+
372
+ ```typescript
373
+ // Create a smart answer session
374
+ const smartAnswer = await sdk.smartAnswers.create({
375
+ conversationId: 'conversation-id',
376
+ query: 'What is the policy?',
377
+ });
378
+
379
+ // Get smart answer details
380
+ const sa = await sdk.smartAnswers.findOne('smart-answer-id');
381
+
382
+ // Update (rename) a smart answer
383
+ await sdk.smartAnswers.update('smart-answer-id', {
384
+ name: 'Policy Question',
385
+ });
386
+ ```
387
+
388
+ ### Users
389
+
390
+ ```typescript
391
+ // Get current user
392
+ const me = await sdk.users.me();
393
+
394
+ // Get all users
395
+ const users = await sdk.users.findAll({
396
+ organizationId: 'org-id',
397
+ });
398
+
399
+ // Get a specific user
400
+ const user = await sdk.users.findOne('user-id');
401
+
402
+ // Create a user
403
+ const newUser = await sdk.users.create({
404
+ email: 'user@example.com',
405
+ firstName: 'John',
406
+ lastName: 'Doe',
407
+ });
408
+
409
+ // Update a user
410
+ await sdk.users.update('user-id', { firstName: 'Jane' });
411
+
412
+ // Delete a user
413
+ await sdk.users.delete('user-id');
414
+ ```
415
+
416
+ ### Organizations
417
+
418
+ ```typescript
419
+ // Get organizations
420
+ const orgs = await sdk.organizations.findAll();
421
+
422
+ // Get a specific organization
423
+ const org = await sdk.organizations.findOne('org-id');
424
+
425
+ // Create an organization
426
+ const newOrg = await sdk.organizations.create({
427
+ name: 'My Organization',
428
+ });
429
+
430
+ // Update an organization
431
+ await sdk.organizations.update('org-id', { name: 'Updated Name' });
432
+
433
+ // Delete an organization
434
+ await sdk.organizations.delete('org-id');
435
+ ```
436
+
437
+ ### Workflows
438
+
439
+ ```typescript
440
+ // Get workflows
441
+ const workflows = await sdk.workflows.findAll({
442
+ caseId: 'case-id',
443
+ });
444
+
445
+ // Create a workflow
446
+ const workflow = await sdk.workflows.create({
447
+ name: 'Document Review',
448
+ caseId: 'case-id',
449
+ });
450
+
451
+ // Get a specific workflow
452
+ const wf = await sdk.workflows.findOne('workflow-id');
453
+
454
+ // Execute a workflow
455
+ const result = await sdk.workflows.execute('workflow-id', {
456
+ documentId: 'doc-id',
457
+ });
458
+ ```
459
+
460
+ ### Favorites
461
+
462
+ ```typescript
463
+ // Get favorites
464
+ const favorites = await sdk.favorites.findAll({
465
+ resourceType: 'CASE',
466
+ });
467
+
468
+ // Add a favorite
469
+ await sdk.favorites.create({
470
+ resourceType: 'CASE',
471
+ resourceId: 'case-id',
472
+ });
473
+
474
+ // Remove a favorite
475
+ await sdk.favorites.delete('CASE', 'case-id');
476
+ ```
477
+
478
+ ## Error Handling
479
+
480
+ The SDK provides comprehensive error handling with specific error types:
481
+
482
+ ```typescript
483
+ import { LidiaError, NetworkError, ValidationError } from '@lidia/sdk';
484
+
485
+ try {
486
+ await sdk.cases.create({ title: '' });
487
+ } catch (error) {
488
+ if (error instanceof ValidationError) {
489
+ console.log('Validation errors:', error.details);
490
+ } else if (error instanceof NetworkError) {
491
+ console.log('Network error:', error.getUserMessage());
492
+ } else if (error instanceof LidiaError) {
493
+ console.log('API error:', error.code, error.message);
494
+ }
495
+ }
496
+ ```
497
+
498
+ ## TypeScript Support
499
+
500
+ The SDK is fully typed with TypeScript definitions:
501
+
502
+ ```typescript
503
+ import {
504
+ // DTOs
505
+ CaseDto,
506
+ ConversationDto,
507
+ MessageDto,
508
+ DocumentDto,
509
+ FolderDto,
510
+ UserDto,
511
+
512
+ // Create/Update DTOs
513
+ CreateCaseDto,
514
+ CreateConversationDto,
515
+ CreateMessageDto,
516
+
517
+ // Enums
518
+ CaseRole,
519
+ CaseParticipationType,
520
+ ConversationType,
521
+ MessageRole,
522
+ MessageStatus,
523
+ ResourceType,
524
+ DocumentVisibility,
525
+ } from '@lidia/sdk';
526
+ ```
527
+
528
+ ## Advanced Usage
529
+
530
+ ### Access the HTTP Client
531
+
532
+ ```typescript
533
+ // Get the underlying client for custom requests
534
+ const client = sdk.getClient();
535
+
536
+ // Make custom requests
537
+ const response = await client.get<CustomType>('/custom-endpoint');
538
+ const data = await client.post<ResponseType>('/endpoint', { body: 'data' });
539
+ ```
540
+
541
+ ### Configuration Updates
542
+
543
+ ```typescript
544
+ // Update configuration at runtime
545
+ sdk.updateConfig({
546
+ timeout: 60000,
547
+ debug: true,
548
+ });
549
+ ```
550
+
551
+ ### Retry Logic
552
+
553
+ The SDK includes built-in retry logic for failed requests:
554
+
555
+ ```typescript
556
+ const sdk = new LidiaSDK({
557
+ baseUrl: 'https://api.lidiatech.ai',
558
+ cognito: {
559
+ region: 'eu-central-1',
560
+ clientId: 'your-cognito-client-id',
561
+ },
562
+ retry: {
563
+ attempts: 5,
564
+ delay: 2000,
565
+ backoff: 1.5,
566
+ },
567
+ });
568
+ ```
569
+
570
+ ## Development
571
+
572
+ ### Building
573
+
574
+ ```bash
575
+ npm run build
576
+ ```
577
+
578
+ ### Testing
579
+
580
+ ```bash
581
+ npm test
582
+ npm run test:watch
583
+ npm run test:coverage
584
+ ```
585
+
586
+ ### Linting
587
+
588
+ ```bash
589
+ npm run lint
590
+ npm run lint:fix
591
+ ```
592
+
593
+ ### Formatting
594
+
595
+ ```bash
596
+ npm run format
597
+ ```
598
+
599
+ ## License
600
+
601
+ MIT
602
+
603
+ ## Support
604
+
605
+ For support and questions, please contact the Lidia team or open an issue in the repository.
@@ -0,0 +1,62 @@
1
+ import { LidiaClient } from './client/LidiaClient';
2
+ import { LidiaConfig } from './types/config';
3
+ import { LoginCredentials, AuthTokens } from './types/auth';
4
+ import { AuthorizationService } from './services/AuthorizationService';
5
+ import { CaseService } from './services/CaseService';
6
+ import { ConversationService } from './services/ConversationService';
7
+ import { ConversationTemplateService } from './services/ConversationTemplateService';
8
+ import { DocumentService } from './services/DocumentService';
9
+ import { FavoritesService } from './services/FavoritesService';
10
+ import { FolderService } from './services/FolderService';
11
+ import { HealthService } from './services/HealthService';
12
+ import { LegisratioService } from './services/LegisratioService';
13
+ import { MessageService } from './services/MessageService';
14
+ import { NotificationService } from './services/NotificationService';
15
+ import { OrganizationService } from './services/OrganizationService';
16
+ import { SmartAnswerService } from './services/SmartAnswerService';
17
+ import { TagService } from './services/TagService';
18
+ import { UserService } from './services/UserService';
19
+ import { WebSearchService } from './services/WebSearchService';
20
+ import { WorkflowService } from './services/WorkflowService';
21
+ export declare class LidiaSDK {
22
+ readonly client: LidiaClient;
23
+ readonly auth?: AuthorizationService;
24
+ readonly cases: CaseService;
25
+ readonly conversations: ConversationService;
26
+ readonly conversationTemplates: ConversationTemplateService;
27
+ readonly documents: DocumentService;
28
+ readonly favorites: FavoritesService;
29
+ readonly folders: FolderService;
30
+ readonly health: HealthService;
31
+ readonly legisratio: LegisratioService;
32
+ readonly messages: MessageService;
33
+ readonly notifications: NotificationService;
34
+ readonly organizations: OrganizationService;
35
+ readonly smartAnswers: SmartAnswerService;
36
+ readonly tags: TagService;
37
+ readonly users: UserService;
38
+ readonly webSearches: WebSearchService;
39
+ readonly workflows: WorkflowService;
40
+ private authInitPromise?;
41
+ constructor(config: LidiaConfig);
42
+ private shouldInitializeAuth;
43
+ private mergeConfigWithEnv;
44
+ private initializeAuthentication;
45
+ /** Login with email and password using AWS Cognito */
46
+ login(credentials: LoginCredentials): Promise<AuthTokens>;
47
+ /** Refresh authentication tokens */
48
+ refreshTokens(): Promise<AuthTokens>;
49
+ /** Logout and clear tokens */
50
+ logout(): void;
51
+ /** Wait for authentication initialization to complete */
52
+ waitForAuthentication(): Promise<void>;
53
+ /** Check if user is authenticated */
54
+ isAuthenticated(): boolean;
55
+ /** Get current authentication tokens */
56
+ getAuthTokens(): AuthTokens | undefined;
57
+ /** Update SDK configuration */
58
+ updateConfig(config: Partial<LidiaConfig>): void;
59
+ /** Get the underlying HTTP client for advanced usage */
60
+ getClient(): LidiaClient;
61
+ }
62
+ //# sourceMappingURL=LidiaSDK.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LidiaSDK.d.ts","sourceRoot":"","sources":["../src/LidiaSDK.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,W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E,eAAe,CAAC;IAC3C,SAAgB,SAAS,EAAE,gBAAgB,CAAC;IAC5C,SAAgB,OAAO,EAAE,aAAa,CAAC;IACvC,SAAgB,MAAM,EAAE,aAAa,CAAC;IACtC,SAAgB,UAAU,EAAE,iBAAiB,CAAC;IAC9C,SAAgB,QAAQ,EAAE,cAAc,CAAC;IACzC,SAAgB,aAAa,EAAE,mBAAmB,CAAC;IACnD,SAAgB,aAAa,EAAE,mBAAmB,CAAC;IACnD,SAAgB,YAAY,EAAE,kBAAkB,CAAC;IACjD,SAAgB,IAAI,EAAE,UAAU,CAAC;IACjC,SAAgB,KAAK,EAAE,WAAW,CAAC;IACnC,SAAgB,WAAW,EAAE,gBAAgB,CAAC;IAC9C,SAAgB,SAAS,EAAE,eAAe,CAAC;IAE3C,OAAO,CAAC,eAAe,CAAC,CAAgB;gBAE5B,MAAM,EAAE,WAAW;IAiC/B,OAAO,CAAC,oBAAoB;IAK5B,OAAO,CAAC,kBAAkB;YAyDZ,wBAAwB;IActC,sDAAsD;IAChD,KAAK,CAAC,WAAW,EAAE,gBAAgB,GAAG,OAAO,CAAC,UAAU,CAAC;IAO/D,oCAAoC;IAC9B,aAAa,IAAI,OAAO,CAAC,UAAU,CAAC;IAO1C,8BAA8B;IAC9B,MAAM,IAAI,IAAI;IAMd,yDAAyD;IACnD,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC;IAoB5C,qCAAqC;IACrC,eAAe,IAAI,OAAO;IAI1B,wCAAwC;IACxC,aAAa,IAAI,UAAU,GAAG,SAAS;IAIvC,+BAA+B;IAC/B,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,IAAI;IAIhD,wDAAwD;IACxD,SAAS,IAAI,WAAW;CAGzB"}
@@ -0,0 +1,24 @@
1
+ import { LidiaConfig } from '../types/config';
2
+ import { AuthTokens } from '../types/auth';
3
+ export declare class LidiaClient {
4
+ private config;
5
+ private authTokens;
6
+ constructor(config: LidiaConfig);
7
+ private getAuthHeader;
8
+ private makeRequest;
9
+ get<T = unknown>(url: string, config?: RequestInit): Promise<T>;
10
+ post<T = unknown>(url: string, data?: unknown, config?: RequestInit): Promise<T>;
11
+ put<T = unknown>(url: string, data?: unknown, config?: RequestInit): Promise<T>;
12
+ patch<T = unknown>(url: string, data?: unknown, config?: RequestInit): Promise<T>;
13
+ delete<T = unknown>(url: string, data?: unknown, config?: RequestInit): Promise<T>;
14
+ /**
15
+ * Download a blob (for file downloads)
16
+ */
17
+ downloadBlob(url: string): Promise<Blob>;
18
+ setAuthTokens(tokens: AuthTokens): void;
19
+ getAuthTokens(): AuthTokens | undefined;
20
+ clearAuthTokens(): void;
21
+ isAuthenticated(): boolean;
22
+ updateConfig(newConfig: Partial<LidiaConfig>): void;
23
+ }
24
+ //# sourceMappingURL=LidiaClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LidiaClient.d.ts","sourceRoot":"","sources":["../../src/client/LidiaClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,qBAAa,WAAW;IACtB,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,UAAU,CAAyB;gBAE/B,MAAM,EAAE,WAAW;IAa/B,OAAO,CAAC,aAAa;YAOP,WAAW;IAqGnB,GAAG,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC;IAI/D,IAAI,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC;IAQhF,GAAG,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,MA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