@kadoa/node-sdk 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -19
- package/dist/index.d.mts +4777 -341
- package/dist/index.d.ts +4777 -341
- package/dist/index.js +1496 -805
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1519 -825
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -16,15 +16,15 @@ pnpm add @kadoa/node-sdk
|
|
|
16
16
|
## Quick Start
|
|
17
17
|
|
|
18
18
|
```typescript
|
|
19
|
-
import {
|
|
19
|
+
import { KadoaClient } from '@kadoa/node-sdk';
|
|
20
20
|
|
|
21
|
-
// Initialize the
|
|
22
|
-
const
|
|
21
|
+
// Initialize the client
|
|
22
|
+
const client = new KadoaClient({
|
|
23
23
|
apiKey: 'your-api-key'
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
// Run an extraction
|
|
27
|
-
const result = await
|
|
27
|
+
const result = await client.extraction.run({
|
|
28
28
|
urls: ['https://example.com'],
|
|
29
29
|
name: 'My Extraction Workflow'
|
|
30
30
|
});
|
|
@@ -39,7 +39,7 @@ if (result) {
|
|
|
39
39
|
### Basic Configuration
|
|
40
40
|
|
|
41
41
|
```typescript
|
|
42
|
-
const
|
|
42
|
+
const client = new KadoaClient({
|
|
43
43
|
apiKey: 'your-api-key',
|
|
44
44
|
baseUrl: 'https://api.kadoa.com', // optional
|
|
45
45
|
timeout: 30000 // optional, in ms
|
|
@@ -55,12 +55,12 @@ KADOA_TIMEOUT=30000
|
|
|
55
55
|
```
|
|
56
56
|
|
|
57
57
|
```typescript
|
|
58
|
-
import {
|
|
58
|
+
import { KadoaClient } from '@kadoa/node-sdk';
|
|
59
59
|
import { config } from 'dotenv';
|
|
60
60
|
|
|
61
61
|
config();
|
|
62
62
|
|
|
63
|
-
const
|
|
63
|
+
const client = new KadoaClient({
|
|
64
64
|
apiKey: process.env.KADOA_API_KEY!,
|
|
65
65
|
baseUrl: process.env.KADOA_API_URL,
|
|
66
66
|
timeout: parseInt(process.env.KADOA_TIMEOUT || '30000')
|
|
@@ -70,10 +70,10 @@ const sdk = initializeSdk({
|
|
|
70
70
|
## Event Handling
|
|
71
71
|
|
|
72
72
|
```typescript
|
|
73
|
-
const
|
|
73
|
+
const client = new KadoaClient({ apiKey: 'your-api-key' });
|
|
74
74
|
|
|
75
75
|
// Listen to events
|
|
76
|
-
|
|
76
|
+
client.onEvent((event) => {
|
|
77
77
|
console.log('Event:', event);
|
|
78
78
|
});
|
|
79
79
|
|
|
@@ -87,21 +87,18 @@ sdk.onEvent((event) => {
|
|
|
87
87
|
|
|
88
88
|
## API Reference
|
|
89
89
|
|
|
90
|
-
###
|
|
90
|
+
### new KadoaClient(config)
|
|
91
91
|
- `apiKey` (required): Your Kadoa API key
|
|
92
|
-
- `baseUrl` (optional): API base URL
|
|
93
|
-
- `timeout` (optional): Request timeout in milliseconds
|
|
92
|
+
- `baseUrl` (optional): API base URL (default: 'https://api.kadoa.com')
|
|
93
|
+
- `timeout` (optional): Request timeout in milliseconds (default: 30000)
|
|
94
94
|
|
|
95
|
-
Returns
|
|
96
|
-
- `
|
|
97
|
-
- `axiosInstance`: Configured HTTP client
|
|
95
|
+
Returns a client instance with:
|
|
96
|
+
- `extraction`: Extraction module with `run()` method
|
|
98
97
|
- `onEvent()`: Subscribe to events
|
|
99
98
|
- `offEvent()`: Unsubscribe from events
|
|
99
|
+
- `dispose()`: Releases resources and removes all event listeners
|
|
100
100
|
|
|
101
|
-
###
|
|
102
|
-
Releases resources and removes all event listeners.
|
|
103
|
-
|
|
104
|
-
### runExtraction(sdk, options)
|
|
101
|
+
### client.extraction.run(options)
|
|
105
102
|
- `urls`: Array of URLs to extract from
|
|
106
103
|
- `name`: Workflow name
|
|
107
104
|
- Additional options available in API documentation
|