@robosystems/client 0.2.2 → 0.2.4
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/QueryClient.js +0 -1
- package/extensions/QueryClient.ts +0 -1
- package/extensions/TableIngestClient.js +0 -4
- package/extensions/TableIngestClient.ts +0 -4
- package/package.json +1 -1
- package/sdk/sdk.gen.d.ts +231 -285
- package/sdk/sdk.gen.js +223 -277
- package/sdk/sdk.gen.ts +231 -285
- package/sdk/types.gen.d.ts +141 -1165
- package/sdk/types.gen.ts +149 -1186
- package/sdk-extensions/QueryClient.js +0 -1
- package/sdk-extensions/QueryClient.ts +0 -1
- package/sdk-extensions/TableIngestClient.js +0 -4
- package/sdk-extensions/TableIngestClient.ts +0 -4
- package/sdk.gen.d.ts +231 -285
- package/sdk.gen.js +223 -277
- package/sdk.gen.ts +231 -285
- package/types.gen.d.ts +141 -1165
- package/types.gen.ts +149 -1186
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,
|
|
4
|
+
import type { RegisterUserData, RegisterUserResponses, RegisterUserErrors, LoginUserData, LoginUserResponses, LoginUserErrors, LogoutUserData, LogoutUserResponses, 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, UpdateUserData, UpdateUserResponses, UpdateUserErrors, GetAllCreditSummariesData, GetAllCreditSummariesResponses, GetAllCreditSummariesErrors, UpdateUserPasswordData, UpdateUserPasswordResponses, UpdateUserPasswordErrors, ListUserApiKeysData, ListUserApiKeysResponses, CreateUserApiKeyData, CreateUserApiKeyResponses, CreateUserApiKeyErrors, RevokeUserApiKeyData, RevokeUserApiKeyResponses, RevokeUserApiKeyErrors, UpdateUserApiKeyData, UpdateUserApiKeyResponses, UpdateUserApiKeyErrors, GetUserLimitsData, GetUserLimitsResponses, GetUserLimitsErrors, GetUserUsageData, GetUserUsageResponses, GetAllSharedRepositoryLimitsData, GetAllSharedRepositoryLimitsResponses, GetSharedRepositoryLimitsData, GetSharedRepositoryLimitsResponses, GetSharedRepositoryLimitsErrors, GetUserUsageOverviewData, GetUserUsageOverviewResponses, 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, GetAvailableExtensionsErrors, 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> & {
|
|
@@ -53,7 +53,7 @@ export const loginUser = <ThrowOnError extends boolean = false>(options: Options
|
|
|
53
53
|
* Logout user and invalidate session.
|
|
54
54
|
*/
|
|
55
55
|
export const logoutUser = <ThrowOnError extends boolean = false>(options?: Options<LogoutUserData, ThrowOnError>) => {
|
|
56
|
-
return (options?.client ?? _heyApiClient).post<LogoutUserResponses,
|
|
56
|
+
return (options?.client ?? _heyApiClient).post<LogoutUserResponses, unknown, ThrowOnError>({
|
|
57
57
|
url: '/v1/auth/logout',
|
|
58
58
|
...options
|
|
59
59
|
});
|
|
@@ -242,7 +242,7 @@ export const getServiceStatus = <ThrowOnError extends boolean = false>(options?:
|
|
|
242
242
|
* Returns information about the currently authenticated user.
|
|
243
243
|
*/
|
|
244
244
|
export const getCurrentUser = <ThrowOnError extends boolean = false>(options?: Options<GetCurrentUserData, ThrowOnError>) => {
|
|
245
|
-
return (options?.client ?? _heyApiClient).get<GetCurrentUserResponses,
|
|
245
|
+
return (options?.client ?? _heyApiClient).get<GetCurrentUserResponses, unknown, ThrowOnError>({
|
|
246
246
|
security: [
|
|
247
247
|
{
|
|
248
248
|
name: 'X-API-Key',
|
|
@@ -340,7 +340,7 @@ export const updateUserPassword = <ThrowOnError extends boolean = false>(options
|
|
|
340
340
|
* Get all API keys for the current user.
|
|
341
341
|
*/
|
|
342
342
|
export const listUserApiKeys = <ThrowOnError extends boolean = false>(options?: Options<ListUserApiKeysData, ThrowOnError>) => {
|
|
343
|
-
return (options?.client ?? _heyApiClient).get<ListUserApiKeysResponses,
|
|
343
|
+
return (options?.client ?? _heyApiClient).get<ListUserApiKeysResponses, unknown, ThrowOnError>({
|
|
344
344
|
security: [
|
|
345
345
|
{
|
|
346
346
|
name: 'X-API-Key',
|
|
@@ -453,7 +453,7 @@ export const getUserLimits = <ThrowOnError extends boolean = false>(options?: Op
|
|
|
453
453
|
* Retrieve current usage statistics and remaining limits for the authenticated user
|
|
454
454
|
*/
|
|
455
455
|
export const getUserUsage = <ThrowOnError extends boolean = false>(options?: Options<GetUserUsageData, ThrowOnError>) => {
|
|
456
|
-
return (options?.client ?? _heyApiClient).get<GetUserUsageResponses,
|
|
456
|
+
return (options?.client ?? _heyApiClient).get<GetUserUsageResponses, unknown, ThrowOnError>({
|
|
457
457
|
security: [
|
|
458
458
|
{
|
|
459
459
|
name: 'X-API-Key',
|
|
@@ -474,7 +474,7 @@ export const getUserUsage = <ThrowOnError extends boolean = false>(options?: Opt
|
|
|
474
474
|
* Get rate limit status for all shared repositories the user has access to.
|
|
475
475
|
*/
|
|
476
476
|
export const getAllSharedRepositoryLimits = <ThrowOnError extends boolean = false>(options?: Options<GetAllSharedRepositoryLimitsData, ThrowOnError>) => {
|
|
477
|
-
return (options?.client ?? _heyApiClient).get<GetAllSharedRepositoryLimitsResponses,
|
|
477
|
+
return (options?.client ?? _heyApiClient).get<GetAllSharedRepositoryLimitsResponses, unknown, ThrowOnError>({
|
|
478
478
|
security: [
|
|
479
479
|
{
|
|
480
480
|
name: 'X-API-Key',
|
|
@@ -524,7 +524,7 @@ export const getSharedRepositoryLimits = <ThrowOnError extends boolean = false>(
|
|
|
524
524
|
* Get a high-level overview of usage statistics for the current user.
|
|
525
525
|
*/
|
|
526
526
|
export const getUserUsageOverview = <ThrowOnError extends boolean = false>(options?: Options<GetUserUsageOverviewData, ThrowOnError>) => {
|
|
527
|
-
return (options?.client ?? _heyApiClient).get<GetUserUsageOverviewResponses,
|
|
527
|
+
return (options?.client ?? _heyApiClient).get<GetUserUsageOverviewResponses, unknown, ThrowOnError>({
|
|
528
528
|
security: [
|
|
529
529
|
{
|
|
530
530
|
name: 'X-API-Key',
|
|
@@ -1291,9 +1291,8 @@ export const recommendAgent = <ThrowOnError extends boolean = false>(options: Op
|
|
|
1291
1291
|
* - User permissions and subscription tier
|
|
1292
1292
|
* - Backend capabilities (Kuzu, Neo4j, etc.)
|
|
1293
1293
|
*
|
|
1294
|
-
*
|
|
1295
|
-
*
|
|
1296
|
-
* - Tool execution costs vary by operation complexity
|
|
1294
|
+
* **Note:**
|
|
1295
|
+
* MCP tool listing is included - no credit consumption required.
|
|
1297
1296
|
*/
|
|
1298
1297
|
export const listMcpTools = <ThrowOnError extends boolean = false>(options: Options<ListMcpToolsData, ThrowOnError>) => {
|
|
1299
1298
|
return (options.client ?? _heyApiClient).get<ListMcpToolsResponses, ListMcpToolsErrors, ThrowOnError>({
|
|
@@ -1346,8 +1345,11 @@ export const listMcpTools = <ThrowOnError extends boolean = false>(options: Opti
|
|
|
1346
1345
|
* - `408 Request Timeout`: Tool execution exceeded timeout
|
|
1347
1346
|
* - Clients should implement exponential backoff on errors
|
|
1348
1347
|
*
|
|
1349
|
-
* **
|
|
1350
|
-
* MCP tool
|
|
1348
|
+
* **Credit Model:**
|
|
1349
|
+
* MCP tool execution is included - no credit consumption required. Database
|
|
1350
|
+
* operations (queries, schema inspection, analytics) are completely free.
|
|
1351
|
+
* Only AI operations that invoke Claude or other LLM APIs consume credits,
|
|
1352
|
+
* which happens at the AI agent layer, not the MCP tool layer.
|
|
1351
1353
|
*/
|
|
1352
1354
|
export const callMcpTool = <ThrowOnError extends boolean = false>(options: Options<CallMcpToolData, ThrowOnError>) => {
|
|
1353
1355
|
return (options.client ?? _heyApiClient).post<CallMcpToolResponses, CallMcpToolErrors, ThrowOnError>({
|
|
@@ -1654,6 +1656,13 @@ export const getGraphUsageStats = <ThrowOnError extends boolean = false>(options
|
|
|
1654
1656
|
* 1. Create file upload: `POST /v1/graphs/{graph_id}/tables/{table_name}/files`
|
|
1655
1657
|
* 2. Ingest to graph: `POST /v1/graphs/{graph_id}/tables/ingest`
|
|
1656
1658
|
*
|
|
1659
|
+
* **Security Best Practice - Use Parameterized Queries:**
|
|
1660
|
+
* ALWAYS use query parameters instead of string interpolation to prevent injection attacks:
|
|
1661
|
+
* - ✅ SAFE: `MATCH (n:Entity {type: $entity_type}) RETURN n` with `parameters: {"entity_type": "Company"}`
|
|
1662
|
+
* - ❌ UNSAFE: `MATCH (n:Entity {type: "Company"}) RETURN n` with user input concatenated into query string
|
|
1663
|
+
*
|
|
1664
|
+
* Query parameters provide automatic escaping and type safety. All examples in this API use parameterized queries.
|
|
1665
|
+
*
|
|
1657
1666
|
* This endpoint automatically selects the best execution strategy based on:
|
|
1658
1667
|
* - Query characteristics (size, complexity)
|
|
1659
1668
|
* - Client capabilities (SSE, NDJSON, JSON)
|
|
@@ -1725,13 +1734,38 @@ export const executeCypherQuery = <ThrowOnError extends boolean = false>(options
|
|
|
1725
1734
|
* Get Runtime Graph Schema
|
|
1726
1735
|
* Get runtime schema information for the specified graph database.
|
|
1727
1736
|
*
|
|
1728
|
-
*
|
|
1737
|
+
* ## What This Returns
|
|
1738
|
+
*
|
|
1739
|
+
* This endpoint inspects the **actual current state** of the graph database and returns:
|
|
1729
1740
|
* - **Node Labels**: All node types currently in the database
|
|
1730
1741
|
* - **Relationship Types**: All relationship types currently in the database
|
|
1731
|
-
* - **Node Properties**: Properties
|
|
1742
|
+
* - **Node Properties**: Properties discovered from actual data (up to 10 properties per node type)
|
|
1743
|
+
*
|
|
1744
|
+
* ## Runtime vs Declared Schema
|
|
1732
1745
|
*
|
|
1733
|
-
*
|
|
1734
|
-
*
|
|
1746
|
+
* **Use this endpoint** (`/schema`) when you need to know:
|
|
1747
|
+
* - What data is ACTUALLY in the database right now
|
|
1748
|
+
* - What properties exist on real nodes
|
|
1749
|
+
* - What relationships have been created
|
|
1750
|
+
* - Current database structure for querying
|
|
1751
|
+
*
|
|
1752
|
+
* **Use `/schema/export` instead** when you need:
|
|
1753
|
+
* - The original schema definition used to create the graph
|
|
1754
|
+
* - Schema in a specific format (JSON, YAML, Cypher DDL)
|
|
1755
|
+
* - Schema for documentation or version control
|
|
1756
|
+
* - Schema to replicate in another graph
|
|
1757
|
+
*
|
|
1758
|
+
* ## Example Use Cases
|
|
1759
|
+
*
|
|
1760
|
+
* - **Building queries**: See what node labels and properties exist to write accurate Cypher
|
|
1761
|
+
* - **Data exploration**: Discover what's in an unfamiliar graph
|
|
1762
|
+
* - **Schema drift detection**: Compare runtime vs declared schema
|
|
1763
|
+
* - **API integration**: Dynamically adapt to current graph structure
|
|
1764
|
+
*
|
|
1765
|
+
* ## Performance Note
|
|
1766
|
+
*
|
|
1767
|
+
* Property discovery is limited to 10 properties per node type for performance.
|
|
1768
|
+
* For complete schema definitions, use `/schema/export`.
|
|
1735
1769
|
*
|
|
1736
1770
|
* This operation is included - no credit consumption required.
|
|
1737
1771
|
*/
|
|
@@ -1753,8 +1787,54 @@ export const getGraphSchema = <ThrowOnError extends boolean = false>(options: Op
|
|
|
1753
1787
|
};
|
|
1754
1788
|
|
|
1755
1789
|
/**
|
|
1756
|
-
* Export Graph Schema
|
|
1757
|
-
* Export the schema of an existing graph
|
|
1790
|
+
* Export Declared Graph Schema
|
|
1791
|
+
* Export the declared schema definition of an existing graph.
|
|
1792
|
+
*
|
|
1793
|
+
* ## What This Returns
|
|
1794
|
+
*
|
|
1795
|
+
* This endpoint returns the **original schema definition** that was used to create the graph:
|
|
1796
|
+
* - The schema as it was **declared** during graph creation
|
|
1797
|
+
* - Complete node and relationship definitions
|
|
1798
|
+
* - Property types and constraints
|
|
1799
|
+
* - Schema metadata (name, version, type)
|
|
1800
|
+
*
|
|
1801
|
+
* ## Runtime vs Declared Schema
|
|
1802
|
+
*
|
|
1803
|
+
* **Use this endpoint** (`/schema/export`) when you need:
|
|
1804
|
+
* - The original schema definition used to create the graph
|
|
1805
|
+
* - Schema in a specific format (JSON, YAML, Cypher DDL)
|
|
1806
|
+
* - Schema for documentation or version control
|
|
1807
|
+
* - Schema to replicate in another graph
|
|
1808
|
+
*
|
|
1809
|
+
* **Use `/schema` instead** when you need:
|
|
1810
|
+
* - What data is ACTUALLY in the database right now
|
|
1811
|
+
* - What properties exist on real nodes (discovered from data)
|
|
1812
|
+
* - Current runtime database structure for querying
|
|
1813
|
+
*
|
|
1814
|
+
* ## Export Formats
|
|
1815
|
+
*
|
|
1816
|
+
* ### JSON Format (`format=json`)
|
|
1817
|
+
* Returns structured JSON with nodes, relationships, and properties.
|
|
1818
|
+
* Best for programmatic access and API integration.
|
|
1819
|
+
*
|
|
1820
|
+
* ### YAML Format (`format=yaml`)
|
|
1821
|
+
* Returns human-readable YAML with comments.
|
|
1822
|
+
* Best for documentation and configuration management.
|
|
1823
|
+
*
|
|
1824
|
+
* ### Cypher DDL Format (`format=cypher`)
|
|
1825
|
+
* Returns Cypher CREATE statements for recreating the schema.
|
|
1826
|
+
* Best for database migration and replication.
|
|
1827
|
+
*
|
|
1828
|
+
* ## Data Statistics
|
|
1829
|
+
*
|
|
1830
|
+
* Set `include_data_stats=true` to include:
|
|
1831
|
+
* - Node counts by label
|
|
1832
|
+
* - Relationship counts by type
|
|
1833
|
+
* - Total nodes and relationships
|
|
1834
|
+
*
|
|
1835
|
+
* This combines declared schema with runtime statistics.
|
|
1836
|
+
*
|
|
1837
|
+
* This operation is included - no credit consumption required.
|
|
1758
1838
|
*/
|
|
1759
1839
|
export const exportGraphSchema = <ThrowOnError extends boolean = false>(options: Options<ExportGraphSchemaData, ThrowOnError>) => {
|
|
1760
1840
|
return (options.client ?? _heyApiClient).get<ExportGraphSchemaResponses, ExportGraphSchemaErrors, ThrowOnError>({
|
|
@@ -2405,12 +2485,11 @@ export const getSubgraphQuota = <ThrowOnError extends boolean = false>(options:
|
|
|
2405
2485
|
* List Staging Tables
|
|
2406
2486
|
* List all DuckDB staging tables with comprehensive metrics and status.
|
|
2407
2487
|
*
|
|
2408
|
-
* **Purpose:**
|
|
2409
2488
|
* Get a complete inventory of all staging tables for a graph, including
|
|
2410
2489
|
* file counts, storage sizes, and row estimates. Essential for monitoring
|
|
2411
2490
|
* the data pipeline and determining which tables are ready for ingestion.
|
|
2412
2491
|
*
|
|
2413
|
-
* **
|
|
2492
|
+
* **Returned Metrics:**
|
|
2414
2493
|
* - Table name and type (node/relationship)
|
|
2415
2494
|
* - File count per table
|
|
2416
2495
|
* - Total storage size in bytes
|
|
@@ -2432,43 +2511,12 @@ export const getSubgraphQuota = <ThrowOnError extends boolean = false>(options:
|
|
|
2432
2511
|
* 4. Check file counts and sizes
|
|
2433
2512
|
* 5. Ingest when ready
|
|
2434
2513
|
*
|
|
2435
|
-
* **
|
|
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:**
|
|
2514
|
+
* **Important Notes:**
|
|
2465
2515
|
* - Tables with `file_count > 0` have data ready
|
|
2466
2516
|
* - Check `total_size_bytes` for storage monitoring
|
|
2467
2517
|
* - Use `s3_location` to verify upload paths
|
|
2468
2518
|
* - Empty tables (file_count=0) are skipped during ingestion
|
|
2469
|
-
*
|
|
2470
|
-
* **Note:**
|
|
2471
|
-
* Table queries are included - no credit consumption.
|
|
2519
|
+
* - Table queries are included - no credit consumption
|
|
2472
2520
|
*/
|
|
2473
2521
|
export const listTables = <ThrowOnError extends boolean = false>(options: Options<ListTablesData, ThrowOnError>) => {
|
|
2474
2522
|
return (options.client ?? _heyApiClient).get<ListTablesResponses, ListTablesErrors, ThrowOnError>({
|
|
@@ -2491,7 +2539,6 @@ export const listTables = <ThrowOnError extends boolean = false>(options: Option
|
|
|
2491
2539
|
* List Files in Staging Table
|
|
2492
2540
|
* List all files uploaded to a staging table with comprehensive metadata.
|
|
2493
2541
|
*
|
|
2494
|
-
* **Purpose:**
|
|
2495
2542
|
* Get a complete inventory of all files in a staging table, including upload status,
|
|
2496
2543
|
* file sizes, row counts, and S3 locations. Essential for monitoring upload progress
|
|
2497
2544
|
* and validating data before ingestion.
|
|
@@ -2504,59 +2551,26 @@ export const listTables = <ThrowOnError extends boolean = false>(options: Option
|
|
|
2504
2551
|
* - Identify failed or incomplete uploads
|
|
2505
2552
|
* - Pre-ingestion validation
|
|
2506
2553
|
*
|
|
2507
|
-
* **
|
|
2508
|
-
* - File ID and
|
|
2509
|
-
* -
|
|
2510
|
-
* - Size in bytes
|
|
2511
|
-
* - Row count (if available)
|
|
2554
|
+
* **Returned Metadata:**
|
|
2555
|
+
* - File ID, name, and format (parquet, csv, json)
|
|
2556
|
+
* - Size in bytes and row count (if available)
|
|
2512
2557
|
* - Upload status and method
|
|
2513
2558
|
* - Creation and upload timestamps
|
|
2514
2559
|
* - S3 key for reference
|
|
2515
2560
|
*
|
|
2516
2561
|
* **Upload Status Values:**
|
|
2517
|
-
* - `
|
|
2518
|
-
* - `uploading`: Upload in progress
|
|
2562
|
+
* - `pending`: Upload URL generated, awaiting upload
|
|
2519
2563
|
* - `uploaded`: Successfully uploaded, ready for ingestion
|
|
2564
|
+
* - `disabled`: Excluded from ingestion
|
|
2565
|
+
* - `archived`: Soft deleted
|
|
2520
2566
|
* - `failed`: Upload failed
|
|
2521
2567
|
*
|
|
2522
|
-
* **
|
|
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:**
|
|
2568
|
+
* **Important Notes:**
|
|
2553
2569
|
* - Only `uploaded` files are ingested
|
|
2554
2570
|
* - Check `row_count` to estimate data volume
|
|
2555
2571
|
* - Use `total_size_bytes` for storage monitoring
|
|
2556
2572
|
* - Files with `failed` status should be deleted and re-uploaded
|
|
2557
|
-
*
|
|
2558
|
-
* **Note:**
|
|
2559
|
-
* File listing is included - no credit consumption.
|
|
2573
|
+
* - File listing is included - no credit consumption
|
|
2560
2574
|
*/
|
|
2561
2575
|
export const listTableFiles = <ThrowOnError extends boolean = false>(options: Options<ListTableFilesData, ThrowOnError>) => {
|
|
2562
2576
|
return (options.client ?? _heyApiClient).get<ListTableFilesResponses, ListTableFilesErrors, ThrowOnError>({
|
|
@@ -2579,14 +2593,13 @@ export const listTableFiles = <ThrowOnError extends boolean = false>(options: Op
|
|
|
2579
2593
|
* Get File Upload URL
|
|
2580
2594
|
* Generate a presigned S3 URL for secure file upload.
|
|
2581
2595
|
*
|
|
2582
|
-
*
|
|
2583
|
-
* Initiate file upload to a staging table by generating a secure, time-limited
|
|
2596
|
+
* Initiates file upload to a staging table by generating a secure, time-limited
|
|
2584
2597
|
* presigned S3 URL. Files are uploaded directly to S3, bypassing the API for
|
|
2585
2598
|
* optimal performance.
|
|
2586
2599
|
*
|
|
2587
2600
|
* **Upload Workflow:**
|
|
2588
2601
|
* 1. Call this endpoint to get presigned URL
|
|
2589
|
-
* 2. PUT file directly to S3 URL
|
|
2602
|
+
* 2. PUT file directly to S3 URL
|
|
2590
2603
|
* 3. Call PATCH /tables/files/{file_id} with status='uploaded'
|
|
2591
2604
|
* 4. Backend validates file and calculates metrics
|
|
2592
2605
|
* 5. File ready for ingestion
|
|
@@ -2603,52 +2616,14 @@ export const listTableFiles = <ThrowOnError extends boolean = false>(options: Op
|
|
|
2603
2616
|
* - Auto-creates table if it doesn't exist
|
|
2604
2617
|
*
|
|
2605
2618
|
* **Auto-Table Creation:**
|
|
2606
|
-
*
|
|
2607
|
-
*
|
|
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
|
-
* ```
|
|
2619
|
+
* Tables are automatically created on first file upload with type inferred from name
|
|
2620
|
+
* (e.g., "Transaction" → relationship) and empty schema populated during ingestion.
|
|
2643
2621
|
*
|
|
2644
|
-
* **
|
|
2622
|
+
* **Important Notes:**
|
|
2645
2623
|
* - Presigned URLs expire (default: 1 hour)
|
|
2646
2624
|
* - Use appropriate Content-Type header when uploading to S3
|
|
2647
2625
|
* - File extension must match content type
|
|
2648
|
-
* -
|
|
2649
|
-
*
|
|
2650
|
-
* **Note:**
|
|
2651
|
-
* Upload URL generation is included - no credit consumption.
|
|
2626
|
+
* - Upload URL generation is included - no credit consumption
|
|
2652
2627
|
*/
|
|
2653
2628
|
export const getUploadUrl = <ThrowOnError extends boolean = false>(options: Options<GetUploadUrlData, ThrowOnError>) => {
|
|
2654
2629
|
return (options.client ?? _heyApiClient).post<GetUploadUrlResponses, GetUploadUrlErrors, ThrowOnError>({
|
|
@@ -2675,7 +2650,6 @@ export const getUploadUrl = <ThrowOnError extends boolean = false>(options: Opti
|
|
|
2675
2650
|
* Delete File from Staging
|
|
2676
2651
|
* Delete a file from S3 storage and database tracking.
|
|
2677
2652
|
*
|
|
2678
|
-
* **Purpose:**
|
|
2679
2653
|
* Remove unwanted, duplicate, or incorrect files from staging tables before ingestion.
|
|
2680
2654
|
* The file is deleted from both S3 and database tracking, and table statistics
|
|
2681
2655
|
* are automatically recalculated.
|
|
@@ -2699,30 +2673,12 @@ export const getUploadUrl = <ThrowOnError extends boolean = false>(options: Opti
|
|
|
2699
2673
|
* - Full audit trail of deletion operations
|
|
2700
2674
|
* - Cannot delete after ingestion to graph
|
|
2701
2675
|
*
|
|
2702
|
-
* **
|
|
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:**
|
|
2676
|
+
* **Important Notes:**
|
|
2719
2677
|
* - Delete files before ingestion for best results
|
|
2720
2678
|
* - Table statistics update automatically
|
|
2721
2679
|
* - No need to refresh DuckDB - exclusion is automatic
|
|
2722
2680
|
* - Consider re-uploading corrected version after deletion
|
|
2723
|
-
*
|
|
2724
|
-
* **Note:**
|
|
2725
|
-
* File deletion is included - no credit consumption.
|
|
2681
|
+
* - File deletion is included - no credit consumption
|
|
2726
2682
|
*/
|
|
2727
2683
|
export const deleteFile = <ThrowOnError extends boolean = false>(options: Options<DeleteFileData, ThrowOnError>) => {
|
|
2728
2684
|
return (options.client ?? _heyApiClient).delete<DeleteFileResponses, DeleteFileErrors, ThrowOnError>({
|
|
@@ -2745,7 +2701,6 @@ export const deleteFile = <ThrowOnError extends boolean = false>(options: Option
|
|
|
2745
2701
|
* Get File Information
|
|
2746
2702
|
* Get detailed information about a specific file.
|
|
2747
2703
|
*
|
|
2748
|
-
* **Purpose:**
|
|
2749
2704
|
* Retrieve comprehensive metadata for a single file, including upload status,
|
|
2750
2705
|
* size, row count, and timestamps. Useful for validating individual files
|
|
2751
2706
|
* before ingestion.
|
|
@@ -2757,33 +2712,8 @@ export const deleteFile = <ThrowOnError extends boolean = false>(options: Option
|
|
|
2757
2712
|
* - Verify file format and size
|
|
2758
2713
|
* - Track file lifecycle
|
|
2759
2714
|
*
|
|
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
2715
|
* **Note:**
|
|
2786
|
-
* File info retrieval is included - no credit consumption
|
|
2716
|
+
* File info retrieval is included - no credit consumption
|
|
2787
2717
|
*/
|
|
2788
2718
|
export const getFileInfo = <ThrowOnError extends boolean = false>(options: Options<GetFileInfoData, ThrowOnError>) => {
|
|
2789
2719
|
return (options.client ?? _heyApiClient).get<GetFileInfoResponses, GetFileInfoErrors, ThrowOnError>({
|
|
@@ -2806,8 +2736,7 @@ export const getFileInfo = <ThrowOnError extends boolean = false>(options: Optio
|
|
|
2806
2736
|
* Update File Upload Status
|
|
2807
2737
|
* Update file status after upload completes.
|
|
2808
2738
|
*
|
|
2809
|
-
*
|
|
2810
|
-
* Mark files as uploaded after successful S3 upload. The backend validates
|
|
2739
|
+
* Marks files as uploaded after successful S3 upload. The backend validates
|
|
2811
2740
|
* the file, calculates size and row count, enforces storage limits, and
|
|
2812
2741
|
* registers the DuckDB table for queries.
|
|
2813
2742
|
*
|
|
@@ -2832,40 +2761,15 @@ export const getFileInfo = <ThrowOnError extends boolean = false>(options: Optio
|
|
|
2832
2761
|
* - **Fallback**: Estimate from file size if reading fails
|
|
2833
2762
|
*
|
|
2834
2763
|
* **Storage Limits:**
|
|
2835
|
-
* Enforced per subscription tier
|
|
2836
|
-
*
|
|
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
|
-
* ```
|
|
2764
|
+
* Enforced per subscription tier. Returns HTTP 413 if limit exceeded.
|
|
2765
|
+
* Check current usage before large uploads.
|
|
2860
2766
|
*
|
|
2861
|
-
* **
|
|
2767
|
+
* **Important Notes:**
|
|
2862
2768
|
* - Always call this after S3 upload completes
|
|
2863
2769
|
* - Check response for actual row count
|
|
2864
2770
|
* - Storage limit errors (413) mean tier upgrade needed
|
|
2865
2771
|
* - DuckDB registration failures are non-fatal (retried later)
|
|
2866
|
-
*
|
|
2867
|
-
* **Note:**
|
|
2868
|
-
* Status updates are included - no credit consumption.
|
|
2772
|
+
* - Status updates are included - no credit consumption
|
|
2869
2773
|
*/
|
|
2870
2774
|
export const updateFileStatus = <ThrowOnError extends boolean = false>(options: Options<UpdateFileStatusData, ThrowOnError>) => {
|
|
2871
2775
|
return (options.client ?? _heyApiClient).patch<UpdateFileStatusResponses, UpdateFileStatusErrors, ThrowOnError>({
|
|
@@ -2892,7 +2796,6 @@ export const updateFileStatus = <ThrowOnError extends boolean = false>(options:
|
|
|
2892
2796
|
* Ingest Tables to Graph
|
|
2893
2797
|
* Load all files from S3 into DuckDB staging tables and ingest into Kuzu graph database.
|
|
2894
2798
|
*
|
|
2895
|
-
* **Purpose:**
|
|
2896
2799
|
* Orchestrates the complete data pipeline from S3 staging files into the Kuzu graph database.
|
|
2897
2800
|
* Processes all tables in a single bulk operation with comprehensive error handling and metrics.
|
|
2898
2801
|
*
|
|
@@ -2933,55 +2836,19 @@ export const updateFileStatus = <ThrowOnError extends boolean = false>(options:
|
|
|
2933
2836
|
* - Scales to thousands of files
|
|
2934
2837
|
* - Optimized for large datasets
|
|
2935
2838
|
*
|
|
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
2839
|
* **Concurrency Control:**
|
|
2971
2840
|
* Only one ingestion can run per graph at a time. If another ingestion is in progress,
|
|
2972
2841
|
* you'll receive a 409 Conflict error. The distributed lock automatically expires after
|
|
2973
2842
|
* the configured TTL (default: 1 hour) to prevent deadlocks from failed ingestions.
|
|
2974
2843
|
*
|
|
2975
|
-
* **
|
|
2844
|
+
* **Important Notes:**
|
|
2976
2845
|
* - Only files with 'uploaded' status are processed
|
|
2977
2846
|
* - Tables with no uploaded files are skipped
|
|
2978
2847
|
* - Use `ignore_errors=false` for strict validation
|
|
2979
2848
|
* - Monitor progress via per-table results
|
|
2980
2849
|
* - Check graph metadata for rebuild status
|
|
2981
2850
|
* - Wait for current ingestion to complete before starting another
|
|
2982
|
-
*
|
|
2983
|
-
* **Note:**
|
|
2984
|
-
* Table ingestion is included - no credit consumption.
|
|
2851
|
+
* - Table ingestion is included - no credit consumption
|
|
2985
2852
|
*/
|
|
2986
2853
|
export const ingestTables = <ThrowOnError extends boolean = false>(options: Options<IngestTablesData, ThrowOnError>) => {
|
|
2987
2854
|
return (options.client ?? _heyApiClient).post<IngestTablesResponses, IngestTablesErrors, ThrowOnError>({
|
|
@@ -3008,10 +2875,16 @@ export const ingestTables = <ThrowOnError extends boolean = false>(options: Opti
|
|
|
3008
2875
|
* Query Staging Tables with SQL
|
|
3009
2876
|
* Execute SQL queries on DuckDB staging tables for data inspection and validation.
|
|
3010
2877
|
*
|
|
3011
|
-
* **Purpose:**
|
|
3012
2878
|
* Query raw staging data directly with SQL before ingestion into the graph database.
|
|
3013
2879
|
* Useful for data quality checks, validation, and exploratory analysis.
|
|
3014
2880
|
*
|
|
2881
|
+
* **Security Best Practice - Use Parameterized Queries:**
|
|
2882
|
+
* ALWAYS use query parameters instead of string concatenation to prevent SQL injection:
|
|
2883
|
+
* - ✅ SAFE: `SELECT * FROM Entity WHERE type = ? LIMIT ?` with `parameters: ["Company", 100]`
|
|
2884
|
+
* - ❌ UNSAFE: `SELECT * FROM Entity WHERE type = 'Company' LIMIT 100` with user input concatenated into SQL string
|
|
2885
|
+
*
|
|
2886
|
+
* Query parameters provide automatic escaping and type safety. Use `?` placeholders with parameters array.
|
|
2887
|
+
*
|
|
3015
2888
|
* **Use Cases:**
|
|
3016
2889
|
* - Validate data quality before graph ingestion
|
|
3017
2890
|
* - Inspect row-level data for debugging
|
|
@@ -3031,27 +2904,12 @@ export const ingestTables = <ThrowOnError extends boolean = false>(options: Opti
|
|
|
3031
2904
|
* - Aggregations, window functions, CTEs
|
|
3032
2905
|
* - Multiple table joins across staging area
|
|
3033
2906
|
*
|
|
3034
|
-
* **
|
|
3035
|
-
*
|
|
3036
|
-
*
|
|
3037
|
-
* SELECT
|
|
3038
|
-
*
|
|
3039
|
-
*
|
|
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
|
-
* ```
|
|
2907
|
+
* **Common Operations:**
|
|
2908
|
+
* - Count rows: `SELECT COUNT(*) FROM Entity`
|
|
2909
|
+
* - Filter by type: `SELECT * FROM Entity WHERE entity_type = ? LIMIT ?` with `parameters: ["Company", 100]`
|
|
2910
|
+
* - Check for nulls: `SELECT * FROM Entity WHERE name IS NULL LIMIT 10`
|
|
2911
|
+
* - Find duplicates: `SELECT identifier, COUNT(*) as cnt FROM Entity GROUP BY identifier HAVING COUNT(*) > 1`
|
|
2912
|
+
* - Filter amounts: `SELECT * FROM Transaction WHERE amount > ? AND date >= ?` with `parameters: [1000, "2024-01-01"]`
|
|
3055
2913
|
*
|
|
3056
2914
|
* **Limits:**
|
|
3057
2915
|
* - Query timeout: 30 seconds
|
|
@@ -3064,7 +2922,7 @@ export const ingestTables = <ThrowOnError extends boolean = false>(options: Opti
|
|
|
3064
2922
|
* Use the graph query endpoint instead: `POST /v1/graphs/{graph_id}/query`
|
|
3065
2923
|
*
|
|
3066
2924
|
* **Note:**
|
|
3067
|
-
* Staging table queries are included - no credit consumption
|
|
2925
|
+
* Staging table queries are included - no credit consumption
|
|
3068
2926
|
*/
|
|
3069
2927
|
export const queryTables = <ThrowOnError extends boolean = false>(options: Options<QueryTablesData, ThrowOnError>) => {
|
|
3070
2928
|
return (options.client ?? _heyApiClient).post<QueryTablesResponses, QueryTablesErrors, ThrowOnError>({
|
|
@@ -3089,7 +2947,40 @@ export const queryTables = <ThrowOnError extends boolean = false>(options: Optio
|
|
|
3089
2947
|
|
|
3090
2948
|
/**
|
|
3091
2949
|
* Get User Graphs
|
|
3092
|
-
*
|
|
2950
|
+
* List all graph databases accessible to the current user with roles and selection status.
|
|
2951
|
+
*
|
|
2952
|
+
* Returns a comprehensive list of all graphs the user can access, including their
|
|
2953
|
+
* role in each graph (admin or member) and which graph is currently selected as
|
|
2954
|
+
* the active workspace.
|
|
2955
|
+
*
|
|
2956
|
+
* **Returned Information:**
|
|
2957
|
+
* - Graph ID and display name for each accessible graph
|
|
2958
|
+
* - User's role (admin/member) indicating permission level
|
|
2959
|
+
* - Selection status (one graph can be marked as "selected")
|
|
2960
|
+
* - Creation timestamp for each graph
|
|
2961
|
+
*
|
|
2962
|
+
* **Graph Roles:**
|
|
2963
|
+
* - `admin`: Full access - can manage graph settings, invite users, delete graph
|
|
2964
|
+
* - `member`: Read/write access - can query and modify data, cannot manage settings
|
|
2965
|
+
*
|
|
2966
|
+
* **Selected Graph Concept:**
|
|
2967
|
+
* The "selected" graph is the user's currently active workspace. Many API operations
|
|
2968
|
+
* default to the selected graph if no graph_id is provided. Users can change their
|
|
2969
|
+
* selected graph via the `POST /v1/graphs/{graph_id}/select` endpoint.
|
|
2970
|
+
*
|
|
2971
|
+
* **Use Cases:**
|
|
2972
|
+
* - Display graph selector in UI
|
|
2973
|
+
* - Show user's accessible workspaces
|
|
2974
|
+
* - Identify which graph is currently active
|
|
2975
|
+
* - Filter graphs by role for permission-based features
|
|
2976
|
+
*
|
|
2977
|
+
* **Empty Response:**
|
|
2978
|
+
* New users or users without graph access will receive an empty list with
|
|
2979
|
+
* `selectedGraphId: null`. Users should create a new graph or request access
|
|
2980
|
+
* to an existing graph.
|
|
2981
|
+
*
|
|
2982
|
+
* **Note:**
|
|
2983
|
+
* Graph listing is included - no credit consumption required.
|
|
3093
2984
|
*/
|
|
3094
2985
|
export const getGraphs = <ThrowOnError extends boolean = false>(options?: Options<GetGraphsData, ThrowOnError>) => {
|
|
3095
2986
|
return (options?.client ?? _heyApiClient).get<GetGraphsResponses, GetGraphsErrors, ThrowOnError>({
|
|
@@ -3174,10 +3065,37 @@ export const createGraph = <ThrowOnError extends boolean = false>(options: Optio
|
|
|
3174
3065
|
|
|
3175
3066
|
/**
|
|
3176
3067
|
* Get Available Schema Extensions
|
|
3177
|
-
* List all available schema extensions for graph creation
|
|
3068
|
+
* List all available schema extensions for graph creation.
|
|
3069
|
+
*
|
|
3070
|
+
* Schema extensions provide pre-built industry-specific data models that extend
|
|
3071
|
+
* the base graph schema with specialized nodes, relationships, and properties.
|
|
3072
|
+
*
|
|
3073
|
+
* **Available Extensions:**
|
|
3074
|
+
* - **RoboLedger**: Complete accounting system with XBRL reporting, general ledger, and financial statements
|
|
3075
|
+
* - **RoboInvestor**: Investment portfolio management and tracking
|
|
3076
|
+
* - **RoboSCM**: Supply chain management and logistics
|
|
3077
|
+
* - **RoboFO**: Front office operations and CRM
|
|
3078
|
+
* - **RoboHRM**: Human resources management
|
|
3079
|
+
* - **RoboEPM**: Enterprise performance management
|
|
3080
|
+
* - **RoboReport**: Business intelligence and reporting
|
|
3081
|
+
*
|
|
3082
|
+
* **Extension Information:**
|
|
3083
|
+
* Each extension includes:
|
|
3084
|
+
* - Display name and description
|
|
3085
|
+
* - Node and relationship counts
|
|
3086
|
+
* - Context-aware capabilities (e.g., SEC repositories get different features than entity graphs)
|
|
3087
|
+
*
|
|
3088
|
+
* **Use Cases:**
|
|
3089
|
+
* - Browse available extensions before creating a graph
|
|
3090
|
+
* - Understand extension capabilities and data models
|
|
3091
|
+
* - Plan graph schema based on business requirements
|
|
3092
|
+
* - Combine multiple extensions for comprehensive data modeling
|
|
3093
|
+
*
|
|
3094
|
+
* **Note:**
|
|
3095
|
+
* Extension listing is included - no credit consumption required.
|
|
3178
3096
|
*/
|
|
3179
3097
|
export const getAvailableExtensions = <ThrowOnError extends boolean = false>(options?: Options<GetAvailableExtensionsData, ThrowOnError>) => {
|
|
3180
|
-
return (options?.client ?? _heyApiClient).get<GetAvailableExtensionsResponses,
|
|
3098
|
+
return (options?.client ?? _heyApiClient).get<GetAvailableExtensionsResponses, GetAvailableExtensionsErrors, ThrowOnError>({
|
|
3181
3099
|
security: [
|
|
3182
3100
|
{
|
|
3183
3101
|
name: 'X-API-Key',
|
|
@@ -3195,7 +3113,35 @@ export const getAvailableExtensions = <ThrowOnError extends boolean = false>(opt
|
|
|
3195
3113
|
|
|
3196
3114
|
/**
|
|
3197
3115
|
* Select Graph
|
|
3198
|
-
* Select a specific graph as the active
|
|
3116
|
+
* Select a specific graph as the active workspace for the user.
|
|
3117
|
+
*
|
|
3118
|
+
* The selected graph becomes the default context for operations in client applications
|
|
3119
|
+
* and can be used to maintain user workspace preferences across sessions.
|
|
3120
|
+
*
|
|
3121
|
+
* **Functionality:**
|
|
3122
|
+
* - Sets the specified graph as the user's currently selected graph
|
|
3123
|
+
* - Deselects any previously selected graph (only one can be selected at a time)
|
|
3124
|
+
* - Persists selection across sessions until changed
|
|
3125
|
+
* - Returns confirmation with the selected graph ID
|
|
3126
|
+
*
|
|
3127
|
+
* **Requirements:**
|
|
3128
|
+
* - User must have access to the graph (as admin or member)
|
|
3129
|
+
* - Graph must exist and not be deleted
|
|
3130
|
+
* - User can only select graphs they have permission to access
|
|
3131
|
+
*
|
|
3132
|
+
* **Use Cases:**
|
|
3133
|
+
* - Switch between multiple graphs in a multi-graph environment
|
|
3134
|
+
* - Set default workspace after creating a new graph
|
|
3135
|
+
* - Restore user's preferred workspace on login
|
|
3136
|
+
* - Support graph context switching in client applications
|
|
3137
|
+
*
|
|
3138
|
+
* **Client Integration:**
|
|
3139
|
+
* Many client operations can default to the selected graph, simplifying API calls
|
|
3140
|
+
* by eliminating the need to specify graph_id repeatedly. Check the selected
|
|
3141
|
+
* graph with `GET /v1/graphs` which returns `selectedGraphId`.
|
|
3142
|
+
*
|
|
3143
|
+
* **Note:**
|
|
3144
|
+
* Graph selection is included - no credit consumption required.
|
|
3199
3145
|
*/
|
|
3200
3146
|
export const selectGraph = <ThrowOnError extends boolean = false>(options: Options<SelectGraphData, ThrowOnError>) => {
|
|
3201
3147
|
return (options.client ?? _heyApiClient).post<SelectGraphResponses, SelectGraphErrors, ThrowOnError>({
|