@robosystems/client 0.2.0 → 0.2.2
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/GraphClient.d.ts +71 -0
- package/extensions/GraphClient.js +176 -0
- package/extensions/GraphClient.test.ts +285 -0
- package/extensions/GraphClient.ts +281 -0
- package/extensions/TableIngestClient.d.ts +1 -1
- package/extensions/TableIngestClient.js +20 -20
- package/extensions/TableIngestClient.test.ts +1 -1
- package/extensions/TableIngestClient.ts +23 -28
- package/extensions/hooks.d.ts +1 -1
- package/extensions/index.d.ts +5 -1
- package/extensions/index.js +14 -1
- package/extensions/index.test.ts +22 -0
- package/extensions/index.ts +15 -1
- package/package.json +1 -1
- package/sdk/sdk.gen.d.ts +528 -26
- package/sdk/sdk.gen.js +534 -32
- package/sdk/sdk.gen.ts +532 -30
- package/sdk/types.gen.d.ts +289 -82
- package/sdk/types.gen.ts +293 -82
- package/sdk-extensions/GraphClient.d.ts +71 -0
- package/sdk-extensions/GraphClient.js +176 -0
- package/sdk-extensions/GraphClient.test.ts +285 -0
- package/sdk-extensions/GraphClient.ts +281 -0
- package/sdk-extensions/TableIngestClient.d.ts +1 -1
- package/sdk-extensions/TableIngestClient.js +20 -20
- package/sdk-extensions/TableIngestClient.test.ts +1 -1
- package/sdk-extensions/TableIngestClient.ts +23 -28
- package/sdk-extensions/hooks.d.ts +1 -1
- package/sdk-extensions/index.d.ts +5 -1
- package/sdk-extensions/index.js +14 -1
- package/sdk-extensions/index.test.ts +22 -0
- package/sdk-extensions/index.ts +15 -1
- package/sdk.gen.d.ts +528 -26
- package/sdk.gen.js +534 -32
- package/sdk.gen.ts +532 -30
- package/types.gen.d.ts +289 -82
- package/types.gen.ts +293 -82
package/sdk.gen.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
2
|
|
|
3
3
|
import type { Options as ClientOptions, TDataShape, Client } from './client';
|
|
4
|
-
import type { RegisterUserData, RegisterUserResponses, RegisterUserErrors, LoginUserData, LoginUserResponses, LoginUserErrors, LogoutUserData, LogoutUserResponses, LogoutUserErrors, GetCurrentAuthUserData, GetCurrentAuthUserResponses, GetCurrentAuthUserErrors, RefreshAuthSessionData, RefreshAuthSessionResponses, RefreshAuthSessionErrors, ResendVerificationEmailData, ResendVerificationEmailResponses, ResendVerificationEmailErrors, VerifyEmailData, VerifyEmailResponses, VerifyEmailErrors, GetPasswordPolicyData, GetPasswordPolicyResponses, CheckPasswordStrengthData, CheckPasswordStrengthResponses, CheckPasswordStrengthErrors, ForgotPasswordData, ForgotPasswordResponses, ForgotPasswordErrors, ValidateResetTokenData, ValidateResetTokenResponses, ValidateResetTokenErrors, ResetPasswordData, ResetPasswordResponses, ResetPasswordErrors, GenerateSsoTokenData, GenerateSsoTokenResponses, GenerateSsoTokenErrors, SsoTokenExchangeData, SsoTokenExchangeResponses, SsoTokenExchangeErrors, CompleteSsoAuthData, CompleteSsoAuthResponses, CompleteSsoAuthErrors, GetCaptchaConfigData, GetCaptchaConfigResponses, GetServiceStatusData, GetServiceStatusResponses, GetCurrentUserData, GetCurrentUserResponses, GetCurrentUserErrors, UpdateUserData, UpdateUserResponses, UpdateUserErrors, GetAllCreditSummariesData, GetAllCreditSummariesResponses, GetAllCreditSummariesErrors, UpdateUserPasswordData, UpdateUserPasswordResponses, UpdateUserPasswordErrors, ListUserApiKeysData, ListUserApiKeysResponses, ListUserApiKeysErrors, CreateUserApiKeyData, CreateUserApiKeyResponses, CreateUserApiKeyErrors, RevokeUserApiKeyData, RevokeUserApiKeyResponses, RevokeUserApiKeyErrors, UpdateUserApiKeyData, UpdateUserApiKeyResponses, UpdateUserApiKeyErrors, GetUserLimitsData, GetUserLimitsResponses, GetUserLimitsErrors, GetUserUsageData, GetUserUsageResponses, GetUserUsageErrors, GetAllSharedRepositoryLimitsData, GetAllSharedRepositoryLimitsResponses, GetAllSharedRepositoryLimitsErrors, GetSharedRepositoryLimitsData, GetSharedRepositoryLimitsResponses, GetSharedRepositoryLimitsErrors, GetUserUsageOverviewData, GetUserUsageOverviewResponses, GetUserUsageOverviewErrors, GetDetailedUserAnalyticsData, GetDetailedUserAnalyticsResponses, GetDetailedUserAnalyticsErrors, GetUserSharedSubscriptionsData, GetUserSharedSubscriptionsResponses, GetUserSharedSubscriptionsErrors, SubscribeToSharedRepositoryData, SubscribeToSharedRepositoryResponses, SubscribeToSharedRepositoryErrors, UpgradeSharedRepositorySubscriptionData, UpgradeSharedRepositorySubscriptionResponses, UpgradeSharedRepositorySubscriptionErrors, CancelSharedRepositorySubscriptionData, CancelSharedRepositorySubscriptionResponses, CancelSharedRepositorySubscriptionErrors, GetSharedRepositoryCreditsData, GetSharedRepositoryCreditsResponses, GetSharedRepositoryCreditsErrors, GetRepositoryCreditsData, GetRepositoryCreditsResponses, GetRepositoryCreditsErrors, ListConnectionsData, ListConnectionsResponses, ListConnectionsErrors, CreateConnectionData, CreateConnectionResponses, CreateConnectionErrors, GetConnectionOptionsData, GetConnectionOptionsResponses, GetConnectionOptionsErrors, ExchangeLinkTokenData, ExchangeLinkTokenResponses, ExchangeLinkTokenErrors, CreateLinkTokenData, CreateLinkTokenResponses, CreateLinkTokenErrors, InitOAuthData, InitOAuthResponses, InitOAuthErrors, OauthCallbackData, OauthCallbackResponses, OauthCallbackErrors, DeleteConnectionData, DeleteConnectionResponses, DeleteConnectionErrors, GetConnectionData, GetConnectionResponses, GetConnectionErrors, SyncConnectionData, SyncConnectionResponses, SyncConnectionErrors, AutoSelectAgentData, AutoSelectAgentResponses, AutoSelectAgentErrors, ExecuteSpecificAgentData, ExecuteSpecificAgentResponses, ExecuteSpecificAgentErrors, BatchProcessQueriesData, BatchProcessQueriesResponses, BatchProcessQueriesErrors, ListAgentsData, ListAgentsResponses, ListAgentsErrors, GetAgentMetadataData, GetAgentMetadataResponses, GetAgentMetadataErrors, RecommendAgentData, RecommendAgentResponses, RecommendAgentErrors, ListMcpToolsData, ListMcpToolsResponses, ListMcpToolsErrors, CallMcpToolData, CallMcpToolResponses, CallMcpToolErrors, ListBackupsData, ListBackupsResponses, ListBackupsErrors, CreateBackupData, CreateBackupResponses, CreateBackupErrors, GetBackupDownloadUrlData, GetBackupDownloadUrlResponses, GetBackupDownloadUrlErrors, RestoreBackupData, RestoreBackupResponses, RestoreBackupErrors, GetBackupStatsData, GetBackupStatsResponses, GetBackupStatsErrors, GetGraphMetricsData, GetGraphMetricsResponses, GetGraphMetricsErrors, GetGraphUsageStatsData, GetGraphUsageStatsResponses, GetGraphUsageStatsErrors, ExecuteCypherQueryData, ExecuteCypherQueryResponses, ExecuteCypherQueryErrors, GetGraphSchemaData, GetGraphSchemaResponses, GetGraphSchemaErrors, ExportGraphSchemaData, ExportGraphSchemaResponses, ExportGraphSchemaErrors, ValidateSchemaData, ValidateSchemaResponses, ValidateSchemaErrors, GetCurrentGraphBillData, GetCurrentGraphBillResponses, GetCurrentGraphBillErrors, GetGraphUsageDetailsData, GetGraphUsageDetailsResponses, GetGraphUsageDetailsErrors, GetGraphBillingHistoryData, GetGraphBillingHistoryResponses, GetGraphBillingHistoryErrors, GetGraphMonthlyBillData, GetGraphMonthlyBillResponses, GetGraphMonthlyBillErrors, GetCreditSummaryData, GetCreditSummaryResponses, GetCreditSummaryErrors, ListCreditTransactionsData, ListCreditTransactionsResponses, ListCreditTransactionsErrors, CheckCreditBalanceData, CheckCreditBalanceResponses, CheckCreditBalanceErrors, GetStorageUsageData, GetStorageUsageResponses, GetStorageUsageErrors, CheckStorageLimitsData, CheckStorageLimitsResponses, CheckStorageLimitsErrors, GetDatabaseHealthData, GetDatabaseHealthResponses, GetDatabaseHealthErrors, GetDatabaseInfoData, GetDatabaseInfoResponses, GetDatabaseInfoErrors, GetGraphLimitsData, GetGraphLimitsResponses, GetGraphLimitsErrors, ListSubgraphsData, ListSubgraphsResponses, ListSubgraphsErrors, CreateSubgraphData, CreateSubgraphResponses, CreateSubgraphErrors, DeleteSubgraphData, DeleteSubgraphResponses, DeleteSubgraphErrors, GetSubgraphInfoData, GetSubgraphInfoResponses, GetSubgraphInfoErrors, GetSubgraphQuotaData, GetSubgraphQuotaResponses, GetSubgraphQuotaErrors,
|
|
4
|
+
import type { RegisterUserData, RegisterUserResponses, RegisterUserErrors, LoginUserData, LoginUserResponses, LoginUserErrors, LogoutUserData, LogoutUserResponses, LogoutUserErrors, GetCurrentAuthUserData, GetCurrentAuthUserResponses, GetCurrentAuthUserErrors, RefreshAuthSessionData, RefreshAuthSessionResponses, RefreshAuthSessionErrors, ResendVerificationEmailData, ResendVerificationEmailResponses, ResendVerificationEmailErrors, VerifyEmailData, VerifyEmailResponses, VerifyEmailErrors, GetPasswordPolicyData, GetPasswordPolicyResponses, CheckPasswordStrengthData, CheckPasswordStrengthResponses, CheckPasswordStrengthErrors, ForgotPasswordData, ForgotPasswordResponses, ForgotPasswordErrors, ValidateResetTokenData, ValidateResetTokenResponses, ValidateResetTokenErrors, ResetPasswordData, ResetPasswordResponses, ResetPasswordErrors, GenerateSsoTokenData, GenerateSsoTokenResponses, GenerateSsoTokenErrors, SsoTokenExchangeData, SsoTokenExchangeResponses, SsoTokenExchangeErrors, CompleteSsoAuthData, CompleteSsoAuthResponses, CompleteSsoAuthErrors, GetCaptchaConfigData, GetCaptchaConfigResponses, GetServiceStatusData, GetServiceStatusResponses, GetCurrentUserData, GetCurrentUserResponses, GetCurrentUserErrors, UpdateUserData, UpdateUserResponses, UpdateUserErrors, GetAllCreditSummariesData, GetAllCreditSummariesResponses, GetAllCreditSummariesErrors, UpdateUserPasswordData, UpdateUserPasswordResponses, UpdateUserPasswordErrors, ListUserApiKeysData, ListUserApiKeysResponses, ListUserApiKeysErrors, CreateUserApiKeyData, CreateUserApiKeyResponses, CreateUserApiKeyErrors, RevokeUserApiKeyData, RevokeUserApiKeyResponses, RevokeUserApiKeyErrors, UpdateUserApiKeyData, UpdateUserApiKeyResponses, UpdateUserApiKeyErrors, GetUserLimitsData, GetUserLimitsResponses, GetUserLimitsErrors, GetUserUsageData, GetUserUsageResponses, GetUserUsageErrors, GetAllSharedRepositoryLimitsData, GetAllSharedRepositoryLimitsResponses, GetAllSharedRepositoryLimitsErrors, GetSharedRepositoryLimitsData, GetSharedRepositoryLimitsResponses, GetSharedRepositoryLimitsErrors, GetUserUsageOverviewData, GetUserUsageOverviewResponses, GetUserUsageOverviewErrors, GetDetailedUserAnalyticsData, GetDetailedUserAnalyticsResponses, GetDetailedUserAnalyticsErrors, GetUserSharedSubscriptionsData, GetUserSharedSubscriptionsResponses, GetUserSharedSubscriptionsErrors, SubscribeToSharedRepositoryData, SubscribeToSharedRepositoryResponses, SubscribeToSharedRepositoryErrors, UpgradeSharedRepositorySubscriptionData, UpgradeSharedRepositorySubscriptionResponses, UpgradeSharedRepositorySubscriptionErrors, CancelSharedRepositorySubscriptionData, CancelSharedRepositorySubscriptionResponses, CancelSharedRepositorySubscriptionErrors, GetSharedRepositoryCreditsData, GetSharedRepositoryCreditsResponses, GetSharedRepositoryCreditsErrors, GetRepositoryCreditsData, GetRepositoryCreditsResponses, GetRepositoryCreditsErrors, ListConnectionsData, ListConnectionsResponses, ListConnectionsErrors, CreateConnectionData, CreateConnectionResponses, CreateConnectionErrors, GetConnectionOptionsData, GetConnectionOptionsResponses, GetConnectionOptionsErrors, ExchangeLinkTokenData, ExchangeLinkTokenResponses, ExchangeLinkTokenErrors, CreateLinkTokenData, CreateLinkTokenResponses, CreateLinkTokenErrors, InitOAuthData, InitOAuthResponses, InitOAuthErrors, OauthCallbackData, OauthCallbackResponses, OauthCallbackErrors, DeleteConnectionData, DeleteConnectionResponses, DeleteConnectionErrors, GetConnectionData, GetConnectionResponses, GetConnectionErrors, SyncConnectionData, SyncConnectionResponses, SyncConnectionErrors, AutoSelectAgentData, AutoSelectAgentResponses, AutoSelectAgentErrors, ExecuteSpecificAgentData, ExecuteSpecificAgentResponses, ExecuteSpecificAgentErrors, BatchProcessQueriesData, BatchProcessQueriesResponses, BatchProcessQueriesErrors, ListAgentsData, ListAgentsResponses, ListAgentsErrors, GetAgentMetadataData, GetAgentMetadataResponses, GetAgentMetadataErrors, RecommendAgentData, RecommendAgentResponses, RecommendAgentErrors, ListMcpToolsData, ListMcpToolsResponses, ListMcpToolsErrors, CallMcpToolData, CallMcpToolResponses, CallMcpToolErrors, ListBackupsData, ListBackupsResponses, ListBackupsErrors, CreateBackupData, CreateBackupResponses, CreateBackupErrors, GetBackupDownloadUrlData, GetBackupDownloadUrlResponses, GetBackupDownloadUrlErrors, RestoreBackupData, RestoreBackupResponses, RestoreBackupErrors, GetBackupStatsData, GetBackupStatsResponses, GetBackupStatsErrors, GetGraphMetricsData, GetGraphMetricsResponses, GetGraphMetricsErrors, GetGraphUsageStatsData, GetGraphUsageStatsResponses, GetGraphUsageStatsErrors, ExecuteCypherQueryData, ExecuteCypherQueryResponses, ExecuteCypherQueryErrors, GetGraphSchemaData, GetGraphSchemaResponses, GetGraphSchemaErrors, ExportGraphSchemaData, ExportGraphSchemaResponses, ExportGraphSchemaErrors, ValidateSchemaData, ValidateSchemaResponses, ValidateSchemaErrors, GetCurrentGraphBillData, GetCurrentGraphBillResponses, GetCurrentGraphBillErrors, GetGraphUsageDetailsData, GetGraphUsageDetailsResponses, GetGraphUsageDetailsErrors, GetGraphBillingHistoryData, GetGraphBillingHistoryResponses, GetGraphBillingHistoryErrors, GetGraphMonthlyBillData, GetGraphMonthlyBillResponses, GetGraphMonthlyBillErrors, GetCreditSummaryData, GetCreditSummaryResponses, GetCreditSummaryErrors, ListCreditTransactionsData, ListCreditTransactionsResponses, ListCreditTransactionsErrors, CheckCreditBalanceData, CheckCreditBalanceResponses, CheckCreditBalanceErrors, GetStorageUsageData, GetStorageUsageResponses, GetStorageUsageErrors, CheckStorageLimitsData, CheckStorageLimitsResponses, CheckStorageLimitsErrors, GetDatabaseHealthData, GetDatabaseHealthResponses, GetDatabaseHealthErrors, GetDatabaseInfoData, GetDatabaseInfoResponses, GetDatabaseInfoErrors, GetGraphLimitsData, GetGraphLimitsResponses, GetGraphLimitsErrors, ListSubgraphsData, ListSubgraphsResponses, ListSubgraphsErrors, CreateSubgraphData, CreateSubgraphResponses, CreateSubgraphErrors, DeleteSubgraphData, DeleteSubgraphResponses, DeleteSubgraphErrors, GetSubgraphInfoData, GetSubgraphInfoResponses, GetSubgraphInfoErrors, GetSubgraphQuotaData, GetSubgraphQuotaResponses, GetSubgraphQuotaErrors, ListTablesData, ListTablesResponses, ListTablesErrors, ListTableFilesData, ListTableFilesResponses, ListTableFilesErrors, GetUploadUrlData, GetUploadUrlResponses, GetUploadUrlErrors, DeleteFileData, DeleteFileResponses, DeleteFileErrors, GetFileInfoData, GetFileInfoResponses, GetFileInfoErrors, UpdateFileStatusData, UpdateFileStatusResponses, UpdateFileStatusErrors, IngestTablesData, IngestTablesResponses, IngestTablesErrors, QueryTablesData, QueryTablesResponses, QueryTablesErrors, GetGraphsData, GetGraphsResponses, GetGraphsErrors, CreateGraphData, CreateGraphResponses, CreateGraphErrors, GetAvailableExtensionsData, GetAvailableExtensionsResponses, SelectGraphData, SelectGraphResponses, SelectGraphErrors, GetServiceOfferingsData, GetServiceOfferingsResponses, GetServiceOfferingsErrors, StreamOperationEventsData, StreamOperationEventsResponses, StreamOperationEventsErrors, GetOperationStatusData, GetOperationStatusResponses, GetOperationStatusErrors, CancelOperationData, CancelOperationResponses, CancelOperationErrors } from './types.gen';
|
|
5
5
|
import { client as _heyApiClient } from './client.gen';
|
|
6
6
|
|
|
7
7
|
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & {
|
|
@@ -2403,10 +2403,75 @@ export const getSubgraphQuota = <ThrowOnError extends boolean = false>(options:
|
|
|
2403
2403
|
|
|
2404
2404
|
/**
|
|
2405
2405
|
* List Staging Tables
|
|
2406
|
-
* List all DuckDB staging tables
|
|
2406
|
+
* List all DuckDB staging tables with comprehensive metrics and status.
|
|
2407
|
+
*
|
|
2408
|
+
* **Purpose:**
|
|
2409
|
+
* Get a complete inventory of all staging tables for a graph, including
|
|
2410
|
+
* file counts, storage sizes, and row estimates. Essential for monitoring
|
|
2411
|
+
* the data pipeline and determining which tables are ready for ingestion.
|
|
2412
|
+
*
|
|
2413
|
+
* **What You Get:**
|
|
2414
|
+
* - Table name and type (node/relationship)
|
|
2415
|
+
* - File count per table
|
|
2416
|
+
* - Total storage size in bytes
|
|
2417
|
+
* - Estimated row count
|
|
2418
|
+
* - S3 location pattern
|
|
2419
|
+
* - Ready-for-ingestion status
|
|
2420
|
+
*
|
|
2421
|
+
* **Use Cases:**
|
|
2422
|
+
* - Monitor data upload progress
|
|
2423
|
+
* - Check which tables have files ready
|
|
2424
|
+
* - Track storage consumption
|
|
2425
|
+
* - Validate pipeline before ingestion
|
|
2426
|
+
* - Capacity planning
|
|
2427
|
+
*
|
|
2428
|
+
* **Workflow:**
|
|
2429
|
+
* 1. List tables to see current state
|
|
2430
|
+
* 2. Upload files to empty tables
|
|
2431
|
+
* 3. Re-list to verify uploads
|
|
2432
|
+
* 4. Check file counts and sizes
|
|
2433
|
+
* 5. Ingest when ready
|
|
2434
|
+
*
|
|
2435
|
+
* **Example Response:**
|
|
2436
|
+
* ```json
|
|
2437
|
+
* {
|
|
2438
|
+
* "tables": [
|
|
2439
|
+
* {
|
|
2440
|
+
* "table_name": "Entity",
|
|
2441
|
+
* "row_count": 5000,
|
|
2442
|
+
* "file_count": 3,
|
|
2443
|
+
* "total_size_bytes": 2457600,
|
|
2444
|
+
* "s3_location": "s3://bucket/user-staging/user123/graph456/Entity***.parquet"
|
|
2445
|
+
* },
|
|
2446
|
+
* {
|
|
2447
|
+
* "table_name": "Transaction",
|
|
2448
|
+
* "row_count": 15000,
|
|
2449
|
+
* "file_count": 5,
|
|
2450
|
+
* "total_size_bytes": 8192000,
|
|
2451
|
+
* "s3_location": "s3://bucket/user-staging/user123/graph456/Transaction***.parquet"
|
|
2452
|
+
* }
|
|
2453
|
+
* ],
|
|
2454
|
+
* "total_count": 2
|
|
2455
|
+
* }
|
|
2456
|
+
* ```
|
|
2457
|
+
*
|
|
2458
|
+
* **Example Usage:**
|
|
2459
|
+
* ```bash
|
|
2460
|
+
* curl -H "Authorization: Bearer YOUR_TOKEN" \
|
|
2461
|
+
* https://api.robosystems.ai/v1/graphs/kg123/tables
|
|
2462
|
+
* ```
|
|
2463
|
+
*
|
|
2464
|
+
* **Tips:**
|
|
2465
|
+
* - Tables with `file_count > 0` have data ready
|
|
2466
|
+
* - Check `total_size_bytes` for storage monitoring
|
|
2467
|
+
* - Use `s3_location` to verify upload paths
|
|
2468
|
+
* - Empty tables (file_count=0) are skipped during ingestion
|
|
2469
|
+
*
|
|
2470
|
+
* **Note:**
|
|
2471
|
+
* Table queries are included - no credit consumption.
|
|
2407
2472
|
*/
|
|
2408
|
-
export const
|
|
2409
|
-
return (options.client ?? _heyApiClient).get<
|
|
2473
|
+
export const listTables = <ThrowOnError extends boolean = false>(options: Options<ListTablesData, ThrowOnError>) => {
|
|
2474
|
+
return (options.client ?? _heyApiClient).get<ListTablesResponses, ListTablesErrors, ThrowOnError>({
|
|
2410
2475
|
security: [
|
|
2411
2476
|
{
|
|
2412
2477
|
name: 'X-API-Key',
|
|
@@ -2423,11 +2488,78 @@ export const listTablesV1GraphsGraphIdTablesGet = <ThrowOnError extends boolean
|
|
|
2423
2488
|
};
|
|
2424
2489
|
|
|
2425
2490
|
/**
|
|
2426
|
-
* List Files in Table
|
|
2427
|
-
* List all files uploaded to a staging table
|
|
2491
|
+
* List Files in Staging Table
|
|
2492
|
+
* List all files uploaded to a staging table with comprehensive metadata.
|
|
2493
|
+
*
|
|
2494
|
+
* **Purpose:**
|
|
2495
|
+
* Get a complete inventory of all files in a staging table, including upload status,
|
|
2496
|
+
* file sizes, row counts, and S3 locations. Essential for monitoring upload progress
|
|
2497
|
+
* and validating data before ingestion.
|
|
2498
|
+
*
|
|
2499
|
+
* **Use Cases:**
|
|
2500
|
+
* - Monitor file upload progress
|
|
2501
|
+
* - Verify files are ready for ingestion
|
|
2502
|
+
* - Check file formats and sizes
|
|
2503
|
+
* - Track storage usage per table
|
|
2504
|
+
* - Identify failed or incomplete uploads
|
|
2505
|
+
* - Pre-ingestion validation
|
|
2506
|
+
*
|
|
2507
|
+
* **What You Get:**
|
|
2508
|
+
* - File ID and name
|
|
2509
|
+
* - File format (parquet, csv, etc.)
|
|
2510
|
+
* - Size in bytes
|
|
2511
|
+
* - Row count (if available)
|
|
2512
|
+
* - Upload status and method
|
|
2513
|
+
* - Creation and upload timestamps
|
|
2514
|
+
* - S3 key for reference
|
|
2515
|
+
*
|
|
2516
|
+
* **Upload Status Values:**
|
|
2517
|
+
* - `created`: File record created, not yet uploaded
|
|
2518
|
+
* - `uploading`: Upload in progress
|
|
2519
|
+
* - `uploaded`: Successfully uploaded, ready for ingestion
|
|
2520
|
+
* - `failed`: Upload failed
|
|
2521
|
+
*
|
|
2522
|
+
* **Example Response:**
|
|
2523
|
+
* ```json
|
|
2524
|
+
* {
|
|
2525
|
+
* "graph_id": "kg123",
|
|
2526
|
+
* "table_name": "Entity",
|
|
2527
|
+
* "files": [
|
|
2528
|
+
* {
|
|
2529
|
+
* "file_id": "f123",
|
|
2530
|
+
* "file_name": "entities_batch1.parquet",
|
|
2531
|
+
* "file_format": "parquet",
|
|
2532
|
+
* "size_bytes": 1048576,
|
|
2533
|
+
* "row_count": 5000,
|
|
2534
|
+
* "upload_status": "uploaded",
|
|
2535
|
+
* "upload_method": "presigned_url",
|
|
2536
|
+
* "created_at": "2025-10-28T10:00:00Z",
|
|
2537
|
+
* "uploaded_at": "2025-10-28T10:01:30Z",
|
|
2538
|
+
* "s3_key": "user-staging/user123/kg123/Entity/entities_batch1.parquet"
|
|
2539
|
+
* }
|
|
2540
|
+
* ],
|
|
2541
|
+
* "total_files": 1,
|
|
2542
|
+
* "total_size_bytes": 1048576
|
|
2543
|
+
* }
|
|
2544
|
+
* ```
|
|
2545
|
+
*
|
|
2546
|
+
* **Example Usage:**
|
|
2547
|
+
* ```bash
|
|
2548
|
+
* curl -H "Authorization: Bearer YOUR_TOKEN" \
|
|
2549
|
+
* https://api.robosystems.ai/v1/graphs/kg123/tables/Entity/files
|
|
2550
|
+
* ```
|
|
2551
|
+
*
|
|
2552
|
+
* **Tips:**
|
|
2553
|
+
* - Only `uploaded` files are ingested
|
|
2554
|
+
* - Check `row_count` to estimate data volume
|
|
2555
|
+
* - Use `total_size_bytes` for storage monitoring
|
|
2556
|
+
* - Files with `failed` status should be deleted and re-uploaded
|
|
2557
|
+
*
|
|
2558
|
+
* **Note:**
|
|
2559
|
+
* File listing is included - no credit consumption.
|
|
2428
2560
|
*/
|
|
2429
|
-
export const
|
|
2430
|
-
return (options.client ?? _heyApiClient).get<
|
|
2561
|
+
export const listTableFiles = <ThrowOnError extends boolean = false>(options: Options<ListTableFilesData, ThrowOnError>) => {
|
|
2562
|
+
return (options.client ?? _heyApiClient).get<ListTableFilesResponses, ListTableFilesErrors, ThrowOnError>({
|
|
2431
2563
|
security: [
|
|
2432
2564
|
{
|
|
2433
2565
|
name: 'X-API-Key',
|
|
@@ -2444,11 +2576,82 @@ export const listTableFilesV1GraphsGraphIdTablesTableNameFilesGet = <ThrowOnErro
|
|
|
2444
2576
|
};
|
|
2445
2577
|
|
|
2446
2578
|
/**
|
|
2447
|
-
*
|
|
2448
|
-
*
|
|
2579
|
+
* Get File Upload URL
|
|
2580
|
+
* Generate a presigned S3 URL for secure file upload.
|
|
2581
|
+
*
|
|
2582
|
+
* **Purpose:**
|
|
2583
|
+
* Initiate file upload to a staging table by generating a secure, time-limited
|
|
2584
|
+
* presigned S3 URL. Files are uploaded directly to S3, bypassing the API for
|
|
2585
|
+
* optimal performance.
|
|
2586
|
+
*
|
|
2587
|
+
* **Upload Workflow:**
|
|
2588
|
+
* 1. Call this endpoint to get presigned URL
|
|
2589
|
+
* 2. PUT file directly to S3 URL (using curl, axios, etc.)
|
|
2590
|
+
* 3. Call PATCH /tables/files/{file_id} with status='uploaded'
|
|
2591
|
+
* 4. Backend validates file and calculates metrics
|
|
2592
|
+
* 5. File ready for ingestion
|
|
2593
|
+
*
|
|
2594
|
+
* **Supported Formats:**
|
|
2595
|
+
* - Parquet (`application/x-parquet` with `.parquet` extension)
|
|
2596
|
+
* - CSV (`text/csv` with `.csv` extension)
|
|
2597
|
+
* - JSON (`application/json` with `.json` extension)
|
|
2598
|
+
*
|
|
2599
|
+
* **Validation:**
|
|
2600
|
+
* - File extension must match content type
|
|
2601
|
+
* - File name 1-255 characters
|
|
2602
|
+
* - No path traversal characters (.. / \)
|
|
2603
|
+
* - Auto-creates table if it doesn't exist
|
|
2604
|
+
*
|
|
2605
|
+
* **Auto-Table Creation:**
|
|
2606
|
+
* If the table doesn't exist, it's automatically created with:
|
|
2607
|
+
* - Type inferred from name (e.g., "Transaction" → relationship)
|
|
2608
|
+
* - Empty schema (populated on ingestion)
|
|
2609
|
+
* - Ready for file uploads
|
|
2610
|
+
*
|
|
2611
|
+
* **Example Response:**
|
|
2612
|
+
* ```json
|
|
2613
|
+
* {
|
|
2614
|
+
* "upload_url": "https://bucket.s3.amazonaws.com/path?X-Amz-Algorithm=...",
|
|
2615
|
+
* "expires_in": 3600,
|
|
2616
|
+
* "file_id": "f123-456-789",
|
|
2617
|
+
* "s3_key": "user-staging/user123/kg456/Entity/f123.../data.parquet"
|
|
2618
|
+
* }
|
|
2619
|
+
* ```
|
|
2620
|
+
*
|
|
2621
|
+
* **Example Usage:**
|
|
2622
|
+
* ```bash
|
|
2623
|
+
* # Step 1: Get upload URL
|
|
2624
|
+
* curl -X POST "https://api.robosystems.ai/v1/graphs/kg123/tables/Entity/files" \
|
|
2625
|
+
* -H "Authorization: Bearer YOUR_TOKEN" \
|
|
2626
|
+
* -H "Content-Type: application/json" \
|
|
2627
|
+
* -d '{
|
|
2628
|
+
* "file_name": "entities.parquet",
|
|
2629
|
+
* "content_type": "application/x-parquet"
|
|
2630
|
+
* }'
|
|
2631
|
+
*
|
|
2632
|
+
* # Step 2: Upload file directly to S3
|
|
2633
|
+
* curl -X PUT "$UPLOAD_URL" \
|
|
2634
|
+
* -H "Content-Type: application/x-parquet" \
|
|
2635
|
+
* --data-binary "@entities.parquet"
|
|
2636
|
+
*
|
|
2637
|
+
* # Step 3: Mark as uploaded
|
|
2638
|
+
* curl -X PATCH "https://api.robosystems.ai/v1/graphs/kg123/tables/files/$FILE_ID" \
|
|
2639
|
+
* -H "Authorization: Bearer YOUR_TOKEN" \
|
|
2640
|
+
* -H "Content-Type: application/json" \
|
|
2641
|
+
* -d '{"status": "uploaded"}'
|
|
2642
|
+
* ```
|
|
2643
|
+
*
|
|
2644
|
+
* **Tips:**
|
|
2645
|
+
* - Presigned URLs expire (default: 1 hour)
|
|
2646
|
+
* - Use appropriate Content-Type header when uploading to S3
|
|
2647
|
+
* - File extension must match content type
|
|
2648
|
+
* - Large files benefit from direct S3 upload
|
|
2649
|
+
*
|
|
2650
|
+
* **Note:**
|
|
2651
|
+
* Upload URL generation is included - no credit consumption.
|
|
2449
2652
|
*/
|
|
2450
|
-
export const
|
|
2451
|
-
return (options.client ?? _heyApiClient).post<
|
|
2653
|
+
export const getUploadUrl = <ThrowOnError extends boolean = false>(options: Options<GetUploadUrlData, ThrowOnError>) => {
|
|
2654
|
+
return (options.client ?? _heyApiClient).post<GetUploadUrlResponses, GetUploadUrlErrors, ThrowOnError>({
|
|
2452
2655
|
security: [
|
|
2453
2656
|
{
|
|
2454
2657
|
name: 'X-API-Key',
|
|
@@ -2469,11 +2672,60 @@ export const getUploadUrlV1GraphsGraphIdTablesTableNameFilesPost = <ThrowOnError
|
|
|
2469
2672
|
};
|
|
2470
2673
|
|
|
2471
2674
|
/**
|
|
2472
|
-
* Delete File
|
|
2473
|
-
* Delete a
|
|
2675
|
+
* Delete File from Staging
|
|
2676
|
+
* Delete a file from S3 storage and database tracking.
|
|
2677
|
+
*
|
|
2678
|
+
* **Purpose:**
|
|
2679
|
+
* Remove unwanted, duplicate, or incorrect files from staging tables before ingestion.
|
|
2680
|
+
* The file is deleted from both S3 and database tracking, and table statistics
|
|
2681
|
+
* are automatically recalculated.
|
|
2682
|
+
*
|
|
2683
|
+
* **Use Cases:**
|
|
2684
|
+
* - Remove duplicate uploads
|
|
2685
|
+
* - Delete files with incorrect data
|
|
2686
|
+
* - Clean up failed uploads
|
|
2687
|
+
* - Fix data quality issues before ingestion
|
|
2688
|
+
* - Manage storage usage
|
|
2689
|
+
*
|
|
2690
|
+
* **What Happens:**
|
|
2691
|
+
* 1. File deleted from S3 storage
|
|
2692
|
+
* 2. Database tracking record removed
|
|
2693
|
+
* 3. Table statistics recalculated (file count, size, row count)
|
|
2694
|
+
* 4. DuckDB automatically excludes file from future queries
|
|
2695
|
+
*
|
|
2696
|
+
* **Security:**
|
|
2697
|
+
* - Write access required (verified via auth)
|
|
2698
|
+
* - Shared repositories block file deletions
|
|
2699
|
+
* - Full audit trail of deletion operations
|
|
2700
|
+
* - Cannot delete after ingestion to graph
|
|
2701
|
+
*
|
|
2702
|
+
* **Example Response:**
|
|
2703
|
+
* ```json
|
|
2704
|
+
* {
|
|
2705
|
+
* "status": "deleted",
|
|
2706
|
+
* "file_id": "f123",
|
|
2707
|
+
* "file_name": "entities_batch1.parquet",
|
|
2708
|
+
* "message": "File deleted successfully. DuckDB will automatically exclude it from queries."
|
|
2709
|
+
* }
|
|
2710
|
+
* ```
|
|
2711
|
+
*
|
|
2712
|
+
* **Example Usage:**
|
|
2713
|
+
* ```bash
|
|
2714
|
+
* curl -X DELETE -H "Authorization: Bearer YOUR_TOKEN" \
|
|
2715
|
+
* https://api.robosystems.ai/v1/graphs/kg123/tables/files/f123
|
|
2716
|
+
* ```
|
|
2717
|
+
*
|
|
2718
|
+
* **Tips:**
|
|
2719
|
+
* - Delete files before ingestion for best results
|
|
2720
|
+
* - Table statistics update automatically
|
|
2721
|
+
* - No need to refresh DuckDB - exclusion is automatic
|
|
2722
|
+
* - Consider re-uploading corrected version after deletion
|
|
2723
|
+
*
|
|
2724
|
+
* **Note:**
|
|
2725
|
+
* File deletion is included - no credit consumption.
|
|
2474
2726
|
*/
|
|
2475
|
-
export const
|
|
2476
|
-
return (options.client ?? _heyApiClient).delete<
|
|
2727
|
+
export const deleteFile = <ThrowOnError extends boolean = false>(options: Options<DeleteFileData, ThrowOnError>) => {
|
|
2728
|
+
return (options.client ?? _heyApiClient).delete<DeleteFileResponses, DeleteFileErrors, ThrowOnError>({
|
|
2477
2729
|
security: [
|
|
2478
2730
|
{
|
|
2479
2731
|
name: 'X-API-Key',
|
|
@@ -2490,11 +2742,51 @@ export const deleteFileV1GraphsGraphIdTablesFilesFileIdDelete = <ThrowOnError ex
|
|
|
2490
2742
|
};
|
|
2491
2743
|
|
|
2492
2744
|
/**
|
|
2493
|
-
* Get File
|
|
2494
|
-
* Get detailed information about a specific file
|
|
2745
|
+
* Get File Information
|
|
2746
|
+
* Get detailed information about a specific file.
|
|
2747
|
+
*
|
|
2748
|
+
* **Purpose:**
|
|
2749
|
+
* Retrieve comprehensive metadata for a single file, including upload status,
|
|
2750
|
+
* size, row count, and timestamps. Useful for validating individual files
|
|
2751
|
+
* before ingestion.
|
|
2752
|
+
*
|
|
2753
|
+
* **Use Cases:**
|
|
2754
|
+
* - Validate file upload completion
|
|
2755
|
+
* - Check file metadata before ingestion
|
|
2756
|
+
* - Debug upload issues
|
|
2757
|
+
* - Verify file format and size
|
|
2758
|
+
* - Track file lifecycle
|
|
2759
|
+
*
|
|
2760
|
+
* **Example Response:**
|
|
2761
|
+
* ```json
|
|
2762
|
+
* {
|
|
2763
|
+
* "file_id": "f123",
|
|
2764
|
+
* "graph_id": "kg123",
|
|
2765
|
+
* "table_id": "t456",
|
|
2766
|
+
* "table_name": "Entity",
|
|
2767
|
+
* "file_name": "entities_batch1.parquet",
|
|
2768
|
+
* "file_format": "parquet",
|
|
2769
|
+
* "size_bytes": 1048576,
|
|
2770
|
+
* "row_count": 5000,
|
|
2771
|
+
* "upload_status": "uploaded",
|
|
2772
|
+
* "upload_method": "presigned_url",
|
|
2773
|
+
* "created_at": "2025-10-28T10:00:00Z",
|
|
2774
|
+
* "uploaded_at": "2025-10-28T10:01:30Z",
|
|
2775
|
+
* "s3_key": "user-staging/user123/kg123/Entity/entities_batch1.parquet"
|
|
2776
|
+
* }
|
|
2777
|
+
* ```
|
|
2778
|
+
*
|
|
2779
|
+
* **Example Usage:**
|
|
2780
|
+
* ```bash
|
|
2781
|
+
* curl -H "Authorization: Bearer YOUR_TOKEN" \
|
|
2782
|
+
* https://api.robosystems.ai/v1/graphs/kg123/tables/files/f123
|
|
2783
|
+
* ```
|
|
2784
|
+
*
|
|
2785
|
+
* **Note:**
|
|
2786
|
+
* File info retrieval is included - no credit consumption.
|
|
2495
2787
|
*/
|
|
2496
|
-
export const
|
|
2497
|
-
return (options.client ?? _heyApiClient).get<
|
|
2788
|
+
export const getFileInfo = <ThrowOnError extends boolean = false>(options: Options<GetFileInfoData, ThrowOnError>) => {
|
|
2789
|
+
return (options.client ?? _heyApiClient).get<GetFileInfoResponses, GetFileInfoErrors, ThrowOnError>({
|
|
2498
2790
|
security: [
|
|
2499
2791
|
{
|
|
2500
2792
|
name: 'X-API-Key',
|
|
@@ -2511,11 +2803,72 @@ export const getFileInfoV1GraphsGraphIdTablesFilesFileIdGet = <ThrowOnError exte
|
|
|
2511
2803
|
};
|
|
2512
2804
|
|
|
2513
2805
|
/**
|
|
2514
|
-
* Update File
|
|
2515
|
-
* Update file
|
|
2806
|
+
* Update File Upload Status
|
|
2807
|
+
* Update file status after upload completes.
|
|
2808
|
+
*
|
|
2809
|
+
* **Purpose:**
|
|
2810
|
+
* Mark files as uploaded after successful S3 upload. The backend validates
|
|
2811
|
+
* the file, calculates size and row count, enforces storage limits, and
|
|
2812
|
+
* registers the DuckDB table for queries.
|
|
2813
|
+
*
|
|
2814
|
+
* **Status Values:**
|
|
2815
|
+
* - `uploaded`: File successfully uploaded to S3 (triggers validation)
|
|
2816
|
+
* - `disabled`: Exclude file from ingestion
|
|
2817
|
+
* - `archived`: Soft delete file
|
|
2818
|
+
*
|
|
2819
|
+
* **What Happens on 'uploaded' Status:**
|
|
2820
|
+
* 1. Verify file exists in S3
|
|
2821
|
+
* 2. Calculate actual file size
|
|
2822
|
+
* 3. Enforce tier storage limits
|
|
2823
|
+
* 4. Calculate or estimate row count
|
|
2824
|
+
* 5. Update table statistics
|
|
2825
|
+
* 6. Register DuckDB external table
|
|
2826
|
+
* 7. File ready for ingestion
|
|
2827
|
+
*
|
|
2828
|
+
* **Row Count Calculation:**
|
|
2829
|
+
* - **Parquet**: Exact count from file metadata
|
|
2830
|
+
* - **CSV**: Count rows (minus header)
|
|
2831
|
+
* - **JSON**: Count array elements
|
|
2832
|
+
* - **Fallback**: Estimate from file size if reading fails
|
|
2833
|
+
*
|
|
2834
|
+
* **Storage Limits:**
|
|
2835
|
+
* Enforced per subscription tier:
|
|
2836
|
+
* - Prevents uploads exceeding tier limit
|
|
2837
|
+
* - Returns HTTP 413 if limit exceeded
|
|
2838
|
+
* - Check current usage before large uploads
|
|
2839
|
+
*
|
|
2840
|
+
* **Example Response:**
|
|
2841
|
+
* ```json
|
|
2842
|
+
* {
|
|
2843
|
+
* "status": "success",
|
|
2844
|
+
* "file_id": "f123",
|
|
2845
|
+
* "upload_status": "uploaded",
|
|
2846
|
+
* "file_size_bytes": 1048576,
|
|
2847
|
+
* "row_count": 5000,
|
|
2848
|
+
* "message": "File validated and ready for ingestion"
|
|
2849
|
+
* }
|
|
2850
|
+
* ```
|
|
2851
|
+
*
|
|
2852
|
+
* **Example Usage:**
|
|
2853
|
+
* ```bash
|
|
2854
|
+
* # After uploading file to S3 presigned URL
|
|
2855
|
+
* curl -X PATCH "https://api.robosystems.ai/v1/graphs/kg123/tables/files/f123" \
|
|
2856
|
+
* -H "Authorization: Bearer YOUR_TOKEN" \
|
|
2857
|
+
* -H "Content-Type: application/json" \
|
|
2858
|
+
* -d '{"status": "uploaded"}'
|
|
2859
|
+
* ```
|
|
2860
|
+
*
|
|
2861
|
+
* **Tips:**
|
|
2862
|
+
* - Always call this after S3 upload completes
|
|
2863
|
+
* - Check response for actual row count
|
|
2864
|
+
* - Storage limit errors (413) mean tier upgrade needed
|
|
2865
|
+
* - DuckDB registration failures are non-fatal (retried later)
|
|
2866
|
+
*
|
|
2867
|
+
* **Note:**
|
|
2868
|
+
* Status updates are included - no credit consumption.
|
|
2516
2869
|
*/
|
|
2517
|
-
export const
|
|
2518
|
-
return (options.client ?? _heyApiClient).patch<
|
|
2870
|
+
export const updateFileStatus = <ThrowOnError extends boolean = false>(options: Options<UpdateFileStatusData, ThrowOnError>) => {
|
|
2871
|
+
return (options.client ?? _heyApiClient).patch<UpdateFileStatusResponses, UpdateFileStatusErrors, ThrowOnError>({
|
|
2519
2872
|
security: [
|
|
2520
2873
|
{
|
|
2521
2874
|
name: 'X-API-Key',
|
|
@@ -2537,10 +2890,101 @@ export const updateFileV1GraphsGraphIdTablesFilesFileIdPatch = <ThrowOnError ext
|
|
|
2537
2890
|
|
|
2538
2891
|
/**
|
|
2539
2892
|
* Ingest Tables to Graph
|
|
2540
|
-
* Load all files from S3 into DuckDB staging tables and ingest into Kuzu graph database.
|
|
2893
|
+
* Load all files from S3 into DuckDB staging tables and ingest into Kuzu graph database.
|
|
2894
|
+
*
|
|
2895
|
+
* **Purpose:**
|
|
2896
|
+
* Orchestrates the complete data pipeline from S3 staging files into the Kuzu graph database.
|
|
2897
|
+
* Processes all tables in a single bulk operation with comprehensive error handling and metrics.
|
|
2898
|
+
*
|
|
2899
|
+
* **Use Cases:**
|
|
2900
|
+
* - Initial graph population from uploaded data
|
|
2901
|
+
* - Incremental data updates with new files
|
|
2902
|
+
* - Complete database rebuild from source files
|
|
2903
|
+
* - Recovery from failed ingestion attempts
|
|
2904
|
+
*
|
|
2905
|
+
* **Workflow:**
|
|
2906
|
+
* 1. Upload data files via `POST /tables/{table_name}/files`
|
|
2907
|
+
* 2. Files are validated and marked as 'uploaded'
|
|
2908
|
+
* 3. Trigger ingestion: `POST /tables/ingest`
|
|
2909
|
+
* 4. DuckDB staging tables created from S3 patterns
|
|
2910
|
+
* 5. Data copied row-by-row from DuckDB to Kuzu
|
|
2911
|
+
* 6. Per-table results and metrics returned
|
|
2912
|
+
*
|
|
2913
|
+
* **Rebuild Feature:**
|
|
2914
|
+
* Setting `rebuild=true` regenerates the entire graph database from scratch:
|
|
2915
|
+
* - Deletes existing Kuzu database
|
|
2916
|
+
* - Recreates with fresh schema from active GraphSchema
|
|
2917
|
+
* - Ingests all data files
|
|
2918
|
+
* - Safe operation - S3 is source of truth
|
|
2919
|
+
* - Useful for schema changes or data corrections
|
|
2920
|
+
* - Graph marked as 'rebuilding' during process
|
|
2921
|
+
*
|
|
2922
|
+
* **Error Handling:**
|
|
2923
|
+
* - Per-table error isolation with `ignore_errors` flag
|
|
2924
|
+
* - Partial success support (some tables succeed, some fail)
|
|
2925
|
+
* - Detailed error reporting per table
|
|
2926
|
+
* - Graph status tracking throughout process
|
|
2927
|
+
* - Automatic failure recovery and cleanup
|
|
2928
|
+
*
|
|
2929
|
+
* **Performance:**
|
|
2930
|
+
* - Processes all tables in sequence
|
|
2931
|
+
* - Each table timed independently
|
|
2932
|
+
* - Total execution metrics provided
|
|
2933
|
+
* - Scales to thousands of files
|
|
2934
|
+
* - Optimized for large datasets
|
|
2935
|
+
*
|
|
2936
|
+
* **Example Request:**
|
|
2937
|
+
* ```bash
|
|
2938
|
+
* curl -X POST "https://api.robosystems.ai/v1/graphs/kg123/tables/ingest" \
|
|
2939
|
+
* -H "Authorization: Bearer YOUR_TOKEN" \
|
|
2940
|
+
* -H "Content-Type: application/json" \
|
|
2941
|
+
* -d '{
|
|
2942
|
+
* "ignore_errors": true,
|
|
2943
|
+
* "rebuild": false
|
|
2944
|
+
* }'
|
|
2945
|
+
* ```
|
|
2946
|
+
*
|
|
2947
|
+
* **Example Response:**
|
|
2948
|
+
* ```json
|
|
2949
|
+
* {
|
|
2950
|
+
* "status": "success",
|
|
2951
|
+
* "graph_id": "kg123",
|
|
2952
|
+
* "total_tables": 5,
|
|
2953
|
+
* "successful_tables": 5,
|
|
2954
|
+
* "failed_tables": 0,
|
|
2955
|
+
* "skipped_tables": 0,
|
|
2956
|
+
* "total_rows_ingested": 25000,
|
|
2957
|
+
* "total_execution_time_ms": 15420.5,
|
|
2958
|
+
* "results": [
|
|
2959
|
+
* {
|
|
2960
|
+
* "table_name": "Entity",
|
|
2961
|
+
* "status": "success",
|
|
2962
|
+
* "rows_ingested": 5000,
|
|
2963
|
+
* "execution_time_ms": 3200.1,
|
|
2964
|
+
* "error": null
|
|
2965
|
+
* }
|
|
2966
|
+
* ]
|
|
2967
|
+
* }
|
|
2968
|
+
* ```
|
|
2969
|
+
*
|
|
2970
|
+
* **Concurrency Control:**
|
|
2971
|
+
* Only one ingestion can run per graph at a time. If another ingestion is in progress,
|
|
2972
|
+
* you'll receive a 409 Conflict error. The distributed lock automatically expires after
|
|
2973
|
+
* the configured TTL (default: 1 hour) to prevent deadlocks from failed ingestions.
|
|
2974
|
+
*
|
|
2975
|
+
* **Tips:**
|
|
2976
|
+
* - Only files with 'uploaded' status are processed
|
|
2977
|
+
* - Tables with no uploaded files are skipped
|
|
2978
|
+
* - Use `ignore_errors=false` for strict validation
|
|
2979
|
+
* - Monitor progress via per-table results
|
|
2980
|
+
* - Check graph metadata for rebuild status
|
|
2981
|
+
* - Wait for current ingestion to complete before starting another
|
|
2982
|
+
*
|
|
2983
|
+
* **Note:**
|
|
2984
|
+
* Table ingestion is included - no credit consumption.
|
|
2541
2985
|
*/
|
|
2542
|
-
export const
|
|
2543
|
-
return (options.client ?? _heyApiClient).post<
|
|
2986
|
+
export const ingestTables = <ThrowOnError extends boolean = false>(options: Options<IngestTablesData, ThrowOnError>) => {
|
|
2987
|
+
return (options.client ?? _heyApiClient).post<IngestTablesResponses, IngestTablesErrors, ThrowOnError>({
|
|
2544
2988
|
security: [
|
|
2545
2989
|
{
|
|
2546
2990
|
name: 'X-API-Key',
|
|
@@ -2562,10 +3006,68 @@ export const ingestTablesV1GraphsGraphIdTablesIngestPost = <ThrowOnError extends
|
|
|
2562
3006
|
|
|
2563
3007
|
/**
|
|
2564
3008
|
* Query Staging Tables with SQL
|
|
2565
|
-
* Execute SQL queries on DuckDB staging tables
|
|
3009
|
+
* Execute SQL queries on DuckDB staging tables for data inspection and validation.
|
|
3010
|
+
*
|
|
3011
|
+
* **Purpose:**
|
|
3012
|
+
* Query raw staging data directly with SQL before ingestion into the graph database.
|
|
3013
|
+
* Useful for data quality checks, validation, and exploratory analysis.
|
|
3014
|
+
*
|
|
3015
|
+
* **Use Cases:**
|
|
3016
|
+
* - Validate data quality before graph ingestion
|
|
3017
|
+
* - Inspect row-level data for debugging
|
|
3018
|
+
* - Run analytics on staging tables
|
|
3019
|
+
* - Check for duplicates, nulls, or data issues
|
|
3020
|
+
* - Preview data transformations
|
|
3021
|
+
*
|
|
3022
|
+
* **Workflow:**
|
|
3023
|
+
* 1. Upload data files via `POST /tables/{table_name}/files`
|
|
3024
|
+
* 2. Query staging tables to validate: `POST /tables/query`
|
|
3025
|
+
* 3. Fix any data issues by re-uploading
|
|
3026
|
+
* 4. Ingest validated data: `POST /tables/ingest`
|
|
3027
|
+
*
|
|
3028
|
+
* **Supported SQL:**
|
|
3029
|
+
* - Full DuckDB SQL syntax
|
|
3030
|
+
* - SELECT, JOIN, WHERE, GROUP BY, ORDER BY
|
|
3031
|
+
* - Aggregations, window functions, CTEs
|
|
3032
|
+
* - Multiple table joins across staging area
|
|
3033
|
+
*
|
|
3034
|
+
* **Example Queries:**
|
|
3035
|
+
* ```sql
|
|
3036
|
+
* -- Count rows in staging table
|
|
3037
|
+
* SELECT COUNT(*) FROM Entity;
|
|
3038
|
+
*
|
|
3039
|
+
* -- Check for nulls
|
|
3040
|
+
* SELECT * FROM Entity WHERE name IS NULL LIMIT 10;
|
|
3041
|
+
*
|
|
3042
|
+
* -- Find duplicates
|
|
3043
|
+
* SELECT identifier, COUNT(*) as cnt
|
|
3044
|
+
* FROM Entity
|
|
3045
|
+
* GROUP BY identifier
|
|
3046
|
+
* HAVING COUNT(*) > 1;
|
|
3047
|
+
*
|
|
3048
|
+
* -- Join across tables
|
|
3049
|
+
* SELECT e.name, COUNT(t.id) as transaction_count
|
|
3050
|
+
* FROM Entity e
|
|
3051
|
+
* LEFT JOIN Transaction t ON e.identifier = t.entity_id
|
|
3052
|
+
* GROUP BY e.name
|
|
3053
|
+
* ORDER BY transaction_count DESC;
|
|
3054
|
+
* ```
|
|
3055
|
+
*
|
|
3056
|
+
* **Limits:**
|
|
3057
|
+
* - Query timeout: 30 seconds
|
|
3058
|
+
* - Result limit: 10,000 rows (use LIMIT clause)
|
|
3059
|
+
* - Read-only: No INSERT, UPDATE, DELETE
|
|
3060
|
+
* - User's tables only: Cannot query other users' data
|
|
3061
|
+
*
|
|
3062
|
+
* **Shared Repositories:**
|
|
3063
|
+
* Shared repositories (SEC, etc.) do not allow direct SQL queries.
|
|
3064
|
+
* Use the graph query endpoint instead: `POST /v1/graphs/{graph_id}/query`
|
|
3065
|
+
*
|
|
3066
|
+
* **Note:**
|
|
3067
|
+
* Staging table queries are included - no credit consumption.
|
|
2566
3068
|
*/
|
|
2567
|
-
export const
|
|
2568
|
-
return (options.client ?? _heyApiClient).post<
|
|
3069
|
+
export const queryTables = <ThrowOnError extends boolean = false>(options: Options<QueryTablesData, ThrowOnError>) => {
|
|
3070
|
+
return (options.client ?? _heyApiClient).post<QueryTablesResponses, QueryTablesErrors, ThrowOnError>({
|
|
2569
3071
|
security: [
|
|
2570
3072
|
{
|
|
2571
3073
|
name: 'X-API-Key',
|