aparavi-client 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +75 -26
- package/dist/aparavi-client-1.0.5.tgz +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,18 +16,23 @@ A comprehensive TypeScript/JavaScript client library for the Aparavi data proces
|
|
|
16
16
|
## Installation
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
|
-
npm install aparavi-client
|
|
19
|
+
npm install aparavi-client
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Or install globally for CLI access:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm install -g aparavi-client
|
|
20
26
|
```
|
|
21
27
|
|
|
22
28
|
## Quick Start
|
|
23
29
|
|
|
24
30
|
### Using the CLI
|
|
25
31
|
|
|
26
|
-
|
|
27
|
-
# Install globally for CLI access
|
|
28
|
-
npm install -g aparavi-client-typescript
|
|
32
|
+
The CLI automatically connects to the Aparavi cloud service at `eaas.aparavi.com:443` by default.
|
|
29
33
|
|
|
30
|
-
|
|
34
|
+
```bash
|
|
35
|
+
# Start a pipeline (automatically uses eaas.aparavi.com)
|
|
31
36
|
aparavi start --pipeline ./my-pipeline.json --apikey YOUR_API_KEY
|
|
32
37
|
|
|
33
38
|
# Upload files
|
|
@@ -35,16 +40,19 @@ aparavi upload *.pdf --pipeline ./my-pipeline.json --apikey YOUR_API_KEY
|
|
|
35
40
|
|
|
36
41
|
# Monitor status
|
|
37
42
|
aparavi status --token TASK_TOKEN --apikey YOUR_API_KEY
|
|
43
|
+
|
|
44
|
+
# Use a different server
|
|
45
|
+
aparavi start --pipeline ./my-pipeline.json --apikey YOUR_API_KEY --host custom.server.com --port 443
|
|
38
46
|
```
|
|
39
47
|
|
|
40
48
|
### Using the Library
|
|
41
49
|
|
|
42
50
|
```javascript
|
|
43
|
-
import { AparaviClient } from 'aparavi-client
|
|
51
|
+
import { AparaviClient } from 'aparavi-client';
|
|
44
52
|
|
|
45
53
|
const client = new AparaviClient({
|
|
46
54
|
auth: 'your-api-key',
|
|
47
|
-
uri: 'wss://
|
|
55
|
+
uri: 'wss://eaas.aparavi.com:443' // optional, this is the default
|
|
48
56
|
});
|
|
49
57
|
|
|
50
58
|
await client.connect();
|
|
@@ -68,7 +76,7 @@ Create a `.env` file in your project:
|
|
|
68
76
|
|
|
69
77
|
```bash
|
|
70
78
|
APARAVI_APIKEY=your-api-key-here
|
|
71
|
-
APARAVI_URI=wss://
|
|
79
|
+
APARAVI_URI=wss://eaas.aparavi.com:443
|
|
72
80
|
APARAVI_PIPELINE=./my-pipeline.json
|
|
73
81
|
APARAVI_TOKEN=existing-task-token
|
|
74
82
|
```
|
|
@@ -78,7 +86,7 @@ APARAVI_TOKEN=existing-task-token
|
|
|
78
86
|
```javascript
|
|
79
87
|
const client = new AparaviClient({
|
|
80
88
|
auth: 'your-api-key', // Required: API key
|
|
81
|
-
uri: 'wss://
|
|
89
|
+
uri: 'wss://eaas.aparavi.com:443', // Optional: Server URI (default: eaas.aparavi.com:443)
|
|
82
90
|
persist: true, // Optional: Auto-reconnect
|
|
83
91
|
reconnectDelay: 1000, // Optional: Reconnect delay (ms)
|
|
84
92
|
onEvent: (event) => console.log(event), // Optional: Event handler
|
|
@@ -202,8 +210,8 @@ Options:
|
|
|
202
210
|
--threads <num> Number of threads (default: 4)
|
|
203
211
|
--args <args...> Additional arguments
|
|
204
212
|
--apikey <key> API key
|
|
205
|
-
--host <hostname> Server hostname (default:
|
|
206
|
-
--port <port> Server port (default:
|
|
213
|
+
--host <hostname> Server hostname (default: eaas.aparavi.com)
|
|
214
|
+
--port <port> Server port (default: 443)
|
|
207
215
|
```
|
|
208
216
|
|
|
209
217
|
#### Upload Files
|
|
@@ -220,8 +228,8 @@ Options:
|
|
|
220
228
|
--max-concurrent <num> Max concurrent uploads (default: 5)
|
|
221
229
|
--threads <num> Number of threads (default: 4)
|
|
222
230
|
--apikey <key> API key
|
|
223
|
-
--host <hostname> Server hostname (default:
|
|
224
|
-
--port <port> Server port (default:
|
|
231
|
+
--host <hostname> Server hostname (default: eaas.aparavi.com)
|
|
232
|
+
--port <port> Server port (default: 443)
|
|
225
233
|
```
|
|
226
234
|
|
|
227
235
|
#### Monitor Status
|
|
@@ -232,8 +240,8 @@ aparavi status [options]
|
|
|
232
240
|
Options:
|
|
233
241
|
--token <token> Task token to monitor
|
|
234
242
|
--apikey <key> API key
|
|
235
|
-
--host <hostname> Server hostname (default:
|
|
236
|
-
--port <port> Server port (default:
|
|
243
|
+
--host <hostname> Server hostname (default: eaas.aparavi.com)
|
|
244
|
+
--port <port> Server port (default: 443)
|
|
237
245
|
```
|
|
238
246
|
|
|
239
247
|
#### Stop Pipeline
|
|
@@ -244,8 +252,8 @@ aparavi stop [options]
|
|
|
244
252
|
Options:
|
|
245
253
|
--token <token> Task token to stop
|
|
246
254
|
--apikey <key> API key
|
|
247
|
-
--host <hostname> Server hostname (default:
|
|
248
|
-
--port <port> Server port (default:
|
|
255
|
+
--host <hostname> Server hostname (default: eaas.aparavi.com)
|
|
256
|
+
--port <port> Server port (default: 443)
|
|
249
257
|
```
|
|
250
258
|
|
|
251
259
|
## Pipeline Configuration
|
|
@@ -346,7 +354,7 @@ Options:
|
|
|
346
354
|
### Document Processing Workflow
|
|
347
355
|
|
|
348
356
|
```javascript
|
|
349
|
-
import { AparaviClient } from 'aparavi-client
|
|
357
|
+
import { AparaviClient } from 'aparavi-client';
|
|
350
358
|
|
|
351
359
|
async function processDocuments() {
|
|
352
360
|
const client = new AparaviClient({
|
|
@@ -400,7 +408,7 @@ processDocuments();
|
|
|
400
408
|
### AI Chat Integration
|
|
401
409
|
|
|
402
410
|
```javascript
|
|
403
|
-
import { AparaviClient, Question } from 'aparavi-client
|
|
411
|
+
import { AparaviClient, Question } from 'aparavi-client';
|
|
404
412
|
|
|
405
413
|
async function chatWithAI() {
|
|
406
414
|
const client = new AparaviClient({
|
|
@@ -452,7 +460,7 @@ try {
|
|
|
452
460
|
The package includes full TypeScript definitions:
|
|
453
461
|
|
|
454
462
|
```typescript
|
|
455
|
-
import { AparaviClient, PipelineConfig, TASK_STATUS } from 'aparavi-client
|
|
463
|
+
import { AparaviClient, PipelineConfig, TASK_STATUS } from 'aparavi-client';
|
|
456
464
|
|
|
457
465
|
const client: AparaviClient = new AparaviClient({
|
|
458
466
|
auth: 'your-api-key'
|
|
@@ -467,11 +475,11 @@ The client works in both Node.js and browser environments:
|
|
|
467
475
|
|
|
468
476
|
```javascript
|
|
469
477
|
// Browser usage
|
|
470
|
-
import { AparaviClient } from 'aparavi-client
|
|
478
|
+
import { AparaviClient } from 'aparavi-client';
|
|
471
479
|
|
|
472
480
|
const client = new AparaviClient({
|
|
473
481
|
auth: 'your-api-key',
|
|
474
|
-
uri: 'wss://
|
|
482
|
+
uri: 'wss://eaas.aparavi.com:443'
|
|
475
483
|
});
|
|
476
484
|
|
|
477
485
|
// File upload in browser
|
|
@@ -483,12 +491,40 @@ const results = await client.sendFiles(files, token);
|
|
|
483
491
|
|
|
484
492
|
## Troubleshooting
|
|
485
493
|
|
|
494
|
+
### Connection Defaults
|
|
495
|
+
|
|
496
|
+
The client automatically connects to the Aparavi cloud service:
|
|
497
|
+
- **Default Host**: `eaas.aparavi.com`
|
|
498
|
+
- **Default Port**: `443`
|
|
499
|
+
- **Protocol**: `wss://` (secure WebSocket)
|
|
500
|
+
|
|
501
|
+
You don't need to specify these unless connecting to a custom server.
|
|
502
|
+
|
|
486
503
|
### Common Issues
|
|
487
504
|
|
|
488
|
-
1. **Connection Failed
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
505
|
+
1. **Connection Failed (ws:// instead of wss://)**:
|
|
506
|
+
- Ensure you're using the latest version: `npm install -g aparavi-client@latest`
|
|
507
|
+
- Or install from local build: `npm install -g ./dist/aparavi-client-1.0.4.tgz`
|
|
508
|
+
|
|
509
|
+
2. **403 Forbidden Error**:
|
|
510
|
+
- Your API key is invalid, expired, or lacks permissions
|
|
511
|
+
- Get a new API key from your Aparavi account settings
|
|
512
|
+
|
|
513
|
+
3. **301 Redirect Error**:
|
|
514
|
+
- You're using an old version of the package
|
|
515
|
+
- Update to the latest version
|
|
516
|
+
|
|
517
|
+
4. **Pipeline Not Found**:
|
|
518
|
+
- Verify the pipeline file path and JSON format
|
|
519
|
+
- Use absolute paths if relative paths don't work
|
|
520
|
+
|
|
521
|
+
5. **Upload Errors**:
|
|
522
|
+
- Ensure files are accessible and not too large
|
|
523
|
+
- Check file permissions
|
|
524
|
+
|
|
525
|
+
6. **Authentication Errors**:
|
|
526
|
+
- Verify your API key is correct
|
|
527
|
+
- Ensure the key has the necessary permissions
|
|
492
528
|
|
|
493
529
|
### Debug Mode
|
|
494
530
|
|
|
@@ -513,6 +549,19 @@ For support and documentation, visit:
|
|
|
513
549
|
|
|
514
550
|
## Changelog
|
|
515
551
|
|
|
552
|
+
### v1.0.4
|
|
553
|
+
- Changed default server to `eaas.aparavi.com:443`
|
|
554
|
+
- Fixed WebSocket protocol handling (wss:// for secure connections)
|
|
555
|
+
- Improved URI construction and port handling
|
|
556
|
+
- Updated package name to `aparavi-client`
|
|
557
|
+
|
|
558
|
+
### v1.0.3
|
|
559
|
+
- Port parsing improvements
|
|
560
|
+
- Protocol detection fixes
|
|
561
|
+
|
|
562
|
+
### v1.0.2
|
|
563
|
+
- Initial public release with cloud defaults
|
|
564
|
+
|
|
516
565
|
### v1.0.1
|
|
517
566
|
- Initial release
|
|
518
567
|
- Full TypeScript support
|
|
Binary file
|