@robosystems/client 0.1.15 → 0.1.17

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.
Files changed (67) hide show
  1. package/extensions/hooks.d.ts +1 -1
  2. package/package.json +48 -6
  3. package/sdk/client/client.gen.d.ts +2 -0
  4. package/sdk/client/client.gen.js +153 -0
  5. package/sdk/client/client.gen.ts +200 -0
  6. package/sdk/client/index.d.ts +7 -0
  7. package/sdk/client/index.js +15 -0
  8. package/sdk/client/index.ts +25 -0
  9. package/sdk/client/types.gen.d.ts +122 -0
  10. package/sdk/client/types.gen.js +4 -0
  11. package/sdk/client/types.gen.ts +233 -0
  12. package/sdk/client/utils.gen.d.ts +45 -0
  13. package/sdk/client/utils.gen.js +296 -0
  14. package/sdk/client/utils.gen.ts +419 -0
  15. package/sdk/client.gen.d.ts +12 -0
  16. package/sdk/client.gen.js +8 -0
  17. package/sdk/client.gen.ts +18 -0
  18. package/sdk/core/auth.gen.d.ts +18 -0
  19. package/sdk/core/auth.gen.js +18 -0
  20. package/sdk/core/auth.gen.ts +42 -0
  21. package/sdk/core/bodySerializer.gen.d.ts +17 -0
  22. package/sdk/core/bodySerializer.gen.js +57 -0
  23. package/sdk/core/bodySerializer.gen.ts +90 -0
  24. package/sdk/core/params.gen.d.ts +33 -0
  25. package/sdk/core/params.gen.js +92 -0
  26. package/sdk/core/params.gen.ts +153 -0
  27. package/sdk/core/pathSerializer.gen.d.ts +33 -0
  28. package/sdk/core/pathSerializer.gen.js +123 -0
  29. package/sdk/core/pathSerializer.gen.ts +181 -0
  30. package/sdk/core/types.gen.d.ts +78 -0
  31. package/sdk/core/types.gen.js +4 -0
  32. package/sdk/core/types.gen.ts +121 -0
  33. package/sdk/index.d.ts +2 -0
  34. package/sdk/index.js +19 -0
  35. package/sdk/index.ts +3 -0
  36. package/sdk/sdk.gen.d.ts +1249 -0
  37. package/sdk/sdk.gen.js +2572 -0
  38. package/sdk/sdk.gen.ts +2585 -0
  39. package/sdk/types.gen.d.ts +6347 -0
  40. package/sdk/types.gen.js +3 -0
  41. package/sdk/types.gen.ts +6852 -0
  42. package/sdk-extensions/OperationClient.d.ts +64 -0
  43. package/sdk-extensions/OperationClient.js +251 -0
  44. package/sdk-extensions/OperationClient.ts +322 -0
  45. package/sdk-extensions/QueryClient.d.ts +50 -0
  46. package/sdk-extensions/QueryClient.js +190 -0
  47. package/sdk-extensions/QueryClient.ts +283 -0
  48. package/sdk-extensions/README.md +672 -0
  49. package/sdk-extensions/SSEClient.d.ts +48 -0
  50. package/sdk-extensions/SSEClient.js +148 -0
  51. package/sdk-extensions/SSEClient.ts +189 -0
  52. package/sdk-extensions/config.d.ts +32 -0
  53. package/sdk-extensions/config.js +74 -0
  54. package/sdk-extensions/config.ts +91 -0
  55. package/sdk-extensions/hooks.d.ts +110 -0
  56. package/sdk-extensions/hooks.js +371 -0
  57. package/sdk-extensions/hooks.ts +438 -0
  58. package/sdk-extensions/index.d.ts +46 -0
  59. package/sdk-extensions/index.js +110 -0
  60. package/sdk-extensions/index.ts +123 -0
  61. package/sdk.gen.d.ts +210 -104
  62. package/sdk.gen.js +409 -287
  63. package/sdk.gen.ts +404 -282
  64. package/types.gen.d.ts +1218 -567
  65. package/types.gen.ts +1236 -566
  66. package/openapi-ts.config.js +0 -9
  67. package/prepare.js +0 -220
package/sdk/sdk.gen.ts ADDED
@@ -0,0 +1,2585 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+
3
+ import type { Options as ClientOptions, TDataShape, Client } from './client';
4
+ import type { RegisterUserData, RegisterUserResponses, RegisterUserErrors, LoginUserData, LoginUserResponses, LoginUserErrors, LogoutUserData, LogoutUserResponses, LogoutUserErrors, GetCurrentAuthUserData, GetCurrentAuthUserResponses, GetCurrentAuthUserErrors, RefreshSessionData, RefreshSessionResponses, RefreshSessionErrors, GenerateSsoTokenData, GenerateSsoTokenResponses, GenerateSsoTokenErrors, SsoLoginData, SsoLoginResponses, SsoLoginErrors, SsoTokenExchangeData, SsoTokenExchangeResponses, SsoTokenExchangeErrors, CompleteSsoAuthData, CompleteSsoAuthResponses, CompleteSsoAuthErrors, GetPasswordPolicyData, GetPasswordPolicyResponses, CheckPasswordStrengthData, CheckPasswordStrengthResponses, CheckPasswordStrengthErrors, GetCaptchaConfigData, GetCaptchaConfigResponses, GetServiceStatusData, GetServiceStatusResponses, GetCurrentUserData, GetCurrentUserResponses, GetCurrentUserErrors, UpdateUserData, UpdateUserResponses, UpdateUserErrors, GetUserGraphsData, GetUserGraphsResponses, GetUserGraphsErrors, SelectUserGraphData, SelectUserGraphResponses, SelectUserGraphErrors, GetAllCreditSummariesData, GetAllCreditSummariesResponses, GetAllCreditSummariesErrors, UpdateUserPasswordData, UpdateUserPasswordResponses, UpdateUserPasswordErrors, ListUserApiKeysData, ListUserApiKeysResponses, ListUserApiKeysErrors, CreateUserApiKeyData, CreateUserApiKeyResponses, CreateUserApiKeyErrors, RevokeUserApiKeyData, RevokeUserApiKeyResponses, RevokeUserApiKeyErrors, UpdateUserApiKeyData, UpdateUserApiKeyResponses, UpdateUserApiKeyErrors, GetUserLimitsData, GetUserLimitsResponses, GetUserLimitsErrors, GetUserUsageData, GetUserUsageResponses, GetUserUsageErrors, GetAllSharedRepositoryLimitsData, GetAllSharedRepositoryLimitsResponses, GetAllSharedRepositoryLimitsErrors, GetSharedRepositoryLimitsData, GetSharedRepositoryLimitsResponses, GetSharedRepositoryLimitsErrors, GetUserUsageOverviewData, GetUserUsageOverviewResponses, GetUserUsageOverviewErrors, GetDetailedUserAnalyticsData, GetDetailedUserAnalyticsResponses, GetDetailedUserAnalyticsErrors, GetUserSharedSubscriptionsData, GetUserSharedSubscriptionsResponses, GetUserSharedSubscriptionsErrors, SubscribeToSharedRepositoryData, SubscribeToSharedRepositoryResponses, SubscribeToSharedRepositoryErrors, UpgradeSharedRepositorySubscriptionData, UpgradeSharedRepositorySubscriptionResponses, UpgradeSharedRepositorySubscriptionErrors, CancelSharedRepositorySubscriptionData, CancelSharedRepositorySubscriptionResponses, CancelSharedRepositorySubscriptionErrors, GetSharedRepositoryCreditsData, GetSharedRepositoryCreditsResponses, GetSharedRepositoryCreditsErrors, GetRepositoryCreditsData, GetRepositoryCreditsResponses, GetRepositoryCreditsErrors, ListConnectionsData, ListConnectionsResponses, ListConnectionsErrors, CreateConnectionData, CreateConnectionResponses, CreateConnectionErrors, DeleteConnectionData, DeleteConnectionResponses, DeleteConnectionErrors, GetConnectionData, GetConnectionResponses, GetConnectionErrors, GetConnectionOptionsData, GetConnectionOptionsResponses, GetConnectionOptionsErrors, SyncConnectionData, SyncConnectionResponses, SyncConnectionErrors, CreateLinkTokenData, CreateLinkTokenResponses, CreateLinkTokenErrors, ExchangeLinkTokenData, ExchangeLinkTokenResponses, ExchangeLinkTokenErrors, InitOAuthData, InitOAuthResponses, InitOAuthErrors, OauthCallbackData, OauthCallbackResponses, OauthCallbackErrors, QueryFinancialAgentData, QueryFinancialAgentResponses, QueryFinancialAgentErrors, ListMcpToolsData, ListMcpToolsResponses, ListMcpToolsErrors, CallMcpToolData, CallMcpToolResponses, CallMcpToolErrors, ListBackupsData, ListBackupsResponses, ListBackupsErrors, CreateBackupData, CreateBackupResponses, CreateBackupErrors, ExportBackupData, ExportBackupResponses, ExportBackupErrors, GetBackupDownloadUrlData, GetBackupDownloadUrlResponses, GetBackupDownloadUrlErrors, RestoreBackupData, RestoreBackupResponses, RestoreBackupErrors, GetBackupStatsData, GetBackupStatsResponses, GetBackupStatsErrors, GetGraphMetricsData, GetGraphMetricsResponses, GetGraphMetricsErrors, GetGraphUsageStatsData, GetGraphUsageStatsResponses, GetGraphUsageStatsErrors, ExecuteCypherQueryData, ExecuteCypherQueryResponses, ExecuteCypherQueryErrors, GetGraphSchemaInfoData, GetGraphSchemaInfoResponses, GetGraphSchemaInfoErrors, ValidateSchemaData, ValidateSchemaResponses, ValidateSchemaErrors, ExportGraphSchemaData, ExportGraphSchemaResponses, ExportGraphSchemaErrors, ListSchemaExtensionsData, ListSchemaExtensionsResponses, ListSchemaExtensionsErrors, 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, CopyDataToGraphData, CopyDataToGraphResponses, CopyDataToGraphErrors, CreateGraphData, CreateGraphResponses, CreateGraphErrors, GetAvailableExtensionsData, GetAvailableExtensionsResponses, GetServiceOfferingsData, GetServiceOfferingsResponses, GetServiceOfferingsErrors, StreamOperationEventsData, StreamOperationEventsResponses, StreamOperationEventsErrors, GetOperationStatusData, GetOperationStatusResponses, GetOperationStatusErrors, CancelOperationData, CancelOperationResponses, CancelOperationErrors } from './types.gen';
5
+ import { client as _heyApiClient } from './client.gen';
6
+
7
+ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & {
8
+ /**
9
+ * You can provide a client instance returned by `createClient()` instead of
10
+ * individual options. This might be also useful if you want to implement a
11
+ * custom client.
12
+ */
13
+ client?: Client;
14
+ /**
15
+ * You can pass arbitrary values through the `meta` object. This can be
16
+ * used to access values that aren't defined as part of the SDK function.
17
+ */
18
+ meta?: Record<string, unknown>;
19
+ };
20
+
21
+ /**
22
+ * Register New User
23
+ * Register a new user account with email and password. Security controls vary by environment: CAPTCHA and email verification are disabled in development for API testing, but required in production.
24
+ */
25
+ export const registerUser = <ThrowOnError extends boolean = false>(options: Options<RegisterUserData, ThrowOnError>) => {
26
+ return (options.client ?? _heyApiClient).post<RegisterUserResponses, RegisterUserErrors, ThrowOnError>({
27
+ url: '/v1/auth/register',
28
+ ...options,
29
+ headers: {
30
+ 'Content-Type': 'application/json',
31
+ ...options.headers
32
+ }
33
+ });
34
+ };
35
+
36
+ /**
37
+ * User Login
38
+ * Authenticate user with email and password.
39
+ */
40
+ export const loginUser = <ThrowOnError extends boolean = false>(options: Options<LoginUserData, ThrowOnError>) => {
41
+ return (options.client ?? _heyApiClient).post<LoginUserResponses, LoginUserErrors, ThrowOnError>({
42
+ url: '/v1/auth/login',
43
+ ...options,
44
+ headers: {
45
+ 'Content-Type': 'application/json',
46
+ ...options.headers
47
+ }
48
+ });
49
+ };
50
+
51
+ /**
52
+ * User Logout
53
+ * Logout user and invalidate session.
54
+ */
55
+ export const logoutUser = <ThrowOnError extends boolean = false>(options?: Options<LogoutUserData, ThrowOnError>) => {
56
+ return (options?.client ?? _heyApiClient).post<LogoutUserResponses, LogoutUserErrors, ThrowOnError>({
57
+ url: '/v1/auth/logout',
58
+ ...options
59
+ });
60
+ };
61
+
62
+ /**
63
+ * Get Current User
64
+ * Get current authenticated user from session.
65
+ */
66
+ export const getCurrentAuthUser = <ThrowOnError extends boolean = false>(options?: Options<GetCurrentAuthUserData, ThrowOnError>) => {
67
+ return (options?.client ?? _heyApiClient).get<GetCurrentAuthUserResponses, GetCurrentAuthUserErrors, ThrowOnError>({
68
+ url: '/v1/auth/me',
69
+ ...options
70
+ });
71
+ };
72
+
73
+ /**
74
+ * Refresh Session
75
+ * Refresh user session and extend authentication token.
76
+ */
77
+ export const refreshSession = <ThrowOnError extends boolean = false>(options?: Options<RefreshSessionData, ThrowOnError>) => {
78
+ return (options?.client ?? _heyApiClient).post<RefreshSessionResponses, RefreshSessionErrors, ThrowOnError>({
79
+ url: '/v1/auth/refresh',
80
+ ...options
81
+ });
82
+ };
83
+
84
+ /**
85
+ * Generate SSO Token
86
+ * Generate a temporary SSO token for cross-app authentication.
87
+ */
88
+ export const generateSsoToken = <ThrowOnError extends boolean = false>(options?: Options<GenerateSsoTokenData, ThrowOnError>) => {
89
+ return (options?.client ?? _heyApiClient).post<GenerateSsoTokenResponses, GenerateSsoTokenErrors, ThrowOnError>({
90
+ url: '/v1/auth/sso-token',
91
+ ...options
92
+ });
93
+ };
94
+
95
+ /**
96
+ * SSO Login
97
+ * Authenticate user with SSO token and establish session.
98
+ */
99
+ export const ssoLogin = <ThrowOnError extends boolean = false>(options: Options<SsoLoginData, ThrowOnError>) => {
100
+ return (options.client ?? _heyApiClient).post<SsoLoginResponses, SsoLoginErrors, ThrowOnError>({
101
+ url: '/v1/auth/sso-login',
102
+ ...options,
103
+ headers: {
104
+ 'Content-Type': 'application/json',
105
+ ...options.headers
106
+ }
107
+ });
108
+ };
109
+
110
+ /**
111
+ * SSO Token Exchange
112
+ * Exchange SSO token for secure session handoff to target application.
113
+ */
114
+ export const ssoTokenExchange = <ThrowOnError extends boolean = false>(options: Options<SsoTokenExchangeData, ThrowOnError>) => {
115
+ return (options.client ?? _heyApiClient).post<SsoTokenExchangeResponses, SsoTokenExchangeErrors, ThrowOnError>({
116
+ url: '/v1/auth/sso-exchange',
117
+ ...options,
118
+ headers: {
119
+ 'Content-Type': 'application/json',
120
+ ...options.headers
121
+ }
122
+ });
123
+ };
124
+
125
+ /**
126
+ * Complete SSO Authentication
127
+ * Complete SSO authentication using session ID from secure handoff.
128
+ */
129
+ export const completeSsoAuth = <ThrowOnError extends boolean = false>(options: Options<CompleteSsoAuthData, ThrowOnError>) => {
130
+ return (options.client ?? _heyApiClient).post<CompleteSsoAuthResponses, CompleteSsoAuthErrors, ThrowOnError>({
131
+ url: '/v1/auth/sso-complete',
132
+ ...options,
133
+ headers: {
134
+ 'Content-Type': 'application/json',
135
+ ...options.headers
136
+ }
137
+ });
138
+ };
139
+
140
+ /**
141
+ * Get Password Policy
142
+ * Get current password policy requirements for frontend validation
143
+ */
144
+ export const getPasswordPolicy = <ThrowOnError extends boolean = false>(options?: Options<GetPasswordPolicyData, ThrowOnError>) => {
145
+ return (options?.client ?? _heyApiClient).get<GetPasswordPolicyResponses, unknown, ThrowOnError>({
146
+ url: '/v1/auth/password/policy',
147
+ ...options
148
+ });
149
+ };
150
+
151
+ /**
152
+ * Check Password Strength
153
+ * Check password strength and get validation feedback
154
+ */
155
+ export const checkPasswordStrength = <ThrowOnError extends boolean = false>(options: Options<CheckPasswordStrengthData, ThrowOnError>) => {
156
+ return (options.client ?? _heyApiClient).post<CheckPasswordStrengthResponses, CheckPasswordStrengthErrors, ThrowOnError>({
157
+ url: '/v1/auth/password/check',
158
+ ...options,
159
+ headers: {
160
+ 'Content-Type': 'application/json',
161
+ ...options.headers
162
+ }
163
+ });
164
+ };
165
+
166
+ /**
167
+ * Get CAPTCHA Configuration
168
+ * Get CAPTCHA configuration including site key and whether CAPTCHA is required.
169
+ */
170
+ export const getCaptchaConfig = <ThrowOnError extends boolean = false>(options?: Options<GetCaptchaConfigData, ThrowOnError>) => {
171
+ return (options?.client ?? _heyApiClient).get<GetCaptchaConfigResponses, unknown, ThrowOnError>({
172
+ url: '/v1/auth/captcha/config',
173
+ ...options
174
+ });
175
+ };
176
+
177
+ /**
178
+ * Health Check
179
+ * Service health check endpoint for monitoring and load balancers
180
+ */
181
+ export const getServiceStatus = <ThrowOnError extends boolean = false>(options?: Options<GetServiceStatusData, ThrowOnError>) => {
182
+ return (options?.client ?? _heyApiClient).get<GetServiceStatusResponses, unknown, ThrowOnError>({
183
+ url: '/v1/status',
184
+ ...options
185
+ });
186
+ };
187
+
188
+ /**
189
+ * Get Current User
190
+ * Returns information about the currently authenticated user.
191
+ */
192
+ export const getCurrentUser = <ThrowOnError extends boolean = false>(options?: Options<GetCurrentUserData, ThrowOnError>) => {
193
+ return (options?.client ?? _heyApiClient).get<GetCurrentUserResponses, GetCurrentUserErrors, ThrowOnError>({
194
+ security: [
195
+ {
196
+ name: 'X-API-Key',
197
+ type: 'apiKey'
198
+ },
199
+ {
200
+ scheme: 'bearer',
201
+ type: 'http'
202
+ }
203
+ ],
204
+ url: '/v1/user',
205
+ ...options
206
+ });
207
+ };
208
+
209
+ /**
210
+ * Update User Profile
211
+ * Update the current user's profile information.
212
+ */
213
+ export const updateUser = <ThrowOnError extends boolean = false>(options: Options<UpdateUserData, ThrowOnError>) => {
214
+ return (options.client ?? _heyApiClient).put<UpdateUserResponses, UpdateUserErrors, ThrowOnError>({
215
+ security: [
216
+ {
217
+ name: 'X-API-Key',
218
+ type: 'apiKey'
219
+ },
220
+ {
221
+ scheme: 'bearer',
222
+ type: 'http'
223
+ }
224
+ ],
225
+ url: '/v1/user',
226
+ ...options,
227
+ headers: {
228
+ 'Content-Type': 'application/json',
229
+ ...options.headers
230
+ }
231
+ });
232
+ };
233
+
234
+ /**
235
+ * Get User Graphs
236
+ * Get all graph databases accessible to the current user.
237
+ */
238
+ export const getUserGraphs = <ThrowOnError extends boolean = false>(options?: Options<GetUserGraphsData, ThrowOnError>) => {
239
+ return (options?.client ?? _heyApiClient).get<GetUserGraphsResponses, GetUserGraphsErrors, ThrowOnError>({
240
+ security: [
241
+ {
242
+ name: 'X-API-Key',
243
+ type: 'apiKey'
244
+ },
245
+ {
246
+ scheme: 'bearer',
247
+ type: 'http'
248
+ }
249
+ ],
250
+ url: '/v1/user/graphs',
251
+ ...options
252
+ });
253
+ };
254
+
255
+ /**
256
+ * Select User Graph
257
+ * Select a specific graph as the active graph for the user.
258
+ */
259
+ export const selectUserGraph = <ThrowOnError extends boolean = false>(options: Options<SelectUserGraphData, ThrowOnError>) => {
260
+ return (options.client ?? _heyApiClient).post<SelectUserGraphResponses, SelectUserGraphErrors, ThrowOnError>({
261
+ security: [
262
+ {
263
+ name: 'X-API-Key',
264
+ type: 'apiKey'
265
+ },
266
+ {
267
+ scheme: 'bearer',
268
+ type: 'http'
269
+ }
270
+ ],
271
+ url: '/v1/user/graphs/{graph_id}/select',
272
+ ...options
273
+ });
274
+ };
275
+
276
+ /**
277
+ * Get All Credit Summaries
278
+ * Get credit summaries for all graphs owned by the user.
279
+ *
280
+ * This endpoint provides a consolidated view of credit usage across
281
+ * all graphs where the user has access, helping to monitor overall
282
+ * credit consumption and plan usage.
283
+ *
284
+ * No credits are consumed for viewing summaries.
285
+ */
286
+ export const getAllCreditSummaries = <ThrowOnError extends boolean = false>(options?: Options<GetAllCreditSummariesData, ThrowOnError>) => {
287
+ return (options?.client ?? _heyApiClient).get<GetAllCreditSummariesResponses, GetAllCreditSummariesErrors, ThrowOnError>({
288
+ security: [
289
+ {
290
+ name: 'X-API-Key',
291
+ type: 'apiKey'
292
+ },
293
+ {
294
+ scheme: 'bearer',
295
+ type: 'http'
296
+ }
297
+ ],
298
+ url: '/v1/user/credits',
299
+ ...options
300
+ });
301
+ };
302
+
303
+ /**
304
+ * Update Password
305
+ * Update the current user's password.
306
+ */
307
+ export const updateUserPassword = <ThrowOnError extends boolean = false>(options: Options<UpdateUserPasswordData, ThrowOnError>) => {
308
+ return (options.client ?? _heyApiClient).put<UpdateUserPasswordResponses, UpdateUserPasswordErrors, ThrowOnError>({
309
+ security: [
310
+ {
311
+ name: 'X-API-Key',
312
+ type: 'apiKey'
313
+ },
314
+ {
315
+ scheme: 'bearer',
316
+ type: 'http'
317
+ }
318
+ ],
319
+ url: '/v1/user/password',
320
+ ...options,
321
+ headers: {
322
+ 'Content-Type': 'application/json',
323
+ ...options.headers
324
+ }
325
+ });
326
+ };
327
+
328
+ /**
329
+ * List API Keys
330
+ * Get all API keys for the current user.
331
+ */
332
+ export const listUserApiKeys = <ThrowOnError extends boolean = false>(options?: Options<ListUserApiKeysData, ThrowOnError>) => {
333
+ return (options?.client ?? _heyApiClient).get<ListUserApiKeysResponses, ListUserApiKeysErrors, ThrowOnError>({
334
+ security: [
335
+ {
336
+ name: 'X-API-Key',
337
+ type: 'apiKey'
338
+ },
339
+ {
340
+ scheme: 'bearer',
341
+ type: 'http'
342
+ }
343
+ ],
344
+ url: '/v1/user/api-keys',
345
+ ...options
346
+ });
347
+ };
348
+
349
+ /**
350
+ * Create API Key
351
+ * Create a new API key for the current user.
352
+ */
353
+ export const createUserApiKey = <ThrowOnError extends boolean = false>(options: Options<CreateUserApiKeyData, ThrowOnError>) => {
354
+ return (options.client ?? _heyApiClient).post<CreateUserApiKeyResponses, CreateUserApiKeyErrors, ThrowOnError>({
355
+ security: [
356
+ {
357
+ name: 'X-API-Key',
358
+ type: 'apiKey'
359
+ },
360
+ {
361
+ scheme: 'bearer',
362
+ type: 'http'
363
+ }
364
+ ],
365
+ url: '/v1/user/api-keys',
366
+ ...options,
367
+ headers: {
368
+ 'Content-Type': 'application/json',
369
+ ...options.headers
370
+ }
371
+ });
372
+ };
373
+
374
+ /**
375
+ * Revoke API Key
376
+ * Revoke (deactivate) an API key.
377
+ */
378
+ export const revokeUserApiKey = <ThrowOnError extends boolean = false>(options: Options<RevokeUserApiKeyData, ThrowOnError>) => {
379
+ return (options.client ?? _heyApiClient).delete<RevokeUserApiKeyResponses, RevokeUserApiKeyErrors, ThrowOnError>({
380
+ security: [
381
+ {
382
+ name: 'X-API-Key',
383
+ type: 'apiKey'
384
+ },
385
+ {
386
+ scheme: 'bearer',
387
+ type: 'http'
388
+ }
389
+ ],
390
+ url: '/v1/user/api-keys/{api_key_id}',
391
+ ...options
392
+ });
393
+ };
394
+
395
+ /**
396
+ * Update API Key
397
+ * Update an API key's name or description.
398
+ */
399
+ export const updateUserApiKey = <ThrowOnError extends boolean = false>(options: Options<UpdateUserApiKeyData, ThrowOnError>) => {
400
+ return (options.client ?? _heyApiClient).put<UpdateUserApiKeyResponses, UpdateUserApiKeyErrors, ThrowOnError>({
401
+ security: [
402
+ {
403
+ name: 'X-API-Key',
404
+ type: 'apiKey'
405
+ },
406
+ {
407
+ scheme: 'bearer',
408
+ type: 'http'
409
+ }
410
+ ],
411
+ url: '/v1/user/api-keys/{api_key_id}',
412
+ ...options,
413
+ headers: {
414
+ 'Content-Type': 'application/json',
415
+ ...options.headers
416
+ }
417
+ });
418
+ };
419
+
420
+ /**
421
+ * Get user limits
422
+ * Retrieve current limits and restrictions for the authenticated user
423
+ */
424
+ export const getUserLimits = <ThrowOnError extends boolean = false>(options?: Options<GetUserLimitsData, ThrowOnError>) => {
425
+ return (options?.client ?? _heyApiClient).get<GetUserLimitsResponses, GetUserLimitsErrors, ThrowOnError>({
426
+ security: [
427
+ {
428
+ name: 'X-API-Key',
429
+ type: 'apiKey'
430
+ },
431
+ {
432
+ scheme: 'bearer',
433
+ type: 'http'
434
+ }
435
+ ],
436
+ url: '/v1/user/limits',
437
+ ...options
438
+ });
439
+ };
440
+
441
+ /**
442
+ * Get user usage statistics
443
+ * Retrieve current usage statistics and remaining limits for the authenticated user
444
+ */
445
+ export const getUserUsage = <ThrowOnError extends boolean = false>(options?: Options<GetUserUsageData, ThrowOnError>) => {
446
+ return (options?.client ?? _heyApiClient).get<GetUserUsageResponses, GetUserUsageErrors, ThrowOnError>({
447
+ security: [
448
+ {
449
+ name: 'X-API-Key',
450
+ type: 'apiKey'
451
+ },
452
+ {
453
+ scheme: 'bearer',
454
+ type: 'http'
455
+ }
456
+ ],
457
+ url: '/v1/user/limits/usage',
458
+ ...options
459
+ });
460
+ };
461
+
462
+ /**
463
+ * Get all shared repository limits
464
+ * Get rate limit status for all shared repositories the user has access to.
465
+ */
466
+ export const getAllSharedRepositoryLimits = <ThrowOnError extends boolean = false>(options?: Options<GetAllSharedRepositoryLimitsData, ThrowOnError>) => {
467
+ return (options?.client ?? _heyApiClient).get<GetAllSharedRepositoryLimitsResponses, GetAllSharedRepositoryLimitsErrors, ThrowOnError>({
468
+ security: [
469
+ {
470
+ name: 'X-API-Key',
471
+ type: 'apiKey'
472
+ },
473
+ {
474
+ scheme: 'bearer',
475
+ type: 'http'
476
+ }
477
+ ],
478
+ url: '/v1/user/limits/shared-repositories/summary',
479
+ ...options
480
+ });
481
+ };
482
+
483
+ /**
484
+ * Get shared repository rate limit status
485
+ * Get current rate limit status and usage for a shared repository.
486
+ *
487
+ * Returns:
488
+ * - Current usage across different time windows
489
+ * - Rate limits based on subscription tier
490
+ * - Remaining quota
491
+ * - Reset times
492
+ *
493
+ * Note: All queries are FREE - this only shows rate limit status.
494
+ */
495
+ export const getSharedRepositoryLimits = <ThrowOnError extends boolean = false>(options: Options<GetSharedRepositoryLimitsData, ThrowOnError>) => {
496
+ return (options.client ?? _heyApiClient).get<GetSharedRepositoryLimitsResponses, GetSharedRepositoryLimitsErrors, ThrowOnError>({
497
+ security: [
498
+ {
499
+ name: 'X-API-Key',
500
+ type: 'apiKey'
501
+ },
502
+ {
503
+ scheme: 'bearer',
504
+ type: 'http'
505
+ }
506
+ ],
507
+ url: '/v1/user/limits/shared-repositories/{repository}',
508
+ ...options
509
+ });
510
+ };
511
+
512
+ /**
513
+ * Get User Usage Overview
514
+ * Get a high-level overview of usage statistics for the current user.
515
+ */
516
+ export const getUserUsageOverview = <ThrowOnError extends boolean = false>(options?: Options<GetUserUsageOverviewData, ThrowOnError>) => {
517
+ return (options?.client ?? _heyApiClient).get<GetUserUsageOverviewResponses, GetUserUsageOverviewErrors, ThrowOnError>({
518
+ security: [
519
+ {
520
+ name: 'X-API-Key',
521
+ type: 'apiKey'
522
+ },
523
+ {
524
+ scheme: 'bearer',
525
+ type: 'http'
526
+ }
527
+ ],
528
+ url: '/v1/user/analytics/overview',
529
+ ...options
530
+ });
531
+ };
532
+
533
+ /**
534
+ * Get Detailed User Analytics
535
+ * Get comprehensive analytics for the current user including API usage and recent activity.
536
+ */
537
+ export const getDetailedUserAnalytics = <ThrowOnError extends boolean = false>(options?: Options<GetDetailedUserAnalyticsData, ThrowOnError>) => {
538
+ return (options?.client ?? _heyApiClient).get<GetDetailedUserAnalyticsResponses, GetDetailedUserAnalyticsErrors, ThrowOnError>({
539
+ security: [
540
+ {
541
+ name: 'X-API-Key',
542
+ type: 'apiKey'
543
+ },
544
+ {
545
+ scheme: 'bearer',
546
+ type: 'http'
547
+ }
548
+ ],
549
+ url: '/v1/user/analytics/detailed',
550
+ ...options
551
+ });
552
+ };
553
+
554
+ /**
555
+ * Get User Subscriptions
556
+ * Retrieve user's current shared repository subscriptions with detailed information
557
+ */
558
+ export const getUserSharedSubscriptions = <ThrowOnError extends boolean = false>(options?: Options<GetUserSharedSubscriptionsData, ThrowOnError>) => {
559
+ return (options?.client ?? _heyApiClient).get<GetUserSharedSubscriptionsResponses, GetUserSharedSubscriptionsErrors, ThrowOnError>({
560
+ security: [
561
+ {
562
+ name: 'X-API-Key',
563
+ type: 'apiKey'
564
+ },
565
+ {
566
+ scheme: 'bearer',
567
+ type: 'http'
568
+ }
569
+ ],
570
+ url: '/v1/user/subscriptions/shared-repositories',
571
+ ...options
572
+ });
573
+ };
574
+
575
+ /**
576
+ * Subscribe to Shared Repository
577
+ * Create a new subscription to a shared repository add-on with specified tier
578
+ */
579
+ export const subscribeToSharedRepository = <ThrowOnError extends boolean = false>(options: Options<SubscribeToSharedRepositoryData, ThrowOnError>) => {
580
+ return (options.client ?? _heyApiClient).post<SubscribeToSharedRepositoryResponses, SubscribeToSharedRepositoryErrors, ThrowOnError>({
581
+ security: [
582
+ {
583
+ name: 'X-API-Key',
584
+ type: 'apiKey'
585
+ },
586
+ {
587
+ scheme: 'bearer',
588
+ type: 'http'
589
+ }
590
+ ],
591
+ url: '/v1/user/subscriptions/shared-repositories/subscribe',
592
+ ...options,
593
+ headers: {
594
+ 'Content-Type': 'application/json',
595
+ ...options.headers
596
+ }
597
+ });
598
+ };
599
+
600
+ /**
601
+ * Upgrade Subscription Tier
602
+ * Upgrade a subscription to a higher tier with immediate credit adjustment
603
+ */
604
+ export const upgradeSharedRepositorySubscription = <ThrowOnError extends boolean = false>(options: Options<UpgradeSharedRepositorySubscriptionData, ThrowOnError>) => {
605
+ return (options.client ?? _heyApiClient).put<UpgradeSharedRepositorySubscriptionResponses, UpgradeSharedRepositorySubscriptionErrors, ThrowOnError>({
606
+ security: [
607
+ {
608
+ name: 'X-API-Key',
609
+ type: 'apiKey'
610
+ },
611
+ {
612
+ scheme: 'bearer',
613
+ type: 'http'
614
+ }
615
+ ],
616
+ url: '/v1/user/subscriptions/shared-repositories/{subscription_id}/upgrade',
617
+ ...options,
618
+ headers: {
619
+ 'Content-Type': 'application/json',
620
+ ...options.headers
621
+ }
622
+ });
623
+ };
624
+
625
+ /**
626
+ * Cancel Subscription
627
+ * Cancel a shared repository subscription and disable associated credit pool
628
+ */
629
+ export const cancelSharedRepositorySubscription = <ThrowOnError extends boolean = false>(options: Options<CancelSharedRepositorySubscriptionData, ThrowOnError>) => {
630
+ return (options.client ?? _heyApiClient).delete<CancelSharedRepositorySubscriptionResponses, CancelSharedRepositorySubscriptionErrors, ThrowOnError>({
631
+ security: [
632
+ {
633
+ name: 'X-API-Key',
634
+ type: 'apiKey'
635
+ },
636
+ {
637
+ scheme: 'bearer',
638
+ type: 'http'
639
+ }
640
+ ],
641
+ url: '/v1/user/subscriptions/shared-repositories/{subscription_id}',
642
+ ...options
643
+ });
644
+ };
645
+
646
+ /**
647
+ * Get Credit Balances
648
+ * Retrieve credit balances for all shared repository subscriptions
649
+ */
650
+ export const getSharedRepositoryCredits = <ThrowOnError extends boolean = false>(options?: Options<GetSharedRepositoryCreditsData, ThrowOnError>) => {
651
+ return (options?.client ?? _heyApiClient).get<GetSharedRepositoryCreditsResponses, GetSharedRepositoryCreditsErrors, ThrowOnError>({
652
+ security: [
653
+ {
654
+ name: 'X-API-Key',
655
+ type: 'apiKey'
656
+ },
657
+ {
658
+ scheme: 'bearer',
659
+ type: 'http'
660
+ }
661
+ ],
662
+ url: '/v1/user/subscriptions/shared-repositories/credits',
663
+ ...options
664
+ });
665
+ };
666
+
667
+ /**
668
+ * Get Repository Credits
669
+ * Get credit balance for a specific shared repository
670
+ */
671
+ export const getRepositoryCredits = <ThrowOnError extends boolean = false>(options: Options<GetRepositoryCreditsData, ThrowOnError>) => {
672
+ return (options.client ?? _heyApiClient).get<GetRepositoryCreditsResponses, GetRepositoryCreditsErrors, ThrowOnError>({
673
+ security: [
674
+ {
675
+ name: 'X-API-Key',
676
+ type: 'apiKey'
677
+ },
678
+ {
679
+ scheme: 'bearer',
680
+ type: 'http'
681
+ }
682
+ ],
683
+ url: '/v1/user/subscriptions/shared-repositories/credits/{repository}',
684
+ ...options
685
+ });
686
+ };
687
+
688
+ /**
689
+ * List Connections
690
+ * List all data connections in the graph.
691
+ *
692
+ * Returns active and inactive connections with their current status.
693
+ * Connections can be filtered by:
694
+ * - **Entity**: Show connections for a specific entity
695
+ * - **Provider**: Filter by connection type (sec, quickbooks, plaid)
696
+ *
697
+ * Each connection shows:
698
+ * - Current sync status and health
699
+ * - Last successful sync timestamp
700
+ * - Configuration metadata
701
+ * - Error messages if any
702
+ *
703
+ * No credits are consumed for listing connections.
704
+ */
705
+ export const listConnections = <ThrowOnError extends boolean = false>(options: Options<ListConnectionsData, ThrowOnError>) => {
706
+ return (options.client ?? _heyApiClient).get<ListConnectionsResponses, ListConnectionsErrors, ThrowOnError>({
707
+ security: [
708
+ {
709
+ name: 'X-API-Key',
710
+ type: 'apiKey'
711
+ },
712
+ {
713
+ scheme: 'bearer',
714
+ type: 'http'
715
+ }
716
+ ],
717
+ url: '/v1/{graph_id}/connections',
718
+ ...options
719
+ });
720
+ };
721
+
722
+ /**
723
+ * Create Connection
724
+ * Create a new data connection for external system integration.
725
+ *
726
+ * This endpoint initiates connections to external data sources:
727
+ *
728
+ * **SEC Connections**:
729
+ * - Provide entity CIK for automatic filing retrieval
730
+ * - No authentication needed
731
+ * - Begins immediate data sync
732
+ *
733
+ * **QuickBooks Connections**:
734
+ * - Returns OAuth URL for authorization
735
+ * - Requires admin permissions in QuickBooks
736
+ * - Complete with OAuth callback
737
+ *
738
+ * **Plaid Connections**:
739
+ * - Returns Plaid Link token
740
+ * - User completes bank authentication
741
+ * - Exchange public token for access
742
+ *
743
+ * Note:
744
+ * This operation is FREE - no credit consumption required.
745
+ */
746
+ export const createConnection = <ThrowOnError extends boolean = false>(options: Options<CreateConnectionData, ThrowOnError>) => {
747
+ return (options.client ?? _heyApiClient).post<CreateConnectionResponses, CreateConnectionErrors, ThrowOnError>({
748
+ security: [
749
+ {
750
+ name: 'X-API-Key',
751
+ type: 'apiKey'
752
+ },
753
+ {
754
+ scheme: 'bearer',
755
+ type: 'http'
756
+ }
757
+ ],
758
+ url: '/v1/{graph_id}/connections',
759
+ ...options,
760
+ headers: {
761
+ 'Content-Type': 'application/json',
762
+ ...options.headers
763
+ }
764
+ });
765
+ };
766
+
767
+ /**
768
+ * Delete Connection
769
+ * Delete a data connection and clean up related resources.
770
+ *
771
+ * This operation:
772
+ * - Removes the connection configuration
773
+ * - Preserves any imported data in the graph
774
+ * - Performs provider-specific cleanup
775
+ * - Revokes stored credentials
776
+ *
777
+ * Note:
778
+ * This operation is FREE - no credit consumption required.
779
+ *
780
+ * Only users with admin role can delete connections.
781
+ */
782
+ export const deleteConnection = <ThrowOnError extends boolean = false>(options: Options<DeleteConnectionData, ThrowOnError>) => {
783
+ return (options.client ?? _heyApiClient).delete<DeleteConnectionResponses, DeleteConnectionErrors, ThrowOnError>({
784
+ security: [
785
+ {
786
+ name: 'X-API-Key',
787
+ type: 'apiKey'
788
+ },
789
+ {
790
+ scheme: 'bearer',
791
+ type: 'http'
792
+ }
793
+ ],
794
+ url: '/v1/{graph_id}/connections/{connection_id}',
795
+ ...options
796
+ });
797
+ };
798
+
799
+ /**
800
+ * Get Connection
801
+ * Get detailed information about a specific connection.
802
+ *
803
+ * Returns comprehensive connection details including:
804
+ * - Current status and health indicators
805
+ * - Authentication state
806
+ * - Sync history and statistics
807
+ * - Error details if any
808
+ * - Provider-specific metadata
809
+ *
810
+ * No credits are consumed for viewing connection details.
811
+ */
812
+ export const getConnection = <ThrowOnError extends boolean = false>(options: Options<GetConnectionData, ThrowOnError>) => {
813
+ return (options.client ?? _heyApiClient).get<GetConnectionResponses, GetConnectionErrors, ThrowOnError>({
814
+ security: [
815
+ {
816
+ name: 'X-API-Key',
817
+ type: 'apiKey'
818
+ },
819
+ {
820
+ scheme: 'bearer',
821
+ type: 'http'
822
+ }
823
+ ],
824
+ url: '/v1/{graph_id}/connections/{connection_id}',
825
+ ...options
826
+ });
827
+ };
828
+
829
+ /**
830
+ * List Connection Options
831
+ * Get metadata about all available data connection providers.
832
+ *
833
+ * This endpoint returns comprehensive information about each supported provider:
834
+ *
835
+ * **SEC EDGAR**: Public entity financial filings
836
+ * - No authentication required (public data)
837
+ * - 10-K, 10-Q, 8-K reports with XBRL data
838
+ * - Historical and real-time filing access
839
+ *
840
+ * **QuickBooks Online**: Full accounting system integration
841
+ * - OAuth 2.0 authentication
842
+ * - Chart of accounts, transactions, trial balance
843
+ * - Real-time sync capabilities
844
+ *
845
+ * **Plaid**: Bank account connections
846
+ * - Secure bank authentication via Plaid Link
847
+ * - Transaction history and balances
848
+ * - Multi-account support
849
+ *
850
+ * No credits are consumed for viewing connection options.
851
+ */
852
+ export const getConnectionOptions = <ThrowOnError extends boolean = false>(options: Options<GetConnectionOptionsData, ThrowOnError>) => {
853
+ return (options.client ?? _heyApiClient).get<GetConnectionOptionsResponses, GetConnectionOptionsErrors, ThrowOnError>({
854
+ security: [
855
+ {
856
+ name: 'X-API-Key',
857
+ type: 'apiKey'
858
+ },
859
+ {
860
+ scheme: 'bearer',
861
+ type: 'http'
862
+ }
863
+ ],
864
+ url: '/v1/{graph_id}/connections/options',
865
+ ...options
866
+ });
867
+ };
868
+
869
+ /**
870
+ * Sync Connection
871
+ * Trigger a data synchronization for the connection.
872
+ *
873
+ * Initiates data sync based on provider type:
874
+ *
875
+ * **SEC Sync**:
876
+ * - Downloads latest filings from EDGAR
877
+ * - Parses XBRL data and updates graph
878
+ * - Typically completes in 5-10 minutes
879
+ *
880
+ * **QuickBooks Sync**:
881
+ * - Fetches latest transactions and balances
882
+ * - Updates chart of accounts
883
+ * - Generates fresh trial balance
884
+ * - Duration depends on data volume
885
+ *
886
+ * **Plaid Sync**:
887
+ * - Retrieves recent bank transactions
888
+ * - Updates account balances
889
+ * - Categorizes new transactions
890
+ *
891
+ * Note:
892
+ * This operation is FREE - no credit consumption required.
893
+ *
894
+ * Returns a task ID for monitoring sync progress.
895
+ */
896
+ export const syncConnection = <ThrowOnError extends boolean = false>(options: Options<SyncConnectionData, ThrowOnError>) => {
897
+ return (options.client ?? _heyApiClient).post<SyncConnectionResponses, SyncConnectionErrors, ThrowOnError>({
898
+ security: [
899
+ {
900
+ name: 'X-API-Key',
901
+ type: 'apiKey'
902
+ },
903
+ {
904
+ scheme: 'bearer',
905
+ type: 'http'
906
+ }
907
+ ],
908
+ url: '/v1/{graph_id}/connections/{connection_id}/sync',
909
+ ...options,
910
+ headers: {
911
+ 'Content-Type': 'application/json',
912
+ ...options.headers
913
+ }
914
+ });
915
+ };
916
+
917
+ /**
918
+ * Create Link Token
919
+ * Create a link token for embedded authentication providers.
920
+ *
921
+ * This endpoint generates a temporary token used to initialize embedded authentication UI.
922
+ *
923
+ * Currently supported providers:
924
+ * - **Plaid**: Bank account connections with real-time transaction access
925
+ *
926
+ * The link token:
927
+ * - Expires after 4 hours
928
+ * - Is single-use only
929
+ * - Must be used with the matching frontend SDK
930
+ * - Includes user and entity context
931
+ *
932
+ * No credits are consumed for creating link tokens.
933
+ */
934
+ export const createLinkToken = <ThrowOnError extends boolean = false>(options: Options<CreateLinkTokenData, ThrowOnError>) => {
935
+ return (options.client ?? _heyApiClient).post<CreateLinkTokenResponses, CreateLinkTokenErrors, ThrowOnError>({
936
+ security: [
937
+ {
938
+ name: 'X-API-Key',
939
+ type: 'apiKey'
940
+ },
941
+ {
942
+ scheme: 'bearer',
943
+ type: 'http'
944
+ }
945
+ ],
946
+ url: '/v1/{graph_id}/connections/link/token',
947
+ ...options,
948
+ headers: {
949
+ 'Content-Type': 'application/json',
950
+ ...options.headers
951
+ }
952
+ });
953
+ };
954
+
955
+ /**
956
+ * Exchange Link Token
957
+ * Exchange a public token for permanent access credentials.
958
+ *
959
+ * This completes the embedded authentication flow after user authorization.
960
+ *
961
+ * The exchange process:
962
+ * 1. Validates the temporary public token
963
+ * 2. Exchanges it for permanent access credentials
964
+ * 3. Updates the connection with account information
965
+ * 4. Optionally triggers initial data sync
966
+ *
967
+ * Supported providers:
968
+ * - **Plaid**: Exchanges Plaid Link public token for access token
969
+ *
970
+ * Security:
971
+ * - Public tokens expire after 30 minutes
972
+ * - Each token can only be exchanged once
973
+ * - Full audit trail is maintained
974
+ *
975
+ * No credits are consumed for token exchange.
976
+ */
977
+ export const exchangeLinkToken = <ThrowOnError extends boolean = false>(options: Options<ExchangeLinkTokenData, ThrowOnError>) => {
978
+ return (options.client ?? _heyApiClient).post<ExchangeLinkTokenResponses, ExchangeLinkTokenErrors, ThrowOnError>({
979
+ security: [
980
+ {
981
+ name: 'X-API-Key',
982
+ type: 'apiKey'
983
+ },
984
+ {
985
+ scheme: 'bearer',
986
+ type: 'http'
987
+ }
988
+ ],
989
+ url: '/v1/{graph_id}/connections/link/exchange',
990
+ ...options,
991
+ headers: {
992
+ 'Content-Type': 'application/json',
993
+ ...options.headers
994
+ }
995
+ });
996
+ };
997
+
998
+ /**
999
+ * Init Oauth
1000
+ * Initialize OAuth flow for a connection.
1001
+ *
1002
+ * This generates an authorization URL that the frontend should redirect the user to.
1003
+ * Currently supports: QuickBooks
1004
+ */
1005
+ export const initOAuth = <ThrowOnError extends boolean = false>(options: Options<InitOAuthData, ThrowOnError>) => {
1006
+ return (options.client ?? _heyApiClient).post<InitOAuthResponses, InitOAuthErrors, ThrowOnError>({
1007
+ security: [
1008
+ {
1009
+ name: 'X-API-Key',
1010
+ type: 'apiKey'
1011
+ },
1012
+ {
1013
+ scheme: 'bearer',
1014
+ type: 'http'
1015
+ }
1016
+ ],
1017
+ url: '/v1/{graph_id}/connections/oauth/init',
1018
+ ...options,
1019
+ headers: {
1020
+ 'Content-Type': 'application/json',
1021
+ ...options.headers
1022
+ }
1023
+ });
1024
+ };
1025
+
1026
+ /**
1027
+ * OAuth Callback
1028
+ * Handle OAuth callback from provider after user authorization.
1029
+ *
1030
+ * This endpoint completes the OAuth flow:
1031
+ * 1. Validates the OAuth state parameter
1032
+ * 2. Exchanges authorization code for access tokens
1033
+ * 3. Stores tokens securely
1034
+ * 4. Updates connection status
1035
+ * 5. Optionally triggers initial sync
1036
+ *
1037
+ * Supported providers:
1038
+ * - **QuickBooks**: Accounting data integration
1039
+ *
1040
+ * Security measures:
1041
+ * - State validation prevents CSRF attacks
1042
+ * - User context is verified
1043
+ * - Tokens are encrypted before storage
1044
+ * - Full audit trail is maintained
1045
+ *
1046
+ * No credits are consumed for OAuth callbacks.
1047
+ */
1048
+ export const oauthCallback = <ThrowOnError extends boolean = false>(options: Options<OauthCallbackData, ThrowOnError>) => {
1049
+ return (options.client ?? _heyApiClient).post<OauthCallbackResponses, OauthCallbackErrors, ThrowOnError>({
1050
+ security: [
1051
+ {
1052
+ name: 'X-API-Key',
1053
+ type: 'apiKey'
1054
+ },
1055
+ {
1056
+ scheme: 'bearer',
1057
+ type: 'http'
1058
+ }
1059
+ ],
1060
+ url: '/v1/{graph_id}/connections/oauth/callback/{provider}',
1061
+ ...options,
1062
+ headers: {
1063
+ 'Content-Type': 'application/json',
1064
+ ...options.headers
1065
+ }
1066
+ });
1067
+ };
1068
+
1069
+ /**
1070
+ * Query Financial Agent
1071
+ * AI-powered financial analysis with direct access to graph data.
1072
+ *
1073
+ * This endpoint provides intelligent financial analysis using an AI agent that can:
1074
+ * - Analyze entity financial statements and SEC filings
1075
+ * - Review QuickBooks transactions and accounting data
1076
+ * - Perform multi-period trend analysis
1077
+ * - Generate insights from balance sheets and income statements
1078
+ * - Answer complex financial queries with contextual understanding
1079
+ *
1080
+ * **Execution Modes:**
1081
+ * - **Quick Analysis** (default): Synchronous responses for simple queries (1-2 tool calls)
1082
+ * - **Extended Analysis**: Asynchronous processing for complex research (returns operation_id for SSE monitoring)
1083
+ *
1084
+ * **Extended Analysis Monitoring:**
1085
+ * For complex queries, connect to the SSE stream for real-time progress:
1086
+ * ```javascript
1087
+ * const eventSource = new EventSource('/v1/operations/{operation_id}/stream');
1088
+ * eventSource.onmessage = (event) => {
1089
+ * const data = JSON.parse(event.data);
1090
+ * console.log('Analysis:', data.message);
1091
+ * };
1092
+ * ```
1093
+ *
1094
+ * **SSE Connection Limits:**
1095
+ * - Maximum 5 concurrent SSE connections per user
1096
+ * - Rate limited to 10 new connections per minute
1097
+ * - Automatic circuit breaker for Redis failures
1098
+ * - Graceful degradation with fallback to polling if SSE unavailable
1099
+ *
1100
+ * **Events Emitted:**
1101
+ * - `operation_started`: Analysis begins
1102
+ * - `operation_progress`: Tool calls, analysis steps
1103
+ * - `operation_completed`: Final comprehensive analysis
1104
+ * - `operation_error`: Analysis failed
1105
+ *
1106
+ * **Error Handling:**
1107
+ * - `429 Too Many Requests`: SSE connection limit exceeded
1108
+ * - `503 Service Unavailable`: SSE system temporarily disabled
1109
+ * - Fallback to status polling endpoint if SSE unavailable
1110
+ *
1111
+ * **Credit Consumption:**
1112
+ * - AI operations consume credits based on actual token usage
1113
+ * - Claude 4/4.1 Opus: ~15 credits per 1K input tokens, ~75 credits per 1K output tokens
1114
+ * - Claude 4 Sonnet: ~3 credits per 1K input tokens, ~15 credits per 1K output tokens
1115
+ * - Credits are consumed after operation completes based on actual usage
1116
+ *
1117
+ * The agent automatically determines query complexity or you can force extended analysis.
1118
+ */
1119
+ export const queryFinancialAgent = <ThrowOnError extends boolean = false>(options: Options<QueryFinancialAgentData, ThrowOnError>) => {
1120
+ return (options.client ?? _heyApiClient).post<QueryFinancialAgentResponses, QueryFinancialAgentErrors, ThrowOnError>({
1121
+ security: [
1122
+ {
1123
+ name: 'X-API-Key',
1124
+ type: 'apiKey'
1125
+ },
1126
+ {
1127
+ scheme: 'bearer',
1128
+ type: 'http'
1129
+ }
1130
+ ],
1131
+ url: '/v1/{graph_id}/agent',
1132
+ ...options,
1133
+ headers: {
1134
+ 'Content-Type': 'application/json',
1135
+ ...options.headers
1136
+ }
1137
+ });
1138
+ };
1139
+
1140
+ /**
1141
+ * List MCP Tools
1142
+ * Get available Model Context Protocol tools for graph analysis.
1143
+ *
1144
+ * This endpoint returns a comprehensive list of MCP tools optimized for AI agents:
1145
+ * - Tool schemas with detailed parameter documentation
1146
+ * - Context-aware descriptions based on graph type
1147
+ * - Capability indicators for streaming and progress
1148
+ *
1149
+ * The tool list is customized based on:
1150
+ * - Graph type (shared repository vs user graph)
1151
+ * - User permissions and subscription tier
1152
+ * - Backend capabilities (Kuzu, Neo4j, etc.)
1153
+ *
1154
+ * Credit consumption:
1155
+ * - Listing tools is FREE to encourage exploration
1156
+ * - Tool execution costs vary by operation complexity
1157
+ */
1158
+ export const listMcpTools = <ThrowOnError extends boolean = false>(options: Options<ListMcpToolsData, ThrowOnError>) => {
1159
+ return (options.client ?? _heyApiClient).get<ListMcpToolsResponses, ListMcpToolsErrors, ThrowOnError>({
1160
+ security: [
1161
+ {
1162
+ name: 'X-API-Key',
1163
+ type: 'apiKey'
1164
+ },
1165
+ {
1166
+ scheme: 'bearer',
1167
+ type: 'http'
1168
+ }
1169
+ ],
1170
+ url: '/v1/{graph_id}/mcp/tools',
1171
+ ...options
1172
+ });
1173
+ };
1174
+
1175
+ /**
1176
+ * Execute MCP Tool
1177
+ * Execute an MCP tool with intelligent response optimization.
1178
+ *
1179
+ * This endpoint automatically selects the best execution strategy based on:
1180
+ * - Tool type and estimated complexity
1181
+ * - Client capabilities (AI agent detection)
1182
+ * - System load and queue status
1183
+ * - Graph type (shared repository vs user graph)
1184
+ *
1185
+ * **Response Formats:**
1186
+ * - **JSON**: Direct response for small/fast operations
1187
+ * - **SSE**: Server-Sent Events for progress monitoring
1188
+ * - **NDJSON**: Newline-delimited JSON for streaming
1189
+ * - **Queued**: Asynchronous execution with status monitoring
1190
+ *
1191
+ * **SSE Streaming Support:**
1192
+ * - Maximum 5 concurrent SSE connections per user
1193
+ * - Rate limited to 10 new connections per minute
1194
+ * - Automatic circuit breaker for Redis failures
1195
+ * - Graceful degradation to direct response if SSE unavailable
1196
+ * - Progress events for long-running operations
1197
+ *
1198
+ * **AI Agent Optimization:**
1199
+ * The Node.js MCP client transparently handles all response formats,
1200
+ * presenting a unified interface to AI agents. Streaming responses are
1201
+ * automatically aggregated for seamless consumption.
1202
+ *
1203
+ * **Error Handling:**
1204
+ * - `429 Too Many Requests`: Connection limit or rate limit exceeded
1205
+ * - `503 Service Unavailable`: SSE system temporarily disabled
1206
+ * - `408 Request Timeout`: Tool execution exceeded timeout
1207
+ * - Clients should implement exponential backoff on errors
1208
+ *
1209
+ * **Note:**
1210
+ * MCP tool calls are currently FREE and do not consume credits.
1211
+ */
1212
+ export const callMcpTool = <ThrowOnError extends boolean = false>(options: Options<CallMcpToolData, ThrowOnError>) => {
1213
+ return (options.client ?? _heyApiClient).post<CallMcpToolResponses, CallMcpToolErrors, ThrowOnError>({
1214
+ security: [
1215
+ {
1216
+ name: 'X-API-Key',
1217
+ type: 'apiKey'
1218
+ },
1219
+ {
1220
+ scheme: 'bearer',
1221
+ type: 'http'
1222
+ }
1223
+ ],
1224
+ url: '/v1/{graph_id}/mcp/call-tool',
1225
+ ...options,
1226
+ headers: {
1227
+ 'Content-Type': 'application/json',
1228
+ ...options.headers
1229
+ }
1230
+ });
1231
+ };
1232
+
1233
+ /**
1234
+ * List Kuzu graph backups
1235
+ * List all backups for the specified graph database
1236
+ */
1237
+ export const listBackups = <ThrowOnError extends boolean = false>(options: Options<ListBackupsData, ThrowOnError>) => {
1238
+ return (options.client ?? _heyApiClient).get<ListBackupsResponses, ListBackupsErrors, ThrowOnError>({
1239
+ security: [
1240
+ {
1241
+ name: 'X-API-Key',
1242
+ type: 'apiKey'
1243
+ },
1244
+ {
1245
+ scheme: 'bearer',
1246
+ type: 'http'
1247
+ }
1248
+ ],
1249
+ url: '/v1/{graph_id}/backups',
1250
+ ...options
1251
+ });
1252
+ };
1253
+
1254
+ /**
1255
+ * Create Backup
1256
+ * Create a backup of the graph database.
1257
+ *
1258
+ * Creates a complete backup of the Kuzu database (.kuzu file) with:
1259
+ * - **Format**: Full database backup only (complete .kuzu file)
1260
+ * - **Compression**: Always enabled for optimal storage
1261
+ * - **Encryption**: Optional AES-256 encryption for security
1262
+ * - **Retention**: Configurable retention period (1-2555 days)
1263
+ *
1264
+ * **Backup Features:**
1265
+ * - **Complete Backup**: Full database file backup
1266
+ * - **Consistency**: Point-in-time consistent snapshot
1267
+ * - **Download Support**: Unencrypted backups can be downloaded
1268
+ * - **Restore Support**: Future support for encrypted backup restoration
1269
+ *
1270
+ * **Progress Monitoring:**
1271
+ * Use the returned operation_id to connect to the SSE stream:
1272
+ * ```javascript
1273
+ * const eventSource = new EventSource('/v1/operations/{operation_id}/stream');
1274
+ * eventSource.addEventListener('operation_progress', (event) => {
1275
+ * const data = JSON.parse(event.data);
1276
+ * console.log('Backup progress:', data.progress_percent + '%');
1277
+ * });
1278
+ * ```
1279
+ *
1280
+ * **SSE Connection Limits:**
1281
+ * - Maximum 5 concurrent SSE connections per user
1282
+ * - Rate limited to 10 new connections per minute
1283
+ * - Automatic circuit breaker for Redis failures
1284
+ * - Graceful degradation if event system unavailable
1285
+ *
1286
+ * **Important Notes:**
1287
+ * - Only full_dump format is supported (no CSV/JSON exports)
1288
+ * - Compression is always enabled
1289
+ * - Encrypted backups cannot be downloaded (security measure)
1290
+ * - All backups are stored securely in cloud storage
1291
+ *
1292
+ * **Credit Consumption:**
1293
+ * - Base cost: 25.0 credits
1294
+ * - Large databases (>10GB): 50.0 credits
1295
+ * - Multiplied by graph tier
1296
+ *
1297
+ * Returns operation details for SSE monitoring.
1298
+ */
1299
+ export const createBackup = <ThrowOnError extends boolean = false>(options: Options<CreateBackupData, ThrowOnError>) => {
1300
+ return (options.client ?? _heyApiClient).post<CreateBackupResponses, CreateBackupErrors, ThrowOnError>({
1301
+ security: [
1302
+ {
1303
+ name: 'X-API-Key',
1304
+ type: 'apiKey'
1305
+ },
1306
+ {
1307
+ scheme: 'bearer',
1308
+ type: 'http'
1309
+ }
1310
+ ],
1311
+ url: '/v1/{graph_id}/backups',
1312
+ ...options,
1313
+ headers: {
1314
+ 'Content-Type': 'application/json',
1315
+ ...options.headers
1316
+ }
1317
+ });
1318
+ };
1319
+
1320
+ /**
1321
+ * Export Kuzu backup for download
1322
+ * Export a backup file for download (only available for non-encrypted, compressed .kuzu backups)
1323
+ */
1324
+ export const exportBackup = <ThrowOnError extends boolean = false>(options: Options<ExportBackupData, ThrowOnError>) => {
1325
+ return (options.client ?? _heyApiClient).post<ExportBackupResponses, ExportBackupErrors, ThrowOnError>({
1326
+ security: [
1327
+ {
1328
+ name: 'X-API-Key',
1329
+ type: 'apiKey'
1330
+ },
1331
+ {
1332
+ scheme: 'bearer',
1333
+ type: 'http'
1334
+ }
1335
+ ],
1336
+ url: '/v1/{graph_id}/backups/{backup_id}/export',
1337
+ ...options
1338
+ });
1339
+ };
1340
+
1341
+ /**
1342
+ * Get temporary download URL for backup
1343
+ * Generate a temporary download URL for a backup (unencrypted, compressed .kuzu files only)
1344
+ */
1345
+ export const getBackupDownloadUrl = <ThrowOnError extends boolean = false>(options: Options<GetBackupDownloadUrlData, ThrowOnError>) => {
1346
+ return (options.client ?? _heyApiClient).get<GetBackupDownloadUrlResponses, GetBackupDownloadUrlErrors, ThrowOnError>({
1347
+ security: [
1348
+ {
1349
+ name: 'X-API-Key',
1350
+ type: 'apiKey'
1351
+ },
1352
+ {
1353
+ scheme: 'bearer',
1354
+ type: 'http'
1355
+ }
1356
+ ],
1357
+ url: '/v1/{graph_id}/backups/{backup_id}/download',
1358
+ ...options
1359
+ });
1360
+ };
1361
+
1362
+ /**
1363
+ * Restore Encrypted Backup
1364
+ * Restore a graph database from an encrypted backup.
1365
+ *
1366
+ * Restores a complete Kuzu database from an encrypted backup:
1367
+ * - **Format**: Only full_dump backups can be restored
1368
+ * - **Encryption**: Only encrypted backups can be restored (security requirement)
1369
+ * - **System Backup**: Creates automatic backup of existing database before restore
1370
+ * - **Verification**: Optionally verifies database integrity after restore
1371
+ *
1372
+ * **Restore Features:**
1373
+ * - **Atomic Operation**: Complete replacement of database
1374
+ * - **Rollback Protection**: System backup created before restore
1375
+ * - **Data Integrity**: Verification ensures successful restore
1376
+ * - **Security**: Only encrypted backups to prevent data tampering
1377
+ *
1378
+ * **Progress Monitoring:**
1379
+ * Use the returned operation_id to connect to the SSE stream:
1380
+ * ```javascript
1381
+ * const eventSource = new EventSource('/v1/operations/{operation_id}/stream');
1382
+ * eventSource.addEventListener('operation_progress', (event) => {
1383
+ * const data = JSON.parse(event.data);
1384
+ * console.log('Restore progress:', data.message);
1385
+ * });
1386
+ * ```
1387
+ *
1388
+ * **SSE Connection Limits:**
1389
+ * - Maximum 5 concurrent SSE connections per user
1390
+ * - Rate limited to 10 new connections per minute
1391
+ * - Automatic circuit breaker for Redis failures
1392
+ * - Graceful degradation if event system unavailable
1393
+ *
1394
+ * **Important Notes:**
1395
+ * - Only encrypted backups can be restored (security measure)
1396
+ * - Existing database is backed up to S3 before restore
1397
+ * - Restore is a destructive operation - existing data is replaced
1398
+ * - System backups are stored separately for recovery
1399
+ *
1400
+ * **Credit Consumption:**
1401
+ * - Base cost: 100.0 credits
1402
+ * - Large databases (>10GB): 200.0 credits
1403
+ * - Multiplied by graph tier
1404
+ *
1405
+ * Returns operation details for SSE monitoring.
1406
+ */
1407
+ export const restoreBackup = <ThrowOnError extends boolean = false>(options: Options<RestoreBackupData, ThrowOnError>) => {
1408
+ return (options.client ?? _heyApiClient).post<RestoreBackupResponses, RestoreBackupErrors, ThrowOnError>({
1409
+ security: [
1410
+ {
1411
+ name: 'X-API-Key',
1412
+ type: 'apiKey'
1413
+ },
1414
+ {
1415
+ scheme: 'bearer',
1416
+ type: 'http'
1417
+ }
1418
+ ],
1419
+ url: '/v1/{graph_id}/backups/restore',
1420
+ ...options,
1421
+ headers: {
1422
+ 'Content-Type': 'application/json',
1423
+ ...options.headers
1424
+ }
1425
+ });
1426
+ };
1427
+
1428
+ /**
1429
+ * Get backup statistics
1430
+ * Get comprehensive backup statistics for the specified graph database
1431
+ */
1432
+ export const getBackupStats = <ThrowOnError extends boolean = false>(options: Options<GetBackupStatsData, ThrowOnError>) => {
1433
+ return (options.client ?? _heyApiClient).get<GetBackupStatsResponses, GetBackupStatsErrors, ThrowOnError>({
1434
+ security: [
1435
+ {
1436
+ name: 'X-API-Key',
1437
+ type: 'apiKey'
1438
+ },
1439
+ {
1440
+ scheme: 'bearer',
1441
+ type: 'http'
1442
+ }
1443
+ ],
1444
+ url: '/v1/{graph_id}/backups/stats',
1445
+ ...options
1446
+ });
1447
+ };
1448
+
1449
+ /**
1450
+ * Get Graph Metrics
1451
+ * Get comprehensive metrics for the graph database.
1452
+ *
1453
+ * Provides detailed analytics including:
1454
+ * - **Node Statistics**: Counts by type (Entity, Report, Account, Transaction)
1455
+ * - **Relationship Metrics**: Connection counts and patterns
1456
+ * - **Data Quality**: Completeness scores and validation results
1457
+ * - **Performance Metrics**: Query response times and database health
1458
+ * - **Storage Analytics**: Database size and growth trends
1459
+ *
1460
+ * This data helps with:
1461
+ * - Monitoring data completeness
1462
+ * - Identifying data quality issues
1463
+ * - Capacity planning
1464
+ * - Performance optimization
1465
+ *
1466
+ * Note:
1467
+ * This operation is FREE - no credit consumption required.
1468
+ */
1469
+ export const getGraphMetrics = <ThrowOnError extends boolean = false>(options: Options<GetGraphMetricsData, ThrowOnError>) => {
1470
+ return (options.client ?? _heyApiClient).get<GetGraphMetricsResponses, GetGraphMetricsErrors, ThrowOnError>({
1471
+ security: [
1472
+ {
1473
+ name: 'X-API-Key',
1474
+ type: 'apiKey'
1475
+ },
1476
+ {
1477
+ scheme: 'bearer',
1478
+ type: 'http'
1479
+ }
1480
+ ],
1481
+ url: '/v1/{graph_id}/analytics',
1482
+ ...options
1483
+ });
1484
+ };
1485
+
1486
+ /**
1487
+ * Get Usage Statistics
1488
+ * Get detailed usage statistics for the graph.
1489
+ *
1490
+ * Provides temporal usage patterns including:
1491
+ * - **Query Volume**: API calls per day/hour
1492
+ * - **Credit Consumption**: Usage patterns and trends
1493
+ * - **Operation Breakdown**: Usage by operation type
1494
+ * - **User Activity**: Access patterns by user role
1495
+ * - **Peak Usage Times**: Identify high-activity periods
1496
+ *
1497
+ * Time ranges available:
1498
+ * - Last 24 hours (hourly breakdown)
1499
+ * - Last 7 days (daily breakdown)
1500
+ * - Last 30 days (daily breakdown)
1501
+ * - Custom date ranges
1502
+ *
1503
+ * Useful for:
1504
+ * - Capacity planning
1505
+ * - Cost optimization
1506
+ * - Usage trend analysis
1507
+ * - Performance tuning
1508
+ *
1509
+ * Note:
1510
+ * This operation is FREE - no credit consumption required.
1511
+ */
1512
+ export const getGraphUsageStats = <ThrowOnError extends boolean = false>(options: Options<GetGraphUsageStatsData, ThrowOnError>) => {
1513
+ return (options.client ?? _heyApiClient).get<GetGraphUsageStatsResponses, GetGraphUsageStatsErrors, ThrowOnError>({
1514
+ security: [
1515
+ {
1516
+ name: 'X-API-Key',
1517
+ type: 'apiKey'
1518
+ },
1519
+ {
1520
+ scheme: 'bearer',
1521
+ type: 'http'
1522
+ }
1523
+ ],
1524
+ url: '/v1/{graph_id}/analytics/usage',
1525
+ ...options
1526
+ });
1527
+ };
1528
+
1529
+ /**
1530
+ * Execute Cypher Query
1531
+ * Execute a Cypher query with intelligent response optimization.
1532
+ *
1533
+ * This endpoint automatically selects the best execution strategy based on:
1534
+ * - Query characteristics (size, complexity)
1535
+ * - Client capabilities (SSE, NDJSON, JSON)
1536
+ * - System load (queue status, concurrent queries)
1537
+ * - User preferences (mode parameter, headers)
1538
+ *
1539
+ * **Response Modes:**
1540
+ * - `auto` (default): Intelligent automatic selection
1541
+ * - `sync`: Force synchronous JSON response (best for testing)
1542
+ * - `async`: Force queued response with SSE monitoring endpoints (no polling needed)
1543
+ * - `stream`: Force streaming response (SSE or NDJSON)
1544
+ *
1545
+ * **Client Detection:**
1546
+ * - Automatically detects testing tools (Postman, Swagger UI)
1547
+ * - Adjusts behavior for better interactive experience
1548
+ * - Respects Accept and Prefer headers for capabilities
1549
+ *
1550
+ * **Streaming Support (SSE):**
1551
+ * - Real-time events with progress updates
1552
+ * - Maximum 5 concurrent SSE connections per user
1553
+ * - Rate limited to 10 new connections per minute
1554
+ * - Automatic circuit breaker for Redis failures
1555
+ * - Graceful degradation if event system unavailable
1556
+ * - 30-second keepalive to prevent timeouts
1557
+ *
1558
+ * **Streaming Support (NDJSON):**
1559
+ * - Efficient line-delimited JSON for large results
1560
+ * - Automatic chunking (configurable 10-10000 rows)
1561
+ * - No connection limits (stateless streaming)
1562
+ *
1563
+ * **Queue Management:**
1564
+ * - Automatic queuing under high load
1565
+ * - Real-time monitoring via SSE events (no polling needed)
1566
+ * - Priority based on subscription tier
1567
+ * - Queue position and progress updates pushed via SSE
1568
+ * - Connect to returned `/v1/operations/{id}/stream` endpoint for updates
1569
+ *
1570
+ * **Error Handling:**
1571
+ * - `429 Too Many Requests`: Rate limit or connection limit exceeded
1572
+ * - `503 Service Unavailable`: Circuit breaker open or SSE disabled
1573
+ * - Clients should implement exponential backoff
1574
+ *
1575
+ * **Note:**
1576
+ * Query operations are FREE - no credit consumption required.
1577
+ * Queue position is based on subscription tier for priority.
1578
+ */
1579
+ export const executeCypherQuery = <ThrowOnError extends boolean = false>(options: Options<ExecuteCypherQueryData, ThrowOnError>) => {
1580
+ return (options.client ?? _heyApiClient).post<ExecuteCypherQueryResponses, ExecuteCypherQueryErrors, ThrowOnError>({
1581
+ security: [
1582
+ {
1583
+ name: 'X-API-Key',
1584
+ type: 'apiKey'
1585
+ },
1586
+ {
1587
+ scheme: 'bearer',
1588
+ type: 'http'
1589
+ }
1590
+ ],
1591
+ url: '/v1/{graph_id}/query',
1592
+ ...options,
1593
+ headers: {
1594
+ 'Content-Type': 'application/json',
1595
+ ...options.headers
1596
+ }
1597
+ });
1598
+ };
1599
+
1600
+ /**
1601
+ * Get Runtime Graph Schema Information
1602
+ * Get runtime schema information for the specified graph database.
1603
+ *
1604
+ * This endpoint inspects the actual graph database structure and returns:
1605
+ * - **Node Labels**: All node types currently in the database
1606
+ * - **Relationship Types**: All relationship types currently in the database
1607
+ * - **Node Properties**: Properties for each node type (limited to first 10 for performance)
1608
+ *
1609
+ * This is different from custom schema management - it shows what actually exists in the database,
1610
+ * useful for understanding the current graph structure before writing queries.
1611
+ *
1612
+ * This operation is FREE - no credit consumption required.
1613
+ */
1614
+ export const getGraphSchemaInfo = <ThrowOnError extends boolean = false>(options: Options<GetGraphSchemaInfoData, ThrowOnError>) => {
1615
+ return (options.client ?? _heyApiClient).get<GetGraphSchemaInfoResponses, GetGraphSchemaInfoErrors, ThrowOnError>({
1616
+ security: [
1617
+ {
1618
+ name: 'X-API-Key',
1619
+ type: 'apiKey'
1620
+ },
1621
+ {
1622
+ scheme: 'bearer',
1623
+ type: 'http'
1624
+ }
1625
+ ],
1626
+ url: '/v1/{graph_id}/schema/info',
1627
+ ...options
1628
+ });
1629
+ };
1630
+
1631
+ /**
1632
+ * Validate Schema
1633
+ * Validate a custom schema definition before deployment.
1634
+ *
1635
+ * This endpoint performs comprehensive validation including:
1636
+ * - **Structure Validation**: Ensures proper JSON/YAML format
1637
+ * - **Type Checking**: Validates data types (STRING, INT, DOUBLE, etc.)
1638
+ * - **Constraint Verification**: Checks primary keys and unique constraints
1639
+ * - **Relationship Integrity**: Validates node references in relationships
1640
+ * - **Naming Conventions**: Ensures valid identifiers
1641
+ * - **Compatibility**: Checks against existing extensions if specified
1642
+ *
1643
+ * Supported formats:
1644
+ * - JSON schema definitions
1645
+ * - YAML schema definitions
1646
+ * - Direct dictionary format
1647
+ *
1648
+ * Validation helps prevent:
1649
+ * - Schema deployment failures
1650
+ * - Data integrity issues
1651
+ * - Performance problems
1652
+ * - Naming conflicts
1653
+ *
1654
+ * This operation is FREE - no credit consumption required.
1655
+ */
1656
+ export const validateSchema = <ThrowOnError extends boolean = false>(options: Options<ValidateSchemaData, ThrowOnError>) => {
1657
+ return (options.client ?? _heyApiClient).post<ValidateSchemaResponses, ValidateSchemaErrors, ThrowOnError>({
1658
+ security: [
1659
+ {
1660
+ name: 'X-API-Key',
1661
+ type: 'apiKey'
1662
+ },
1663
+ {
1664
+ scheme: 'bearer',
1665
+ type: 'http'
1666
+ }
1667
+ ],
1668
+ url: '/v1/{graph_id}/schema/validate',
1669
+ ...options,
1670
+ headers: {
1671
+ 'Content-Type': 'application/json',
1672
+ ...options.headers
1673
+ }
1674
+ });
1675
+ };
1676
+
1677
+ /**
1678
+ * Export Graph Schema
1679
+ * Export the schema of an existing graph in JSON, YAML, or Cypher format
1680
+ */
1681
+ export const exportGraphSchema = <ThrowOnError extends boolean = false>(options: Options<ExportGraphSchemaData, ThrowOnError>) => {
1682
+ return (options.client ?? _heyApiClient).get<ExportGraphSchemaResponses, ExportGraphSchemaErrors, ThrowOnError>({
1683
+ security: [
1684
+ {
1685
+ name: 'X-API-Key',
1686
+ type: 'apiKey'
1687
+ },
1688
+ {
1689
+ scheme: 'bearer',
1690
+ type: 'http'
1691
+ }
1692
+ ],
1693
+ url: '/v1/{graph_id}/schema/export',
1694
+ ...options
1695
+ });
1696
+ };
1697
+
1698
+ /**
1699
+ * List Available Schema Extensions
1700
+ * Get list of available schema extensions and compatibility groups
1701
+ */
1702
+ export const listSchemaExtensions = <ThrowOnError extends boolean = false>(options: Options<ListSchemaExtensionsData, ThrowOnError>) => {
1703
+ return (options.client ?? _heyApiClient).get<ListSchemaExtensionsResponses, ListSchemaExtensionsErrors, ThrowOnError>({
1704
+ security: [
1705
+ {
1706
+ name: 'X-API-Key',
1707
+ type: 'apiKey'
1708
+ },
1709
+ {
1710
+ scheme: 'bearer',
1711
+ type: 'http'
1712
+ }
1713
+ ],
1714
+ url: '/v1/{graph_id}/schema/extensions',
1715
+ ...options
1716
+ });
1717
+ };
1718
+
1719
+ /**
1720
+ * Get Current Bill
1721
+ * Get current month's billing details for the graph.
1722
+ *
1723
+ * Returns comprehensive billing information including:
1724
+ * - **Credit Usage**: Consumed vs. allocated credits
1725
+ * - **Storage Charges**: Current storage usage and costs
1726
+ * - **Subscription Tier**: Current plan and features
1727
+ * - **Pro-rated Charges**: If plan changed mid-month
1728
+ * - **Estimated Total**: Current charges to date
1729
+ *
1730
+ * Billing calculations are updated hourly. Storage is measured in GB-months.
1731
+ *
1732
+ * ℹ️ No credits are consumed for viewing billing information.
1733
+ */
1734
+ export const getCurrentGraphBill = <ThrowOnError extends boolean = false>(options: Options<GetCurrentGraphBillData, ThrowOnError>) => {
1735
+ return (options.client ?? _heyApiClient).get<GetCurrentGraphBillResponses, GetCurrentGraphBillErrors, ThrowOnError>({
1736
+ security: [
1737
+ {
1738
+ name: 'X-API-Key',
1739
+ type: 'apiKey'
1740
+ },
1741
+ {
1742
+ scheme: 'bearer',
1743
+ type: 'http'
1744
+ }
1745
+ ],
1746
+ url: '/v1/{graph_id}/billing/current',
1747
+ ...options
1748
+ });
1749
+ };
1750
+
1751
+ /**
1752
+ * Get Usage Details
1753
+ * Get detailed usage metrics for the graph.
1754
+ *
1755
+ * Provides granular usage information including:
1756
+ * - **Daily Credit Consumption**: Track credit usage patterns
1757
+ * - **Storage Growth**: Monitor database size over time
1758
+ * - **Operation Breakdown**: Credits by operation type
1759
+ * - **Peak Usage Times**: Identify high-activity periods
1760
+ * - **API Call Volumes**: Request counts and patterns
1761
+ *
1762
+ * Useful for:
1763
+ * - Optimizing credit consumption
1764
+ * - Capacity planning
1765
+ * - Usage trend analysis
1766
+ * - Cost optimization
1767
+ *
1768
+ * ℹ️ No credits are consumed for viewing usage details.
1769
+ */
1770
+ export const getGraphUsageDetails = <ThrowOnError extends boolean = false>(options: Options<GetGraphUsageDetailsData, ThrowOnError>) => {
1771
+ return (options.client ?? _heyApiClient).get<GetGraphUsageDetailsResponses, GetGraphUsageDetailsErrors, ThrowOnError>({
1772
+ security: [
1773
+ {
1774
+ name: 'X-API-Key',
1775
+ type: 'apiKey'
1776
+ },
1777
+ {
1778
+ scheme: 'bearer',
1779
+ type: 'http'
1780
+ }
1781
+ ],
1782
+ url: '/v1/{graph_id}/billing/usage',
1783
+ ...options
1784
+ });
1785
+ };
1786
+
1787
+ /**
1788
+ * Get Billing History
1789
+ * Get billing history for the graph.
1790
+ *
1791
+ * Returns a chronological list of monthly bills, perfect for:
1792
+ * - Tracking spending trends over time
1793
+ * - Identifying usage patterns
1794
+ * - Budget forecasting
1795
+ * - Financial reporting
1796
+ *
1797
+ * Each month includes:
1798
+ * - Credit usage and overages
1799
+ * - Storage charges
1800
+ * - Total charges
1801
+ * - Usage metrics
1802
+ *
1803
+ * ℹ️ No credits are consumed for viewing billing history.
1804
+ */
1805
+ export const getGraphBillingHistory = <ThrowOnError extends boolean = false>(options: Options<GetGraphBillingHistoryData, ThrowOnError>) => {
1806
+ return (options.client ?? _heyApiClient).get<GetGraphBillingHistoryResponses, GetGraphBillingHistoryErrors, ThrowOnError>({
1807
+ security: [
1808
+ {
1809
+ name: 'X-API-Key',
1810
+ type: 'apiKey'
1811
+ },
1812
+ {
1813
+ scheme: 'bearer',
1814
+ type: 'http'
1815
+ }
1816
+ ],
1817
+ url: '/v1/{graph_id}/billing/history',
1818
+ ...options
1819
+ });
1820
+ };
1821
+
1822
+ /**
1823
+ * Get Monthly Bill
1824
+ * Get billing details for a specific month.
1825
+ *
1826
+ * Retrieve historical billing information for any previous month.
1827
+ * Useful for:
1828
+ * - Reconciling past charges
1829
+ * - Tracking usage trends
1830
+ * - Expense reporting
1831
+ * - Budget analysis
1832
+ *
1833
+ * Returns the same detailed breakdown as the current bill endpoint.
1834
+ *
1835
+ * ℹ️ No credits are consumed for viewing billing history.
1836
+ */
1837
+ export const getGraphMonthlyBill = <ThrowOnError extends boolean = false>(options: Options<GetGraphMonthlyBillData, ThrowOnError>) => {
1838
+ return (options.client ?? _heyApiClient).get<GetGraphMonthlyBillResponses, GetGraphMonthlyBillErrors, ThrowOnError>({
1839
+ security: [
1840
+ {
1841
+ name: 'X-API-Key',
1842
+ type: 'apiKey'
1843
+ },
1844
+ {
1845
+ scheme: 'bearer',
1846
+ type: 'http'
1847
+ }
1848
+ ],
1849
+ url: '/v1/{graph_id}/billing/history/{year}/{month}',
1850
+ ...options
1851
+ });
1852
+ };
1853
+
1854
+ /**
1855
+ * Get Credit Summary
1856
+ * Retrieve comprehensive credit usage summary for the specified graph.
1857
+ *
1858
+ * This endpoint provides:
1859
+ * - Current credit balance and monthly allocation
1860
+ * - Credit consumption metrics for the current month
1861
+ * - Graph tier and credit multiplier information
1862
+ * - Usage percentage to help monitor credit consumption
1863
+ *
1864
+ * No credits are consumed for checking credit status.
1865
+ */
1866
+ export const getCreditSummary = <ThrowOnError extends boolean = false>(options: Options<GetCreditSummaryData, ThrowOnError>) => {
1867
+ return (options.client ?? _heyApiClient).get<GetCreditSummaryResponses, GetCreditSummaryErrors, ThrowOnError>({
1868
+ security: [
1869
+ {
1870
+ name: 'X-API-Key',
1871
+ type: 'apiKey'
1872
+ },
1873
+ {
1874
+ scheme: 'bearer',
1875
+ type: 'http'
1876
+ }
1877
+ ],
1878
+ url: '/v1/{graph_id}/credits/summary',
1879
+ ...options
1880
+ });
1881
+ };
1882
+
1883
+ /**
1884
+ * List Credit Transactions
1885
+ * Retrieve detailed credit transaction history for the specified graph.
1886
+ *
1887
+ * This enhanced endpoint provides:
1888
+ * - Detailed transaction records with idempotency information
1889
+ * - Summary by operation type to identify high-consumption operations
1890
+ * - Date range filtering for analysis
1891
+ * - Metadata search capabilities
1892
+ *
1893
+ * Transaction types include:
1894
+ * - ALLOCATION: Monthly credit allocations
1895
+ * - CONSUMPTION: Credit usage for operations
1896
+ * - BONUS: Bonus credits added by admins
1897
+ * - REFUND: Credit refunds
1898
+ *
1899
+ * No credits are consumed for viewing transaction history.
1900
+ */
1901
+ export const listCreditTransactions = <ThrowOnError extends boolean = false>(options: Options<ListCreditTransactionsData, ThrowOnError>) => {
1902
+ return (options.client ?? _heyApiClient).get<ListCreditTransactionsResponses, ListCreditTransactionsErrors, ThrowOnError>({
1903
+ security: [
1904
+ {
1905
+ name: 'X-API-Key',
1906
+ type: 'apiKey'
1907
+ },
1908
+ {
1909
+ scheme: 'bearer',
1910
+ type: 'http'
1911
+ }
1912
+ ],
1913
+ url: '/v1/{graph_id}/credits/transactions',
1914
+ ...options
1915
+ });
1916
+ };
1917
+
1918
+ /**
1919
+ * Check Credit Balance
1920
+ * Check if the graph has sufficient credits for a planned operation.
1921
+ *
1922
+ * This endpoint allows you to verify credit availability before performing
1923
+ * an operation, helping prevent failed operations due to insufficient credits.
1924
+ *
1925
+ * The check considers:
1926
+ * - Base operation cost
1927
+ * - Graph tier multiplier
1928
+ * - Current credit balance
1929
+ *
1930
+ * No credits are consumed for checking availability.
1931
+ */
1932
+ export const checkCreditBalance = <ThrowOnError extends boolean = false>(options: Options<CheckCreditBalanceData, ThrowOnError>) => {
1933
+ return (options.client ?? _heyApiClient).get<CheckCreditBalanceResponses, CheckCreditBalanceErrors, ThrowOnError>({
1934
+ security: [
1935
+ {
1936
+ name: 'X-API-Key',
1937
+ type: 'apiKey'
1938
+ },
1939
+ {
1940
+ scheme: 'bearer',
1941
+ type: 'http'
1942
+ }
1943
+ ],
1944
+ url: '/v1/{graph_id}/credits/balance/check',
1945
+ ...options
1946
+ });
1947
+ };
1948
+
1949
+ /**
1950
+ * Get Storage Usage
1951
+ * Get storage usage history for a graph.
1952
+ *
1953
+ * Returns detailed storage usage information including:
1954
+ * - Daily average storage consumption
1955
+ * - Storage trends over time
1956
+ * - Credit costs for storage
1957
+ * - Current storage billing information
1958
+ *
1959
+ * This endpoint helps users understand their storage patterns
1960
+ * and associated credit costs.
1961
+ */
1962
+ export const getStorageUsage = <ThrowOnError extends boolean = false>(options: Options<GetStorageUsageData, ThrowOnError>) => {
1963
+ return (options.client ?? _heyApiClient).get<GetStorageUsageResponses, GetStorageUsageErrors, ThrowOnError>({
1964
+ security: [
1965
+ {
1966
+ name: 'X-API-Key',
1967
+ type: 'apiKey'
1968
+ },
1969
+ {
1970
+ scheme: 'bearer',
1971
+ type: 'http'
1972
+ }
1973
+ ],
1974
+ url: '/v1/{graph_id}/credits/storage/usage',
1975
+ ...options
1976
+ });
1977
+ };
1978
+
1979
+ /**
1980
+ * Check Storage Limits
1981
+ * Check storage limits and usage for a graph.
1982
+ *
1983
+ * Returns comprehensive storage limit information including:
1984
+ * - Current storage usage
1985
+ * - Effective limit (override or default)
1986
+ * - Usage percentage and warnings
1987
+ * - Recommendations for limit management
1988
+ *
1989
+ * This endpoint helps users monitor storage usage and plan for potential
1990
+ * limit increases. No credits are consumed for checking storage limits.
1991
+ */
1992
+ export const checkStorageLimits = <ThrowOnError extends boolean = false>(options: Options<CheckStorageLimitsData, ThrowOnError>) => {
1993
+ return (options.client ?? _heyApiClient).get<CheckStorageLimitsResponses, CheckStorageLimitsErrors, ThrowOnError>({
1994
+ security: [
1995
+ {
1996
+ name: 'X-API-Key',
1997
+ type: 'apiKey'
1998
+ },
1999
+ {
2000
+ scheme: 'bearer',
2001
+ type: 'http'
2002
+ }
2003
+ ],
2004
+ url: '/v1/{graph_id}/credits/storage/limits',
2005
+ ...options
2006
+ });
2007
+ };
2008
+
2009
+ /**
2010
+ * Database Health Check
2011
+ * Get comprehensive health information for the graph database.
2012
+ *
2013
+ * Returns detailed health metrics including:
2014
+ * - **Connection Status**: Database connectivity and responsiveness
2015
+ * - **Performance Metrics**: Query execution times and throughput
2016
+ * - **Resource Usage**: Memory and storage utilization
2017
+ * - **Error Monitoring**: Recent error rates and patterns
2018
+ * - **Uptime Statistics**: Service availability metrics
2019
+ *
2020
+ * Health indicators:
2021
+ * - **Status**: healthy, degraded, or unhealthy
2022
+ * - **Query Performance**: Average execution times
2023
+ * - **Error Rates**: Recent failure percentages
2024
+ * - **Resource Usage**: Memory and storage consumption
2025
+ * - **Alerts**: Active warnings or issues
2026
+ *
2027
+ * This endpoint provides essential monitoring data for operational visibility.
2028
+ */
2029
+ export const getDatabaseHealth = <ThrowOnError extends boolean = false>(options: Options<GetDatabaseHealthData, ThrowOnError>) => {
2030
+ return (options.client ?? _heyApiClient).get<GetDatabaseHealthResponses, GetDatabaseHealthErrors, ThrowOnError>({
2031
+ security: [
2032
+ {
2033
+ name: 'X-API-Key',
2034
+ type: 'apiKey'
2035
+ },
2036
+ {
2037
+ scheme: 'bearer',
2038
+ type: 'http'
2039
+ }
2040
+ ],
2041
+ url: '/v1/{graph_id}/health',
2042
+ ...options
2043
+ });
2044
+ };
2045
+
2046
+ /**
2047
+ * Database Information
2048
+ * Get comprehensive database information and statistics.
2049
+ *
2050
+ * Returns detailed database metrics including:
2051
+ * - **Database Metadata**: Name, path, size, and timestamps
2052
+ * - **Schema Information**: Node labels, relationship types, and counts
2053
+ * - **Storage Statistics**: Database size and usage metrics
2054
+ * - **Data Composition**: Node and relationship counts
2055
+ * - **Backup Information**: Available backups and last backup date
2056
+ * - **Configuration**: Read-only status and schema version
2057
+ *
2058
+ * Database statistics:
2059
+ * - **Size**: Storage usage in bytes and MB
2060
+ * - **Content**: Node and relationship counts
2061
+ * - **Schema**: Available labels and relationship types
2062
+ * - **Backup Status**: Backup availability and recency
2063
+ * - **Timestamps**: Creation and modification dates
2064
+ *
2065
+ * This endpoint provides essential database information for capacity planning and monitoring.
2066
+ */
2067
+ export const getDatabaseInfo = <ThrowOnError extends boolean = false>(options: Options<GetDatabaseInfoData, ThrowOnError>) => {
2068
+ return (options.client ?? _heyApiClient).get<GetDatabaseInfoResponses, GetDatabaseInfoErrors, ThrowOnError>({
2069
+ security: [
2070
+ {
2071
+ name: 'X-API-Key',
2072
+ type: 'apiKey'
2073
+ },
2074
+ {
2075
+ scheme: 'bearer',
2076
+ type: 'http'
2077
+ }
2078
+ ],
2079
+ url: '/v1/{graph_id}/info',
2080
+ ...options
2081
+ });
2082
+ };
2083
+
2084
+ /**
2085
+ * Get Graph Operational Limits
2086
+ * Get comprehensive operational limits for the graph database.
2087
+ *
2088
+ * Returns all operational limits that apply to this graph including:
2089
+ * - **Storage Limits**: Maximum storage size and current usage
2090
+ * - **Query Limits**: Timeouts, complexity, row limits
2091
+ * - **Copy/Ingestion Limits**: File sizes, timeouts, concurrent operations
2092
+ * - **Backup Limits**: Frequency, retention, size limits
2093
+ * - **Rate Limits**: Requests per minute/hour based on tier
2094
+ * - **Credit Limits**: AI operation credits (if applicable)
2095
+ *
2096
+ * This unified endpoint provides all limits in one place for easier client integration.
2097
+ *
2098
+ * **Note**: Limits vary based on subscription tier (Standard, Enterprise, Premium).
2099
+ */
2100
+ export const getGraphLimits = <ThrowOnError extends boolean = false>(options: Options<GetGraphLimitsData, ThrowOnError>) => {
2101
+ return (options.client ?? _heyApiClient).get<GetGraphLimitsResponses, GetGraphLimitsErrors, ThrowOnError>({
2102
+ security: [
2103
+ {
2104
+ name: 'X-API-Key',
2105
+ type: 'apiKey'
2106
+ },
2107
+ {
2108
+ scheme: 'bearer',
2109
+ type: 'http'
2110
+ }
2111
+ ],
2112
+ url: '/v1/{graph_id}/limits',
2113
+ ...options
2114
+ });
2115
+ };
2116
+
2117
+ /**
2118
+ * List Subgraphs
2119
+ * List all subgraphs for a parent graph.
2120
+ *
2121
+ * **Requirements:**
2122
+ * - Valid authentication
2123
+ * - Parent graph must exist and be accessible to the user
2124
+ * - User must have at least 'read' permission on the parent graph
2125
+ *
2126
+ * **Returns:**
2127
+ * - List of all subgraphs for the parent graph
2128
+ * - Each subgraph includes its ID, name, description, type, status, and creation date
2129
+ */
2130
+ export const listSubgraphs = <ThrowOnError extends boolean = false>(options: Options<ListSubgraphsData, ThrowOnError>) => {
2131
+ return (options.client ?? _heyApiClient).get<ListSubgraphsResponses, ListSubgraphsErrors, ThrowOnError>({
2132
+ security: [
2133
+ {
2134
+ name: 'X-API-Key',
2135
+ type: 'apiKey'
2136
+ },
2137
+ {
2138
+ scheme: 'bearer',
2139
+ type: 'http'
2140
+ }
2141
+ ],
2142
+ url: '/v1/{graph_id}/subgraphs',
2143
+ ...options
2144
+ });
2145
+ };
2146
+
2147
+ /**
2148
+ * Create Subgraph
2149
+ * Create a new subgraph within a parent graph.
2150
+ *
2151
+ * **Requirements:**
2152
+ * - Valid authentication
2153
+ * - Parent graph must exist and be accessible to the user
2154
+ * - User must have 'admin' permission on the parent graph
2155
+ * - Parent graph tier must support subgraphs (Enterprise or Premium only)
2156
+ * - Must be within subgraph quota limits
2157
+ * - Subgraph name must be unique within the parent graph
2158
+ *
2159
+ * **Returns:**
2160
+ * - Created subgraph details including its unique ID
2161
+ */
2162
+ export const createSubgraph = <ThrowOnError extends boolean = false>(options: Options<CreateSubgraphData, ThrowOnError>) => {
2163
+ return (options.client ?? _heyApiClient).post<CreateSubgraphResponses, CreateSubgraphErrors, ThrowOnError>({
2164
+ security: [
2165
+ {
2166
+ name: 'X-API-Key',
2167
+ type: 'apiKey'
2168
+ },
2169
+ {
2170
+ scheme: 'bearer',
2171
+ type: 'http'
2172
+ }
2173
+ ],
2174
+ url: '/v1/{graph_id}/subgraphs',
2175
+ ...options,
2176
+ headers: {
2177
+ 'Content-Type': 'application/json',
2178
+ ...options.headers
2179
+ }
2180
+ });
2181
+ };
2182
+
2183
+ /**
2184
+ * Delete Subgraph
2185
+ * Delete a subgraph database.
2186
+ *
2187
+ * **Requirements:**
2188
+ * - Must be a valid subgraph (not parent graph)
2189
+ * - User must have admin access to parent graph
2190
+ * - Optional backup before deletion
2191
+ *
2192
+ * **Deletion Options:**
2193
+ * - `force`: Delete even if contains data
2194
+ * - `backup_first`: Create backup before deletion
2195
+ *
2196
+ * **Warning:**
2197
+ * Deletion is permanent unless backup is created.
2198
+ * All data in the subgraph will be lost.
2199
+ *
2200
+ * **Backup Location:**
2201
+ * If backup requested, stored in S3 at:
2202
+ * `s3://robosystems-backups/{instance_id}/{database_name}_{timestamp}.backup`
2203
+ */
2204
+ export const deleteSubgraph = <ThrowOnError extends boolean = false>(options: Options<DeleteSubgraphData, ThrowOnError>) => {
2205
+ return (options.client ?? _heyApiClient).delete<DeleteSubgraphResponses, DeleteSubgraphErrors, ThrowOnError>({
2206
+ security: [
2207
+ {
2208
+ name: 'X-API-Key',
2209
+ type: 'apiKey'
2210
+ },
2211
+ {
2212
+ scheme: 'bearer',
2213
+ type: 'http'
2214
+ }
2215
+ ],
2216
+ url: '/v1/{graph_id}/subgraphs/{subgraph_id}',
2217
+ ...options,
2218
+ headers: {
2219
+ 'Content-Type': 'application/json',
2220
+ ...options.headers
2221
+ }
2222
+ });
2223
+ };
2224
+
2225
+ /**
2226
+ * Get Subgraph Details
2227
+ * Get detailed information about a specific subgraph.
2228
+ *
2229
+ * **Requirements:**
2230
+ * - User must have read access to parent graph
2231
+ *
2232
+ * **Response includes:**
2233
+ * - Full subgraph metadata
2234
+ * - Database statistics (nodes, edges)
2235
+ * - Size information
2236
+ * - Schema configuration
2237
+ * - Creation/modification timestamps
2238
+ * - Last access time (when available)
2239
+ *
2240
+ * **Statistics:**
2241
+ * Real-time statistics queried from Kuzu:
2242
+ * - Node count
2243
+ * - Edge count
2244
+ * - Database size on disk
2245
+ * - Schema information
2246
+ */
2247
+ export const getSubgraphInfo = <ThrowOnError extends boolean = false>(options: Options<GetSubgraphInfoData, ThrowOnError>) => {
2248
+ return (options.client ?? _heyApiClient).get<GetSubgraphInfoResponses, GetSubgraphInfoErrors, ThrowOnError>({
2249
+ security: [
2250
+ {
2251
+ name: 'X-API-Key',
2252
+ type: 'apiKey'
2253
+ },
2254
+ {
2255
+ scheme: 'bearer',
2256
+ type: 'http'
2257
+ }
2258
+ ],
2259
+ url: '/v1/{graph_id}/subgraphs/{subgraph_id}/info',
2260
+ ...options
2261
+ });
2262
+ };
2263
+
2264
+ /**
2265
+ * Get Subgraph Quota
2266
+ * Get subgraph quota and usage information for a parent graph.
2267
+ *
2268
+ * **Shows:**
2269
+ * - Current subgraph count
2270
+ * - Maximum allowed subgraphs per tier
2271
+ * - Remaining capacity
2272
+ * - Total size usage across all subgraphs
2273
+ *
2274
+ * **Tier Limits:**
2275
+ * - Standard: 0 subgraphs (not supported)
2276
+ * - Enterprise: Configurable limit (default: 10 subgraphs)
2277
+ * - Premium: Unlimited subgraphs
2278
+ * - Limits are defined in deployment configuration
2279
+ *
2280
+ * **Size Tracking:**
2281
+ * Provides aggregate size metrics when available.
2282
+ * Individual subgraph sizes shown in list endpoint.
2283
+ */
2284
+ export const getSubgraphQuota = <ThrowOnError extends boolean = false>(options: Options<GetSubgraphQuotaData, ThrowOnError>) => {
2285
+ return (options.client ?? _heyApiClient).get<GetSubgraphQuotaResponses, GetSubgraphQuotaErrors, ThrowOnError>({
2286
+ security: [
2287
+ {
2288
+ name: 'X-API-Key',
2289
+ type: 'apiKey'
2290
+ },
2291
+ {
2292
+ scheme: 'bearer',
2293
+ type: 'http'
2294
+ }
2295
+ ],
2296
+ url: '/v1/{graph_id}/subgraphs/quota',
2297
+ ...options
2298
+ });
2299
+ };
2300
+
2301
+ /**
2302
+ * Copy Data to Graph
2303
+ * Copy data from external sources into the graph database.
2304
+ *
2305
+ * This endpoint supports multiple data sources through a unified interface:
2306
+ * - **S3**: Copy from S3 buckets with user-provided credentials
2307
+ * - **URL** (future): Copy from HTTP(S) URLs
2308
+ * - **DataFrame** (future): Copy from uploaded DataFrames
2309
+ *
2310
+ * **Security:**
2311
+ * - Requires write permissions to the target graph
2312
+ * - **Not allowed on shared repositories** (sec, industry, economic) - these are read-only
2313
+ * - User must provide their own AWS credentials for S3 access
2314
+ * - All operations are logged for audit purposes
2315
+ *
2316
+ * **Tier Limits:**
2317
+ * - Standard: 10GB max file size, 15 min timeout
2318
+ * - Enterprise: 50GB max file size, 30 min timeout
2319
+ * - Premium: 100GB max file size, 60 min timeout
2320
+ *
2321
+ * **Copy Options:**
2322
+ * - `ignore_errors`: Skip duplicate/invalid rows (enables upsert-like behavior)
2323
+ * - `extended_timeout`: Use extended timeout for large datasets
2324
+ * - `validate_schema`: Validate source schema against target table
2325
+ */
2326
+ export const copyDataToGraph = <ThrowOnError extends boolean = false>(options: Options<CopyDataToGraphData, ThrowOnError>) => {
2327
+ return (options.client ?? _heyApiClient).post<CopyDataToGraphResponses, CopyDataToGraphErrors, ThrowOnError>({
2328
+ security: [
2329
+ {
2330
+ name: 'X-API-Key',
2331
+ type: 'apiKey'
2332
+ },
2333
+ {
2334
+ scheme: 'bearer',
2335
+ type: 'http'
2336
+ }
2337
+ ],
2338
+ url: '/v1/{graph_id}/copy',
2339
+ ...options,
2340
+ headers: {
2341
+ 'Content-Type': 'application/json',
2342
+ ...options.headers
2343
+ }
2344
+ });
2345
+ };
2346
+
2347
+ /**
2348
+ * Create New Graph Database
2349
+ * Create a new graph database with specified schema and optionally an initial entity.
2350
+ *
2351
+ * This endpoint starts an asynchronous graph creation operation and returns
2352
+ * connection details for monitoring progress via Server-Sent Events (SSE).
2353
+ *
2354
+ * **Operation Types:**
2355
+ * - **Generic Graph**: Creates empty graph with schema extensions
2356
+ * - **Entity Graph**: Creates graph with initial entity data
2357
+ *
2358
+ * **Monitoring Progress:**
2359
+ * Use the returned `operation_id` to connect to the SSE stream:
2360
+ * ```javascript
2361
+ * const eventSource = new EventSource('/v1/operations/{operation_id}/stream');
2362
+ * eventSource.onmessage = (event) => {
2363
+ * const data = JSON.parse(event.data);
2364
+ * console.log('Progress:', data.progress_percent + '%');
2365
+ * };
2366
+ * ```
2367
+ *
2368
+ * **SSE Connection Limits:**
2369
+ * - Maximum 5 concurrent SSE connections per user
2370
+ * - Rate limited to 10 new connections per minute
2371
+ * - Automatic circuit breaker for Redis failures
2372
+ * - Graceful degradation if event system unavailable
2373
+ *
2374
+ * **Events Emitted:**
2375
+ * - `operation_started`: Graph creation begins
2376
+ * - `operation_progress`: Schema loading, database setup, etc.
2377
+ * - `operation_completed`: Graph ready with connection details
2378
+ * - `operation_error`: Creation failed with error details
2379
+ *
2380
+ * **Error Handling:**
2381
+ * - `429 Too Many Requests`: SSE connection limit exceeded
2382
+ * - `503 Service Unavailable`: SSE system temporarily disabled
2383
+ * - Clients should implement exponential backoff on errors
2384
+ *
2385
+ * **Response includes:**
2386
+ * - `operation_id`: Unique identifier for monitoring
2387
+ * - `_links.stream`: SSE endpoint for real-time updates
2388
+ * - `_links.status`: Point-in-time status check endpoint
2389
+ */
2390
+ export const createGraph = <ThrowOnError extends boolean = false>(options: Options<CreateGraphData, ThrowOnError>) => {
2391
+ return (options.client ?? _heyApiClient).post<CreateGraphResponses, CreateGraphErrors, ThrowOnError>({
2392
+ security: [
2393
+ {
2394
+ name: 'X-API-Key',
2395
+ type: 'apiKey'
2396
+ },
2397
+ {
2398
+ scheme: 'bearer',
2399
+ type: 'http'
2400
+ }
2401
+ ],
2402
+ url: '/v1/create/graph',
2403
+ ...options,
2404
+ headers: {
2405
+ 'Content-Type': 'application/json',
2406
+ ...options.headers
2407
+ }
2408
+ });
2409
+ };
2410
+
2411
+ /**
2412
+ * Get Available Schema Extensions
2413
+ * List all available schema extensions for graph creation
2414
+ */
2415
+ export const getAvailableExtensions = <ThrowOnError extends boolean = false>(options?: Options<GetAvailableExtensionsData, ThrowOnError>) => {
2416
+ return (options?.client ?? _heyApiClient).get<GetAvailableExtensionsResponses, unknown, ThrowOnError>({
2417
+ security: [
2418
+ {
2419
+ name: 'X-API-Key',
2420
+ type: 'apiKey'
2421
+ },
2422
+ {
2423
+ scheme: 'bearer',
2424
+ type: 'http'
2425
+ }
2426
+ ],
2427
+ url: '/v1/create/graph/extensions',
2428
+ ...options
2429
+ });
2430
+ };
2431
+
2432
+ /**
2433
+ * Get Service Offerings
2434
+ * Get comprehensive information about all subscription offerings.
2435
+ *
2436
+ * This endpoint provides complete information about both graph database subscriptions
2437
+ * and shared repository subscriptions. This is the primary endpoint for frontend
2438
+ * applications to display subscription options.
2439
+ *
2440
+ * Includes:
2441
+ * - Graph subscription tiers (standard, enterprise, premium)
2442
+ * - Shared repository subscriptions (SEC, industry, economic data)
2443
+ * - Operation costs and credit information
2444
+ * - Features and capabilities for each tier
2445
+ * - Enabled/disabled status for repositories
2446
+ *
2447
+ * All data comes from the config-based systems to ensure accuracy with backend behavior.
2448
+ *
2449
+ * No authentication required - this is public service information.
2450
+ */
2451
+ export const getServiceOfferings = <ThrowOnError extends boolean = false>(options?: Options<GetServiceOfferingsData, ThrowOnError>) => {
2452
+ return (options?.client ?? _heyApiClient).get<GetServiceOfferingsResponses, GetServiceOfferingsErrors, ThrowOnError>({
2453
+ url: '/v1/offering',
2454
+ ...options
2455
+ });
2456
+ };
2457
+
2458
+ /**
2459
+ * Stream Operation Events
2460
+ * Stream real-time events for an operation using Server-Sent Events (SSE).
2461
+ *
2462
+ * This endpoint provides real-time monitoring for all non-immediate operations including:
2463
+ * - Graph creation and management
2464
+ * - Agent analysis processing
2465
+ * - Database backups and restores
2466
+ * - Data synchronization tasks
2467
+ *
2468
+ * **Event Types:**
2469
+ * - `operation_started`: Operation began execution
2470
+ * - `operation_progress`: Progress update with details
2471
+ * - `operation_completed`: Operation finished successfully
2472
+ * - `operation_error`: Operation failed with error details
2473
+ * - `operation_cancelled`: Operation was cancelled
2474
+ *
2475
+ * **Features:**
2476
+ * - **Event Replay**: Use `from_sequence` parameter to replay missed events
2477
+ * - **Automatic Reconnection**: Client can reconnect and resume from last seen event
2478
+ * - **Real-time Updates**: Live progress updates during execution
2479
+ * - **Timeout Handling**: 30-second keepalive messages prevent connection timeouts
2480
+ * - **Graceful Degradation**: Automatic fallback if Redis is unavailable
2481
+ *
2482
+ * **Connection Limits:**
2483
+ * - Maximum 5 concurrent SSE connections per user
2484
+ * - Rate limited to 10 new connections per minute
2485
+ * - Automatic cleanup of stale connections
2486
+ * - Circuit breaker protection for Redis failures
2487
+ *
2488
+ * **Client Usage:**
2489
+ * ```javascript
2490
+ * const eventSource = new EventSource('/v1/operations/abc123/stream');
2491
+ * eventSource.onmessage = (event) => {
2492
+ * const data = JSON.parse(event.data);
2493
+ * console.log('Progress:', data);
2494
+ * };
2495
+ * eventSource.onerror = (error) => {
2496
+ * // Handle connection errors or rate limits
2497
+ * console.error('SSE Error:', error);
2498
+ * };
2499
+ * ```
2500
+ *
2501
+ * **Error Handling:**
2502
+ * - `429 Too Many Requests`: Connection limit or rate limit exceeded
2503
+ * - `503 Service Unavailable`: SSE system temporarily disabled
2504
+ * - Clients should implement exponential backoff on errors
2505
+ *
2506
+ * **No credits are consumed for SSE connections.**
2507
+ */
2508
+ export const streamOperationEvents = <ThrowOnError extends boolean = false>(options: Options<StreamOperationEventsData, ThrowOnError>) => {
2509
+ return (options.client ?? _heyApiClient).get<StreamOperationEventsResponses, StreamOperationEventsErrors, ThrowOnError>({
2510
+ security: [
2511
+ {
2512
+ name: 'X-API-Key',
2513
+ type: 'apiKey'
2514
+ },
2515
+ {
2516
+ scheme: 'bearer',
2517
+ type: 'http'
2518
+ }
2519
+ ],
2520
+ url: '/v1/operations/{operation_id}/stream',
2521
+ ...options
2522
+ });
2523
+ };
2524
+
2525
+ /**
2526
+ * Get Operation Status
2527
+ * Get current status and metadata for an operation.
2528
+ *
2529
+ * Returns detailed information including:
2530
+ * - Current status (pending, running, completed, failed, cancelled)
2531
+ * - Creation and update timestamps
2532
+ * - Operation type and associated graph
2533
+ * - Result data (for completed operations)
2534
+ * - Error details (for failed operations)
2535
+ *
2536
+ * This endpoint provides a point-in-time status check, while the `/stream` endpoint
2537
+ * provides real-time updates. Use this for polling or initial status checks.
2538
+ *
2539
+ * **No credits are consumed for status checks.**
2540
+ */
2541
+ export const getOperationStatus = <ThrowOnError extends boolean = false>(options: Options<GetOperationStatusData, ThrowOnError>) => {
2542
+ return (options.client ?? _heyApiClient).get<GetOperationStatusResponses, GetOperationStatusErrors, ThrowOnError>({
2543
+ security: [
2544
+ {
2545
+ name: 'X-API-Key',
2546
+ type: 'apiKey'
2547
+ },
2548
+ {
2549
+ scheme: 'bearer',
2550
+ type: 'http'
2551
+ }
2552
+ ],
2553
+ url: '/v1/operations/{operation_id}/status',
2554
+ ...options
2555
+ });
2556
+ };
2557
+
2558
+ /**
2559
+ * Cancel Operation
2560
+ * Cancel a pending or running operation.
2561
+ *
2562
+ * Cancels the specified operation if it's still in progress. Once cancelled,
2563
+ * the operation cannot be resumed and will emit a cancellation event to any
2564
+ * active SSE connections.
2565
+ *
2566
+ * **Note**: Completed or already failed operations cannot be cancelled.
2567
+ *
2568
+ * **No credits are consumed for cancellation requests.**
2569
+ */
2570
+ export const cancelOperation = <ThrowOnError extends boolean = false>(options: Options<CancelOperationData, ThrowOnError>) => {
2571
+ return (options.client ?? _heyApiClient).delete<CancelOperationResponses, CancelOperationErrors, ThrowOnError>({
2572
+ security: [
2573
+ {
2574
+ name: 'X-API-Key',
2575
+ type: 'apiKey'
2576
+ },
2577
+ {
2578
+ scheme: 'bearer',
2579
+ type: 'http'
2580
+ }
2581
+ ],
2582
+ url: '/v1/operations/{operation_id}',
2583
+ ...options
2584
+ });
2585
+ };