@robosystems/client 0.2.21 → 0.2.22
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/extensions/hooks.d.ts
CHANGED
|
@@ -121,7 +121,6 @@ export declare function useSDKClients(): {
|
|
|
121
121
|
* const handleFileUpload = async (file: File) => {
|
|
122
122
|
* const result = await upload('Entity', file, {
|
|
123
123
|
* onProgress: (msg) => console.log(msg),
|
|
124
|
-
* fixLocalStackUrl: true,
|
|
125
124
|
* })
|
|
126
125
|
*
|
|
127
126
|
* if (result?.success) {
|
|
@@ -129,6 +128,15 @@ export declare function useSDKClients(): {
|
|
|
129
128
|
* }
|
|
130
129
|
* }
|
|
131
130
|
* ```
|
|
131
|
+
*
|
|
132
|
+
* @remarks
|
|
133
|
+
* For local development with LocalStack, configure s3EndpointUrl when initializing RoboSystemsExtensions:
|
|
134
|
+
* ```tsx
|
|
135
|
+
* const extensions = new RoboSystemsExtensions({
|
|
136
|
+
* baseUrl: 'http://localhost:8000',
|
|
137
|
+
* s3EndpointUrl: 'http://localhost:4566', // LocalStack endpoint
|
|
138
|
+
* })
|
|
139
|
+
* ```
|
|
132
140
|
*/
|
|
133
141
|
export declare function useTableUpload(graphId: string): {
|
|
134
142
|
upload: (tableName: string, fileOrBuffer: FileInput, options?: FileUploadOptions) => Promise<FileUploadResult | null>;
|
package/extensions/hooks.js
CHANGED
|
@@ -396,7 +396,6 @@ function useSDKClients() {
|
|
|
396
396
|
* const handleFileUpload = async (file: File) => {
|
|
397
397
|
* const result = await upload('Entity', file, {
|
|
398
398
|
* onProgress: (msg) => console.log(msg),
|
|
399
|
-
* fixLocalStackUrl: true,
|
|
400
399
|
* })
|
|
401
400
|
*
|
|
402
401
|
* if (result?.success) {
|
|
@@ -404,6 +403,15 @@ function useSDKClients() {
|
|
|
404
403
|
* }
|
|
405
404
|
* }
|
|
406
405
|
* ```
|
|
406
|
+
*
|
|
407
|
+
* @remarks
|
|
408
|
+
* For local development with LocalStack, configure s3EndpointUrl when initializing RoboSystemsExtensions:
|
|
409
|
+
* ```tsx
|
|
410
|
+
* const extensions = new RoboSystemsExtensions({
|
|
411
|
+
* baseUrl: 'http://localhost:8000',
|
|
412
|
+
* s3EndpointUrl: 'http://localhost:4566', // LocalStack endpoint
|
|
413
|
+
* })
|
|
414
|
+
* ```
|
|
407
415
|
*/
|
|
408
416
|
function useTableUpload(graphId) {
|
|
409
417
|
const [loading, setLoading] = (0, react_1.useState)(false);
|
package/extensions/hooks.ts
CHANGED
|
@@ -474,7 +474,6 @@ export function useSDKClients() {
|
|
|
474
474
|
* const handleFileUpload = async (file: File) => {
|
|
475
475
|
* const result = await upload('Entity', file, {
|
|
476
476
|
* onProgress: (msg) => console.log(msg),
|
|
477
|
-
* fixLocalStackUrl: true,
|
|
478
477
|
* })
|
|
479
478
|
*
|
|
480
479
|
* if (result?.success) {
|
|
@@ -482,6 +481,15 @@ export function useSDKClients() {
|
|
|
482
481
|
* }
|
|
483
482
|
* }
|
|
484
483
|
* ```
|
|
484
|
+
*
|
|
485
|
+
* @remarks
|
|
486
|
+
* For local development with LocalStack, configure s3EndpointUrl when initializing RoboSystemsExtensions:
|
|
487
|
+
* ```tsx
|
|
488
|
+
* const extensions = new RoboSystemsExtensions({
|
|
489
|
+
* baseUrl: 'http://localhost:8000',
|
|
490
|
+
* s3EndpointUrl: 'http://localhost:4566', // LocalStack endpoint
|
|
491
|
+
* })
|
|
492
|
+
* ```
|
|
485
493
|
*/
|
|
486
494
|
export function useTableUpload(graphId: string) {
|
|
487
495
|
const [loading, setLoading] = useState(false)
|
package/package.json
CHANGED
package/sdk-extensions/README.md
CHANGED
|
@@ -114,7 +114,6 @@ const result = await tableClient.uploadParquetFile(
|
|
|
114
114
|
onProgress: (message) => {
|
|
115
115
|
console.log(`Upload progress: ${message}`)
|
|
116
116
|
},
|
|
117
|
-
fixLocalStackUrl: true, // Auto-fix for local development
|
|
118
117
|
}
|
|
119
118
|
)
|
|
120
119
|
|
|
@@ -248,7 +247,6 @@ import { readFileSync } from 'fs'
|
|
|
248
247
|
const fileBuffer = readFileSync('data/entities.parquet')
|
|
249
248
|
const result = await tableClient.uploadParquetFile('graph-id', 'Entity', Buffer.from(fileBuffer), {
|
|
250
249
|
onProgress: (msg) => console.log(msg),
|
|
251
|
-
fixLocalStackUrl: true, // Auto-fix for local development
|
|
252
250
|
})
|
|
253
251
|
|
|
254
252
|
if (result.success) {
|
|
@@ -673,14 +671,15 @@ NEXT_PUBLIC_PREFER_STREAMING=true
|
|
|
673
671
|
### Custom Configuration
|
|
674
672
|
|
|
675
673
|
```typescript
|
|
676
|
-
import {
|
|
674
|
+
import { RoboSystemsExtensions } from '@robosystems/client/extensions'
|
|
677
675
|
|
|
678
|
-
const
|
|
676
|
+
const extensions = new RoboSystemsExtensions({
|
|
679
677
|
// API Configuration
|
|
680
678
|
baseUrl: process.env.NEXT_PUBLIC_ROBOSYSTEMS_API_URL,
|
|
681
679
|
|
|
682
680
|
// Authentication
|
|
683
681
|
credentials: 'include', // For cookies
|
|
682
|
+
token: 'your-jwt-token', // Or use JWT token
|
|
684
683
|
headers: {
|
|
685
684
|
'X-API-Key': process.env.ROBOSYSTEMS_API_KEY,
|
|
686
685
|
},
|
|
@@ -688,12 +687,29 @@ const sseClient = createSSEClient({
|
|
|
688
687
|
// Connection Settings
|
|
689
688
|
maxRetries: 5,
|
|
690
689
|
retryDelay: 1000,
|
|
691
|
-
heartbeatInterval: 30000,
|
|
692
690
|
|
|
693
|
-
//
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
691
|
+
// S3 Configuration (for local development with LocalStack)
|
|
692
|
+
s3EndpointUrl: process.env.S3_ENDPOINT_URL, // e.g., 'http://localhost:4566'
|
|
693
|
+
})
|
|
694
|
+
```
|
|
695
|
+
|
|
696
|
+
#### Local Development with LocalStack
|
|
697
|
+
|
|
698
|
+
For local development using LocalStack, configure the S3 endpoint URL:
|
|
699
|
+
|
|
700
|
+
```typescript
|
|
701
|
+
import { RoboSystemsExtensions } from '@robosystems/client/extensions'
|
|
702
|
+
|
|
703
|
+
const extensions = new RoboSystemsExtensions({
|
|
704
|
+
baseUrl: 'http://localhost:8000',
|
|
705
|
+
credentials: 'include',
|
|
706
|
+
// Override S3 endpoint for LocalStack
|
|
707
|
+
s3EndpointUrl: 'http://localhost:4566',
|
|
708
|
+
})
|
|
709
|
+
|
|
710
|
+
// File uploads will now use LocalStack instead of AWS S3
|
|
711
|
+
const result = await extensions.files.upload('graph-id', 'TableName', fileBuffer, {
|
|
712
|
+
onProgress: (msg) => console.log(msg),
|
|
697
713
|
})
|
|
698
714
|
```
|
|
699
715
|
|
|
@@ -121,7 +121,6 @@ export declare function useSDKClients(): {
|
|
|
121
121
|
* const handleFileUpload = async (file: File) => {
|
|
122
122
|
* const result = await upload('Entity', file, {
|
|
123
123
|
* onProgress: (msg) => console.log(msg),
|
|
124
|
-
* fixLocalStackUrl: true,
|
|
125
124
|
* })
|
|
126
125
|
*
|
|
127
126
|
* if (result?.success) {
|
|
@@ -129,6 +128,15 @@ export declare function useSDKClients(): {
|
|
|
129
128
|
* }
|
|
130
129
|
* }
|
|
131
130
|
* ```
|
|
131
|
+
*
|
|
132
|
+
* @remarks
|
|
133
|
+
* For local development with LocalStack, configure s3EndpointUrl when initializing RoboSystemsExtensions:
|
|
134
|
+
* ```tsx
|
|
135
|
+
* const extensions = new RoboSystemsExtensions({
|
|
136
|
+
* baseUrl: 'http://localhost:8000',
|
|
137
|
+
* s3EndpointUrl: 'http://localhost:4566', // LocalStack endpoint
|
|
138
|
+
* })
|
|
139
|
+
* ```
|
|
132
140
|
*/
|
|
133
141
|
export declare function useTableUpload(graphId: string): {
|
|
134
142
|
upload: (tableName: string, fileOrBuffer: FileInput, options?: FileUploadOptions) => Promise<FileUploadResult | null>;
|
package/sdk-extensions/hooks.js
CHANGED
|
@@ -396,7 +396,6 @@ function useSDKClients() {
|
|
|
396
396
|
* const handleFileUpload = async (file: File) => {
|
|
397
397
|
* const result = await upload('Entity', file, {
|
|
398
398
|
* onProgress: (msg) => console.log(msg),
|
|
399
|
-
* fixLocalStackUrl: true,
|
|
400
399
|
* })
|
|
401
400
|
*
|
|
402
401
|
* if (result?.success) {
|
|
@@ -404,6 +403,15 @@ function useSDKClients() {
|
|
|
404
403
|
* }
|
|
405
404
|
* }
|
|
406
405
|
* ```
|
|
406
|
+
*
|
|
407
|
+
* @remarks
|
|
408
|
+
* For local development with LocalStack, configure s3EndpointUrl when initializing RoboSystemsExtensions:
|
|
409
|
+
* ```tsx
|
|
410
|
+
* const extensions = new RoboSystemsExtensions({
|
|
411
|
+
* baseUrl: 'http://localhost:8000',
|
|
412
|
+
* s3EndpointUrl: 'http://localhost:4566', // LocalStack endpoint
|
|
413
|
+
* })
|
|
414
|
+
* ```
|
|
407
415
|
*/
|
|
408
416
|
function useTableUpload(graphId) {
|
|
409
417
|
const [loading, setLoading] = (0, react_1.useState)(false);
|
package/sdk-extensions/hooks.ts
CHANGED
|
@@ -474,7 +474,6 @@ export function useSDKClients() {
|
|
|
474
474
|
* const handleFileUpload = async (file: File) => {
|
|
475
475
|
* const result = await upload('Entity', file, {
|
|
476
476
|
* onProgress: (msg) => console.log(msg),
|
|
477
|
-
* fixLocalStackUrl: true,
|
|
478
477
|
* })
|
|
479
478
|
*
|
|
480
479
|
* if (result?.success) {
|
|
@@ -482,6 +481,15 @@ export function useSDKClients() {
|
|
|
482
481
|
* }
|
|
483
482
|
* }
|
|
484
483
|
* ```
|
|
484
|
+
*
|
|
485
|
+
* @remarks
|
|
486
|
+
* For local development with LocalStack, configure s3EndpointUrl when initializing RoboSystemsExtensions:
|
|
487
|
+
* ```tsx
|
|
488
|
+
* const extensions = new RoboSystemsExtensions({
|
|
489
|
+
* baseUrl: 'http://localhost:8000',
|
|
490
|
+
* s3EndpointUrl: 'http://localhost:4566', // LocalStack endpoint
|
|
491
|
+
* })
|
|
492
|
+
* ```
|
|
485
493
|
*/
|
|
486
494
|
export function useTableUpload(graphId: string) {
|
|
487
495
|
const [loading, setLoading] = useState(false)
|