@robosystems/client 0.2.1 → 0.2.3
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 +14 -1
- package/extensions/GraphClient.js +16 -3
- package/extensions/GraphClient.ts +17 -3
- package/extensions/QueryClient.js +0 -1
- package/extensions/QueryClient.ts +0 -1
- package/extensions/TableIngestClient.d.ts +1 -1
- package/extensions/TableIngestClient.js +20 -24
- package/extensions/TableIngestClient.test.ts +1 -1
- package/extensions/TableIngestClient.ts +23 -32
- package/package.json +1 -1
- package/sdk/sdk.gen.d.ts +493 -45
- package/sdk/sdk.gen.js +493 -45
- package/sdk/sdk.gen.ts +499 -51
- package/sdk/types.gen.d.ts +421 -1248
- package/sdk/types.gen.ts +426 -1262
- package/sdk-extensions/GraphClient.d.ts +14 -1
- package/sdk-extensions/GraphClient.js +16 -3
- package/sdk-extensions/GraphClient.ts +17 -3
- package/sdk-extensions/QueryClient.js +0 -1
- package/sdk-extensions/QueryClient.ts +0 -1
- package/sdk-extensions/TableIngestClient.d.ts +1 -1
- package/sdk-extensions/TableIngestClient.js +20 -24
- package/sdk-extensions/TableIngestClient.test.ts +1 -1
- package/sdk-extensions/TableIngestClient.ts +23 -32
- package/sdk.gen.d.ts +493 -45
- package/sdk.gen.js +493 -45
- package/sdk.gen.ts +499 -51
- package/types.gen.d.ts +421 -1248
- package/types.gen.ts +426 -1262
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
|
|
1745
|
+
*
|
|
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
|
|
1732
1751
|
*
|
|
1733
|
-
*
|
|
1734
|
-
*
|
|
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>({
|
|
@@ -2403,10 +2483,43 @@ export const getSubgraphQuota = <ThrowOnError extends boolean = false>(options:
|
|
|
2403
2483
|
|
|
2404
2484
|
/**
|
|
2405
2485
|
* List Staging Tables
|
|
2406
|
-
* List all DuckDB staging tables
|
|
2486
|
+
* List all DuckDB staging tables with comprehensive metrics and status.
|
|
2487
|
+
*
|
|
2488
|
+
* Get a complete inventory of all staging tables for a graph, including
|
|
2489
|
+
* file counts, storage sizes, and row estimates. Essential for monitoring
|
|
2490
|
+
* the data pipeline and determining which tables are ready for ingestion.
|
|
2491
|
+
*
|
|
2492
|
+
* **Returned Metrics:**
|
|
2493
|
+
* - Table name and type (node/relationship)
|
|
2494
|
+
* - File count per table
|
|
2495
|
+
* - Total storage size in bytes
|
|
2496
|
+
* - Estimated row count
|
|
2497
|
+
* - S3 location pattern
|
|
2498
|
+
* - Ready-for-ingestion status
|
|
2499
|
+
*
|
|
2500
|
+
* **Use Cases:**
|
|
2501
|
+
* - Monitor data upload progress
|
|
2502
|
+
* - Check which tables have files ready
|
|
2503
|
+
* - Track storage consumption
|
|
2504
|
+
* - Validate pipeline before ingestion
|
|
2505
|
+
* - Capacity planning
|
|
2506
|
+
*
|
|
2507
|
+
* **Workflow:**
|
|
2508
|
+
* 1. List tables to see current state
|
|
2509
|
+
* 2. Upload files to empty tables
|
|
2510
|
+
* 3. Re-list to verify uploads
|
|
2511
|
+
* 4. Check file counts and sizes
|
|
2512
|
+
* 5. Ingest when ready
|
|
2513
|
+
*
|
|
2514
|
+
* **Important Notes:**
|
|
2515
|
+
* - Tables with `file_count > 0` have data ready
|
|
2516
|
+
* - Check `total_size_bytes` for storage monitoring
|
|
2517
|
+
* - Use `s3_location` to verify upload paths
|
|
2518
|
+
* - Empty tables (file_count=0) are skipped during ingestion
|
|
2519
|
+
* - Table queries are included - no credit consumption
|
|
2407
2520
|
*/
|
|
2408
|
-
export const
|
|
2409
|
-
return (options.client ?? _heyApiClient).get<
|
|
2521
|
+
export const listTables = <ThrowOnError extends boolean = false>(options: Options<ListTablesData, ThrowOnError>) => {
|
|
2522
|
+
return (options.client ?? _heyApiClient).get<ListTablesResponses, ListTablesErrors, ThrowOnError>({
|
|
2410
2523
|
security: [
|
|
2411
2524
|
{
|
|
2412
2525
|
name: 'X-API-Key',
|
|
@@ -2423,11 +2536,44 @@ export const listTablesV1GraphsGraphIdTablesGet = <ThrowOnError extends boolean
|
|
|
2423
2536
|
};
|
|
2424
2537
|
|
|
2425
2538
|
/**
|
|
2426
|
-
* List Files in Table
|
|
2427
|
-
* List all files uploaded to a staging table
|
|
2539
|
+
* List Files in Staging Table
|
|
2540
|
+
* List all files uploaded to a staging table with comprehensive metadata.
|
|
2541
|
+
*
|
|
2542
|
+
* Get a complete inventory of all files in a staging table, including upload status,
|
|
2543
|
+
* file sizes, row counts, and S3 locations. Essential for monitoring upload progress
|
|
2544
|
+
* and validating data before ingestion.
|
|
2545
|
+
*
|
|
2546
|
+
* **Use Cases:**
|
|
2547
|
+
* - Monitor file upload progress
|
|
2548
|
+
* - Verify files are ready for ingestion
|
|
2549
|
+
* - Check file formats and sizes
|
|
2550
|
+
* - Track storage usage per table
|
|
2551
|
+
* - Identify failed or incomplete uploads
|
|
2552
|
+
* - Pre-ingestion validation
|
|
2553
|
+
*
|
|
2554
|
+
* **Returned Metadata:**
|
|
2555
|
+
* - File ID, name, and format (parquet, csv, json)
|
|
2556
|
+
* - Size in bytes and row count (if available)
|
|
2557
|
+
* - Upload status and method
|
|
2558
|
+
* - Creation and upload timestamps
|
|
2559
|
+
* - S3 key for reference
|
|
2560
|
+
*
|
|
2561
|
+
* **Upload Status Values:**
|
|
2562
|
+
* - `pending`: Upload URL generated, awaiting upload
|
|
2563
|
+
* - `uploaded`: Successfully uploaded, ready for ingestion
|
|
2564
|
+
* - `disabled`: Excluded from ingestion
|
|
2565
|
+
* - `archived`: Soft deleted
|
|
2566
|
+
* - `failed`: Upload failed
|
|
2567
|
+
*
|
|
2568
|
+
* **Important Notes:**
|
|
2569
|
+
* - Only `uploaded` files are ingested
|
|
2570
|
+
* - Check `row_count` to estimate data volume
|
|
2571
|
+
* - Use `total_size_bytes` for storage monitoring
|
|
2572
|
+
* - Files with `failed` status should be deleted and re-uploaded
|
|
2573
|
+
* - File listing is included - no credit consumption
|
|
2428
2574
|
*/
|
|
2429
|
-
export const
|
|
2430
|
-
return (options.client ?? _heyApiClient).get<
|
|
2575
|
+
export const listTableFiles = <ThrowOnError extends boolean = false>(options: Options<ListTableFilesData, ThrowOnError>) => {
|
|
2576
|
+
return (options.client ?? _heyApiClient).get<ListTableFilesResponses, ListTableFilesErrors, ThrowOnError>({
|
|
2431
2577
|
security: [
|
|
2432
2578
|
{
|
|
2433
2579
|
name: 'X-API-Key',
|
|
@@ -2444,11 +2590,43 @@ export const listTableFilesV1GraphsGraphIdTablesTableNameFilesGet = <ThrowOnErro
|
|
|
2444
2590
|
};
|
|
2445
2591
|
|
|
2446
2592
|
/**
|
|
2447
|
-
*
|
|
2448
|
-
*
|
|
2593
|
+
* Get File Upload URL
|
|
2594
|
+
* Generate a presigned S3 URL for secure file upload.
|
|
2595
|
+
*
|
|
2596
|
+
* Initiates file upload to a staging table by generating a secure, time-limited
|
|
2597
|
+
* presigned S3 URL. Files are uploaded directly to S3, bypassing the API for
|
|
2598
|
+
* optimal performance.
|
|
2599
|
+
*
|
|
2600
|
+
* **Upload Workflow:**
|
|
2601
|
+
* 1. Call this endpoint to get presigned URL
|
|
2602
|
+
* 2. PUT file directly to S3 URL
|
|
2603
|
+
* 3. Call PATCH /tables/files/{file_id} with status='uploaded'
|
|
2604
|
+
* 4. Backend validates file and calculates metrics
|
|
2605
|
+
* 5. File ready for ingestion
|
|
2606
|
+
*
|
|
2607
|
+
* **Supported Formats:**
|
|
2608
|
+
* - Parquet (`application/x-parquet` with `.parquet` extension)
|
|
2609
|
+
* - CSV (`text/csv` with `.csv` extension)
|
|
2610
|
+
* - JSON (`application/json` with `.json` extension)
|
|
2611
|
+
*
|
|
2612
|
+
* **Validation:**
|
|
2613
|
+
* - File extension must match content type
|
|
2614
|
+
* - File name 1-255 characters
|
|
2615
|
+
* - No path traversal characters (.. / \)
|
|
2616
|
+
* - Auto-creates table if it doesn't exist
|
|
2617
|
+
*
|
|
2618
|
+
* **Auto-Table Creation:**
|
|
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.
|
|
2621
|
+
*
|
|
2622
|
+
* **Important Notes:**
|
|
2623
|
+
* - Presigned URLs expire (default: 1 hour)
|
|
2624
|
+
* - Use appropriate Content-Type header when uploading to S3
|
|
2625
|
+
* - File extension must match content type
|
|
2626
|
+
* - Upload URL generation is included - no credit consumption
|
|
2449
2627
|
*/
|
|
2450
|
-
export const
|
|
2451
|
-
return (options.client ?? _heyApiClient).post<
|
|
2628
|
+
export const getUploadUrl = <ThrowOnError extends boolean = false>(options: Options<GetUploadUrlData, ThrowOnError>) => {
|
|
2629
|
+
return (options.client ?? _heyApiClient).post<GetUploadUrlResponses, GetUploadUrlErrors, ThrowOnError>({
|
|
2452
2630
|
security: [
|
|
2453
2631
|
{
|
|
2454
2632
|
name: 'X-API-Key',
|
|
@@ -2469,11 +2647,41 @@ export const getUploadUrlV1GraphsGraphIdTablesTableNameFilesPost = <ThrowOnError
|
|
|
2469
2647
|
};
|
|
2470
2648
|
|
|
2471
2649
|
/**
|
|
2472
|
-
* Delete File
|
|
2473
|
-
* Delete a
|
|
2650
|
+
* Delete File from Staging
|
|
2651
|
+
* Delete a file from S3 storage and database tracking.
|
|
2652
|
+
*
|
|
2653
|
+
* Remove unwanted, duplicate, or incorrect files from staging tables before ingestion.
|
|
2654
|
+
* The file is deleted from both S3 and database tracking, and table statistics
|
|
2655
|
+
* are automatically recalculated.
|
|
2656
|
+
*
|
|
2657
|
+
* **Use Cases:**
|
|
2658
|
+
* - Remove duplicate uploads
|
|
2659
|
+
* - Delete files with incorrect data
|
|
2660
|
+
* - Clean up failed uploads
|
|
2661
|
+
* - Fix data quality issues before ingestion
|
|
2662
|
+
* - Manage storage usage
|
|
2663
|
+
*
|
|
2664
|
+
* **What Happens:**
|
|
2665
|
+
* 1. File deleted from S3 storage
|
|
2666
|
+
* 2. Database tracking record removed
|
|
2667
|
+
* 3. Table statistics recalculated (file count, size, row count)
|
|
2668
|
+
* 4. DuckDB automatically excludes file from future queries
|
|
2669
|
+
*
|
|
2670
|
+
* **Security:**
|
|
2671
|
+
* - Write access required (verified via auth)
|
|
2672
|
+
* - Shared repositories block file deletions
|
|
2673
|
+
* - Full audit trail of deletion operations
|
|
2674
|
+
* - Cannot delete after ingestion to graph
|
|
2675
|
+
*
|
|
2676
|
+
* **Important Notes:**
|
|
2677
|
+
* - Delete files before ingestion for best results
|
|
2678
|
+
* - Table statistics update automatically
|
|
2679
|
+
* - No need to refresh DuckDB - exclusion is automatic
|
|
2680
|
+
* - Consider re-uploading corrected version after deletion
|
|
2681
|
+
* - File deletion is included - no credit consumption
|
|
2474
2682
|
*/
|
|
2475
|
-
export const
|
|
2476
|
-
return (options.client ?? _heyApiClient).delete<
|
|
2683
|
+
export const deleteFile = <ThrowOnError extends boolean = false>(options: Options<DeleteFileData, ThrowOnError>) => {
|
|
2684
|
+
return (options.client ?? _heyApiClient).delete<DeleteFileResponses, DeleteFileErrors, ThrowOnError>({
|
|
2477
2685
|
security: [
|
|
2478
2686
|
{
|
|
2479
2687
|
name: 'X-API-Key',
|
|
@@ -2490,11 +2698,25 @@ export const deleteFileV1GraphsGraphIdTablesFilesFileIdDelete = <ThrowOnError ex
|
|
|
2490
2698
|
};
|
|
2491
2699
|
|
|
2492
2700
|
/**
|
|
2493
|
-
* Get File
|
|
2494
|
-
* Get detailed information about a specific file
|
|
2701
|
+
* Get File Information
|
|
2702
|
+
* Get detailed information about a specific file.
|
|
2703
|
+
*
|
|
2704
|
+
* Retrieve comprehensive metadata for a single file, including upload status,
|
|
2705
|
+
* size, row count, and timestamps. Useful for validating individual files
|
|
2706
|
+
* before ingestion.
|
|
2707
|
+
*
|
|
2708
|
+
* **Use Cases:**
|
|
2709
|
+
* - Validate file upload completion
|
|
2710
|
+
* - Check file metadata before ingestion
|
|
2711
|
+
* - Debug upload issues
|
|
2712
|
+
* - Verify file format and size
|
|
2713
|
+
* - Track file lifecycle
|
|
2714
|
+
*
|
|
2715
|
+
* **Note:**
|
|
2716
|
+
* File info retrieval is included - no credit consumption
|
|
2495
2717
|
*/
|
|
2496
|
-
export const
|
|
2497
|
-
return (options.client ?? _heyApiClient).get<
|
|
2718
|
+
export const getFileInfo = <ThrowOnError extends boolean = false>(options: Options<GetFileInfoData, ThrowOnError>) => {
|
|
2719
|
+
return (options.client ?? _heyApiClient).get<GetFileInfoResponses, GetFileInfoErrors, ThrowOnError>({
|
|
2498
2720
|
security: [
|
|
2499
2721
|
{
|
|
2500
2722
|
name: 'X-API-Key',
|
|
@@ -2511,11 +2733,46 @@ export const getFileInfoV1GraphsGraphIdTablesFilesFileIdGet = <ThrowOnError exte
|
|
|
2511
2733
|
};
|
|
2512
2734
|
|
|
2513
2735
|
/**
|
|
2514
|
-
* Update File
|
|
2515
|
-
* Update file
|
|
2736
|
+
* Update File Upload Status
|
|
2737
|
+
* Update file status after upload completes.
|
|
2738
|
+
*
|
|
2739
|
+
* Marks files as uploaded after successful S3 upload. The backend validates
|
|
2740
|
+
* the file, calculates size and row count, enforces storage limits, and
|
|
2741
|
+
* registers the DuckDB table for queries.
|
|
2742
|
+
*
|
|
2743
|
+
* **Status Values:**
|
|
2744
|
+
* - `uploaded`: File successfully uploaded to S3 (triggers validation)
|
|
2745
|
+
* - `disabled`: Exclude file from ingestion
|
|
2746
|
+
* - `archived`: Soft delete file
|
|
2747
|
+
*
|
|
2748
|
+
* **What Happens on 'uploaded' Status:**
|
|
2749
|
+
* 1. Verify file exists in S3
|
|
2750
|
+
* 2. Calculate actual file size
|
|
2751
|
+
* 3. Enforce tier storage limits
|
|
2752
|
+
* 4. Calculate or estimate row count
|
|
2753
|
+
* 5. Update table statistics
|
|
2754
|
+
* 6. Register DuckDB external table
|
|
2755
|
+
* 7. File ready for ingestion
|
|
2756
|
+
*
|
|
2757
|
+
* **Row Count Calculation:**
|
|
2758
|
+
* - **Parquet**: Exact count from file metadata
|
|
2759
|
+
* - **CSV**: Count rows (minus header)
|
|
2760
|
+
* - **JSON**: Count array elements
|
|
2761
|
+
* - **Fallback**: Estimate from file size if reading fails
|
|
2762
|
+
*
|
|
2763
|
+
* **Storage Limits:**
|
|
2764
|
+
* Enforced per subscription tier. Returns HTTP 413 if limit exceeded.
|
|
2765
|
+
* Check current usage before large uploads.
|
|
2766
|
+
*
|
|
2767
|
+
* **Important Notes:**
|
|
2768
|
+
* - Always call this after S3 upload completes
|
|
2769
|
+
* - Check response for actual row count
|
|
2770
|
+
* - Storage limit errors (413) mean tier upgrade needed
|
|
2771
|
+
* - DuckDB registration failures are non-fatal (retried later)
|
|
2772
|
+
* - Status updates are included - no credit consumption
|
|
2516
2773
|
*/
|
|
2517
|
-
export const
|
|
2518
|
-
return (options.client ?? _heyApiClient).patch<
|
|
2774
|
+
export const updateFileStatus = <ThrowOnError extends boolean = false>(options: Options<UpdateFileStatusData, ThrowOnError>) => {
|
|
2775
|
+
return (options.client ?? _heyApiClient).patch<UpdateFileStatusResponses, UpdateFileStatusErrors, ThrowOnError>({
|
|
2519
2776
|
security: [
|
|
2520
2777
|
{
|
|
2521
2778
|
name: 'X-API-Key',
|
|
@@ -2537,10 +2794,64 @@ export const updateFileV1GraphsGraphIdTablesFilesFileIdPatch = <ThrowOnError ext
|
|
|
2537
2794
|
|
|
2538
2795
|
/**
|
|
2539
2796
|
* Ingest Tables to Graph
|
|
2540
|
-
* Load all files from S3 into DuckDB staging tables and ingest into Kuzu graph database.
|
|
2797
|
+
* Load all files from S3 into DuckDB staging tables and ingest into Kuzu graph database.
|
|
2798
|
+
*
|
|
2799
|
+
* Orchestrates the complete data pipeline from S3 staging files into the Kuzu graph database.
|
|
2800
|
+
* Processes all tables in a single bulk operation with comprehensive error handling and metrics.
|
|
2801
|
+
*
|
|
2802
|
+
* **Use Cases:**
|
|
2803
|
+
* - Initial graph population from uploaded data
|
|
2804
|
+
* - Incremental data updates with new files
|
|
2805
|
+
* - Complete database rebuild from source files
|
|
2806
|
+
* - Recovery from failed ingestion attempts
|
|
2807
|
+
*
|
|
2808
|
+
* **Workflow:**
|
|
2809
|
+
* 1. Upload data files via `POST /tables/{table_name}/files`
|
|
2810
|
+
* 2. Files are validated and marked as 'uploaded'
|
|
2811
|
+
* 3. Trigger ingestion: `POST /tables/ingest`
|
|
2812
|
+
* 4. DuckDB staging tables created from S3 patterns
|
|
2813
|
+
* 5. Data copied row-by-row from DuckDB to Kuzu
|
|
2814
|
+
* 6. Per-table results and metrics returned
|
|
2815
|
+
*
|
|
2816
|
+
* **Rebuild Feature:**
|
|
2817
|
+
* Setting `rebuild=true` regenerates the entire graph database from scratch:
|
|
2818
|
+
* - Deletes existing Kuzu database
|
|
2819
|
+
* - Recreates with fresh schema from active GraphSchema
|
|
2820
|
+
* - Ingests all data files
|
|
2821
|
+
* - Safe operation - S3 is source of truth
|
|
2822
|
+
* - Useful for schema changes or data corrections
|
|
2823
|
+
* - Graph marked as 'rebuilding' during process
|
|
2824
|
+
*
|
|
2825
|
+
* **Error Handling:**
|
|
2826
|
+
* - Per-table error isolation with `ignore_errors` flag
|
|
2827
|
+
* - Partial success support (some tables succeed, some fail)
|
|
2828
|
+
* - Detailed error reporting per table
|
|
2829
|
+
* - Graph status tracking throughout process
|
|
2830
|
+
* - Automatic failure recovery and cleanup
|
|
2831
|
+
*
|
|
2832
|
+
* **Performance:**
|
|
2833
|
+
* - Processes all tables in sequence
|
|
2834
|
+
* - Each table timed independently
|
|
2835
|
+
* - Total execution metrics provided
|
|
2836
|
+
* - Scales to thousands of files
|
|
2837
|
+
* - Optimized for large datasets
|
|
2838
|
+
*
|
|
2839
|
+
* **Concurrency Control:**
|
|
2840
|
+
* Only one ingestion can run per graph at a time. If another ingestion is in progress,
|
|
2841
|
+
* you'll receive a 409 Conflict error. The distributed lock automatically expires after
|
|
2842
|
+
* the configured TTL (default: 1 hour) to prevent deadlocks from failed ingestions.
|
|
2843
|
+
*
|
|
2844
|
+
* **Important Notes:**
|
|
2845
|
+
* - Only files with 'uploaded' status are processed
|
|
2846
|
+
* - Tables with no uploaded files are skipped
|
|
2847
|
+
* - Use `ignore_errors=false` for strict validation
|
|
2848
|
+
* - Monitor progress via per-table results
|
|
2849
|
+
* - Check graph metadata for rebuild status
|
|
2850
|
+
* - Wait for current ingestion to complete before starting another
|
|
2851
|
+
* - Table ingestion is included - no credit consumption
|
|
2541
2852
|
*/
|
|
2542
|
-
export const
|
|
2543
|
-
return (options.client ?? _heyApiClient).post<
|
|
2853
|
+
export const ingestTables = <ThrowOnError extends boolean = false>(options: Options<IngestTablesData, ThrowOnError>) => {
|
|
2854
|
+
return (options.client ?? _heyApiClient).post<IngestTablesResponses, IngestTablesErrors, ThrowOnError>({
|
|
2544
2855
|
security: [
|
|
2545
2856
|
{
|
|
2546
2857
|
name: 'X-API-Key',
|
|
@@ -2562,10 +2873,59 @@ export const ingestTablesV1GraphsGraphIdTablesIngestPost = <ThrowOnError extends
|
|
|
2562
2873
|
|
|
2563
2874
|
/**
|
|
2564
2875
|
* Query Staging Tables with SQL
|
|
2565
|
-
* Execute SQL queries on DuckDB staging tables
|
|
2876
|
+
* Execute SQL queries on DuckDB staging tables for data inspection and validation.
|
|
2877
|
+
*
|
|
2878
|
+
* Query raw staging data directly with SQL before ingestion into the graph database.
|
|
2879
|
+
* Useful for data quality checks, validation, and exploratory analysis.
|
|
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
|
+
*
|
|
2888
|
+
* **Use Cases:**
|
|
2889
|
+
* - Validate data quality before graph ingestion
|
|
2890
|
+
* - Inspect row-level data for debugging
|
|
2891
|
+
* - Run analytics on staging tables
|
|
2892
|
+
* - Check for duplicates, nulls, or data issues
|
|
2893
|
+
* - Preview data transformations
|
|
2894
|
+
*
|
|
2895
|
+
* **Workflow:**
|
|
2896
|
+
* 1. Upload data files via `POST /tables/{table_name}/files`
|
|
2897
|
+
* 2. Query staging tables to validate: `POST /tables/query`
|
|
2898
|
+
* 3. Fix any data issues by re-uploading
|
|
2899
|
+
* 4. Ingest validated data: `POST /tables/ingest`
|
|
2900
|
+
*
|
|
2901
|
+
* **Supported SQL:**
|
|
2902
|
+
* - Full DuckDB SQL syntax
|
|
2903
|
+
* - SELECT, JOIN, WHERE, GROUP BY, ORDER BY
|
|
2904
|
+
* - Aggregations, window functions, CTEs
|
|
2905
|
+
* - Multiple table joins across staging area
|
|
2906
|
+
*
|
|
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"]`
|
|
2913
|
+
*
|
|
2914
|
+
* **Limits:**
|
|
2915
|
+
* - Query timeout: 30 seconds
|
|
2916
|
+
* - Result limit: 10,000 rows (use LIMIT clause)
|
|
2917
|
+
* - Read-only: No INSERT, UPDATE, DELETE
|
|
2918
|
+
* - User's tables only: Cannot query other users' data
|
|
2919
|
+
*
|
|
2920
|
+
* **Shared Repositories:**
|
|
2921
|
+
* Shared repositories (SEC, etc.) do not allow direct SQL queries.
|
|
2922
|
+
* Use the graph query endpoint instead: `POST /v1/graphs/{graph_id}/query`
|
|
2923
|
+
*
|
|
2924
|
+
* **Note:**
|
|
2925
|
+
* Staging table queries are included - no credit consumption
|
|
2566
2926
|
*/
|
|
2567
|
-
export const
|
|
2568
|
-
return (options.client ?? _heyApiClient).post<
|
|
2927
|
+
export const queryTables = <ThrowOnError extends boolean = false>(options: Options<QueryTablesData, ThrowOnError>) => {
|
|
2928
|
+
return (options.client ?? _heyApiClient).post<QueryTablesResponses, QueryTablesErrors, ThrowOnError>({
|
|
2569
2929
|
security: [
|
|
2570
2930
|
{
|
|
2571
2931
|
name: 'X-API-Key',
|
|
@@ -2587,7 +2947,40 @@ export const queryTablesV1GraphsGraphIdTablesQueryPost = <ThrowOnError extends b
|
|
|
2587
2947
|
|
|
2588
2948
|
/**
|
|
2589
2949
|
* Get User Graphs
|
|
2590
|
-
*
|
|
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.
|
|
2591
2984
|
*/
|
|
2592
2985
|
export const getGraphs = <ThrowOnError extends boolean = false>(options?: Options<GetGraphsData, ThrowOnError>) => {
|
|
2593
2986
|
return (options?.client ?? _heyApiClient).get<GetGraphsResponses, GetGraphsErrors, ThrowOnError>({
|
|
@@ -2672,10 +3065,37 @@ export const createGraph = <ThrowOnError extends boolean = false>(options: Optio
|
|
|
2672
3065
|
|
|
2673
3066
|
/**
|
|
2674
3067
|
* Get Available Schema Extensions
|
|
2675
|
-
* 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.
|
|
2676
3096
|
*/
|
|
2677
3097
|
export const getAvailableExtensions = <ThrowOnError extends boolean = false>(options?: Options<GetAvailableExtensionsData, ThrowOnError>) => {
|
|
2678
|
-
return (options?.client ?? _heyApiClient).get<GetAvailableExtensionsResponses,
|
|
3098
|
+
return (options?.client ?? _heyApiClient).get<GetAvailableExtensionsResponses, GetAvailableExtensionsErrors, ThrowOnError>({
|
|
2679
3099
|
security: [
|
|
2680
3100
|
{
|
|
2681
3101
|
name: 'X-API-Key',
|
|
@@ -2693,7 +3113,35 @@ export const getAvailableExtensions = <ThrowOnError extends boolean = false>(opt
|
|
|
2693
3113
|
|
|
2694
3114
|
/**
|
|
2695
3115
|
* Select Graph
|
|
2696
|
-
* 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.
|
|
2697
3145
|
*/
|
|
2698
3146
|
export const selectGraph = <ThrowOnError extends boolean = false>(options: Options<SelectGraphData, ThrowOnError>) => {
|
|
2699
3147
|
return (options.client ?? _heyApiClient).post<SelectGraphResponses, SelectGraphErrors, ThrowOnError>({
|