@robosystems/client 0.1.15 → 0.1.16

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 (66) hide show
  1. package/package.json +48 -6
  2. package/sdk/client/client.gen.d.ts +2 -0
  3. package/sdk/client/client.gen.js +153 -0
  4. package/sdk/client/client.gen.ts +200 -0
  5. package/sdk/client/index.d.ts +7 -0
  6. package/sdk/client/index.js +15 -0
  7. package/sdk/client/index.ts +25 -0
  8. package/sdk/client/types.gen.d.ts +122 -0
  9. package/sdk/client/types.gen.js +4 -0
  10. package/sdk/client/types.gen.ts +233 -0
  11. package/sdk/client/utils.gen.d.ts +45 -0
  12. package/sdk/client/utils.gen.js +296 -0
  13. package/sdk/client/utils.gen.ts +419 -0
  14. package/sdk/client.gen.d.ts +12 -0
  15. package/sdk/client.gen.js +8 -0
  16. package/sdk/client.gen.ts +18 -0
  17. package/sdk/core/auth.gen.d.ts +18 -0
  18. package/sdk/core/auth.gen.js +18 -0
  19. package/sdk/core/auth.gen.ts +42 -0
  20. package/sdk/core/bodySerializer.gen.d.ts +17 -0
  21. package/sdk/core/bodySerializer.gen.js +57 -0
  22. package/sdk/core/bodySerializer.gen.ts +90 -0
  23. package/sdk/core/params.gen.d.ts +33 -0
  24. package/sdk/core/params.gen.js +92 -0
  25. package/sdk/core/params.gen.ts +153 -0
  26. package/sdk/core/pathSerializer.gen.d.ts +33 -0
  27. package/sdk/core/pathSerializer.gen.js +123 -0
  28. package/sdk/core/pathSerializer.gen.ts +181 -0
  29. package/sdk/core/types.gen.d.ts +78 -0
  30. package/sdk/core/types.gen.js +4 -0
  31. package/sdk/core/types.gen.ts +121 -0
  32. package/sdk/index.d.ts +2 -0
  33. package/sdk/index.js +19 -0
  34. package/sdk/index.ts +3 -0
  35. package/sdk/sdk.gen.d.ts +1269 -0
  36. package/sdk/sdk.gen.js +2664 -0
  37. package/sdk/sdk.gen.ts +2677 -0
  38. package/sdk/types.gen.d.ts +6265 -0
  39. package/sdk/types.gen.js +3 -0
  40. package/sdk/types.gen.ts +6784 -0
  41. package/sdk-extensions/OperationClient.d.ts +64 -0
  42. package/sdk-extensions/OperationClient.js +251 -0
  43. package/sdk-extensions/OperationClient.ts +322 -0
  44. package/sdk-extensions/QueryClient.d.ts +50 -0
  45. package/sdk-extensions/QueryClient.js +190 -0
  46. package/sdk-extensions/QueryClient.ts +283 -0
  47. package/sdk-extensions/README.md +672 -0
  48. package/sdk-extensions/SSEClient.d.ts +48 -0
  49. package/sdk-extensions/SSEClient.js +148 -0
  50. package/sdk-extensions/SSEClient.ts +189 -0
  51. package/sdk-extensions/config.d.ts +32 -0
  52. package/sdk-extensions/config.js +74 -0
  53. package/sdk-extensions/config.ts +91 -0
  54. package/sdk-extensions/hooks.d.ts +110 -0
  55. package/sdk-extensions/hooks.js +371 -0
  56. package/sdk-extensions/hooks.ts +438 -0
  57. package/sdk-extensions/index.d.ts +46 -0
  58. package/sdk-extensions/index.js +110 -0
  59. package/sdk-extensions/index.ts +123 -0
  60. package/sdk.gen.d.ts +128 -2
  61. package/sdk.gen.js +216 -2
  62. package/sdk.gen.ts +216 -2
  63. package/types.gen.d.ts +573 -4
  64. package/types.gen.ts +606 -4
  65. package/openapi-ts.config.js +0 -9
  66. package/prepare.js +0 -220
package/sdk/sdk.gen.ts ADDED
@@ -0,0 +1,2677 @@
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, GetCaptchaConfigData, GetCaptchaConfigResponses, GetPasswordPolicyData, GetPasswordPolicyResponses, CheckPasswordStrengthData, CheckPasswordStrengthResponses, CheckPasswordStrengthErrors, 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, GetSharedRepositoryLimitsData, GetSharedRepositoryLimitsResponses, GetSharedRepositoryLimitsErrors, GetAllSharedRepositoryLimitsData, GetAllSharedRepositoryLimitsResponses, GetAllSharedRepositoryLimitsErrors, GetUserUsageOverviewData, GetUserUsageOverviewResponses, GetUserUsageOverviewErrors, GetDetailedUserAnalyticsData, GetDetailedUserAnalyticsResponses, GetDetailedUserAnalyticsErrors, GetUserSharedSubscriptionsData, GetUserSharedSubscriptionsResponses, GetUserSharedSubscriptionsErrors, SubscribeToSharedRepositoryData, SubscribeToSharedRepositoryResponses, SubscribeToSharedRepositoryErrors, UpgradeSharedRepositorySubscriptionData, UpgradeSharedRepositorySubscriptionResponses, UpgradeSharedRepositorySubscriptionErrors, CancelSharedRepositorySubscriptionData, CancelSharedRepositorySubscriptionResponses, CancelSharedRepositorySubscriptionErrors, GetSharedRepositoryCreditsData, GetSharedRepositoryCreditsResponses, GetSharedRepositoryCreditsErrors, GetRepositoryCreditsData, GetRepositoryCreditsResponses, GetRepositoryCreditsErrors, GetConnectionOptionsData, GetConnectionOptionsResponses, GetConnectionOptionsErrors, ListConnectionsData, ListConnectionsResponses, ListConnectionsErrors, CreateConnectionData, CreateConnectionResponses, CreateConnectionErrors, DeleteConnectionData, DeleteConnectionResponses, DeleteConnectionErrors, GetConnectionData, GetConnectionResponses, GetConnectionErrors, SyncConnectionData, SyncConnectionResponses, SyncConnectionErrors, CreateLinkTokenData, CreateLinkTokenResponses, CreateLinkTokenErrors, ExchangeLinkTokenData, ExchangeLinkTokenResponses, ExchangeLinkTokenErrors, InitOAuthData, InitOAuthResponses, InitOAuthErrors, OauthCallbackData, OauthCallbackResponses, OauthCallbackErrors, QueryFinancialAgentData, QueryFinancialAgentResponses, QueryFinancialAgentErrors, ListMcpToolsData, ListMcpToolsResponses, ListMcpToolsErrors, CallMcpToolData, CallMcpToolResponses, CallMcpToolErrors, CreateBackupData, CreateBackupResponses, CreateBackupErrors, ListBackupsData, ListBackupsResponses, ListBackupsErrors, ExportBackupData, ExportBackupResponses, ExportBackupErrors, RestoreBackupData, RestoreBackupResponses, RestoreBackupErrors, GetBackupStatsData, GetBackupStatsResponses, GetBackupStatsErrors, KuzuBackupHealthData, KuzuBackupHealthResponses, KuzuBackupHealthErrors, GetBackupDownloadUrlData, GetBackupDownloadUrlResponses, GetBackupDownloadUrlErrors, GetGraphMetricsData, GetGraphMetricsResponses, GetGraphMetricsErrors, GetGraphUsageStatsData, GetGraphUsageStatsResponses, GetGraphUsageStatsErrors, ExecuteCypherQueryData, ExecuteCypherQueryResponses, ExecuteCypherQueryErrors, GetGraphSchemaInfoData, GetGraphSchemaInfoResponses, GetGraphSchemaInfoErrors, ValidateSchemaData, ValidateSchemaResponses, ValidateSchemaErrors, ExportGraphSchemaData, ExportGraphSchemaResponses, ExportGraphSchemaErrors, ListSchemaExtensionsData, ListSchemaExtensionsResponses, ListSchemaExtensionsErrors, GetCurrentGraphBillData, GetCurrentGraphBillResponses, GetCurrentGraphBillErrors, GetGraphMonthlyBillData, GetGraphMonthlyBillResponses, GetGraphMonthlyBillErrors, GetGraphBillingHistoryData, GetGraphBillingHistoryResponses, GetGraphBillingHistoryErrors, GetGraphUsageDetailsData, GetGraphUsageDetailsResponses, GetGraphUsageDetailsErrors, GetGraphPricingInfoV1GraphIdBillingPricingGetData, GetGraphPricingInfoV1GraphIdBillingPricingGetResponses, GetGraphPricingInfoV1GraphIdBillingPricingGetErrors, UpgradeGraphSubscriptionV1GraphIdBillingSubscriptionUpgradePostData, UpgradeGraphSubscriptionV1GraphIdBillingSubscriptionUpgradePostResponses, UpgradeGraphSubscriptionV1GraphIdBillingSubscriptionUpgradePostErrors, GetGraphSubscriptionV1GraphIdBillingSubscriptionGetData, GetGraphSubscriptionV1GraphIdBillingSubscriptionGetResponses, GetGraphSubscriptionV1GraphIdBillingSubscriptionGetErrors, GetAvailableSubscriptionPlansV1GraphIdBillingAvailablePlansGetData, GetAvailableSubscriptionPlansV1GraphIdBillingAvailablePlansGetResponses, GetAvailableSubscriptionPlansV1GraphIdBillingAvailablePlansGetErrors, GetCreditBillingInfoV1GraphIdBillingCreditsGetData, GetCreditBillingInfoV1GraphIdBillingCreditsGetResponses, GetCreditBillingInfoV1GraphIdBillingCreditsGetErrors, GetCreditSummaryData, GetCreditSummaryResponses, GetCreditSummaryErrors, ListCreditTransactionsData, ListCreditTransactionsResponses, ListCreditTransactionsErrors, CheckCreditBalanceData, CheckCreditBalanceResponses, CheckCreditBalanceErrors, GetStorageUsageData, GetStorageUsageResponses, GetStorageUsageErrors, CheckStorageLimitsData, CheckStorageLimitsResponses, CheckStorageLimitsErrors, GetDatabaseHealthData, GetDatabaseHealthResponses, GetDatabaseHealthErrors, GetDatabaseInfoData, GetDatabaseInfoResponses, GetDatabaseInfoErrors, ListSubgraphsData, ListSubgraphsResponses, ListSubgraphsErrors, CreateSubgraphData, CreateSubgraphResponses, CreateSubgraphErrors, DeleteSubgraphData, DeleteSubgraphResponses, DeleteSubgraphErrors, GetSubgraphQuotaData, GetSubgraphQuotaResponses, GetSubgraphQuotaErrors, GetSubgraphInfoData, GetSubgraphInfoResponses, GetSubgraphInfoErrors, 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 CAPTCHA Configuration
142
+ * Get CAPTCHA configuration including site key and whether CAPTCHA is required.
143
+ */
144
+ export const getCaptchaConfig = <ThrowOnError extends boolean = false>(options?: Options<GetCaptchaConfigData, ThrowOnError>) => {
145
+ return (options?.client ?? _heyApiClient).get<GetCaptchaConfigResponses, unknown, ThrowOnError>({
146
+ url: '/v1/auth/captcha/config',
147
+ ...options
148
+ });
149
+ };
150
+
151
+ /**
152
+ * Get Password Policy
153
+ * Get current password policy requirements for frontend validation
154
+ */
155
+ export const getPasswordPolicy = <ThrowOnError extends boolean = false>(options?: Options<GetPasswordPolicyData, ThrowOnError>) => {
156
+ return (options?.client ?? _heyApiClient).get<GetPasswordPolicyResponses, unknown, ThrowOnError>({
157
+ url: '/v1/auth/password/policy',
158
+ ...options
159
+ });
160
+ };
161
+
162
+ /**
163
+ * Check Password Strength
164
+ * Check password strength and get validation feedback
165
+ */
166
+ export const checkPasswordStrength = <ThrowOnError extends boolean = false>(options: Options<CheckPasswordStrengthData, ThrowOnError>) => {
167
+ return (options.client ?? _heyApiClient).post<CheckPasswordStrengthResponses, CheckPasswordStrengthErrors, ThrowOnError>({
168
+ url: '/v1/auth/password/check',
169
+ ...options,
170
+ headers: {
171
+ 'Content-Type': 'application/json',
172
+ ...options.headers
173
+ }
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/summary',
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 shared repository rate limit status
464
+ * Get current rate limit status and usage for a shared repository.
465
+ *
466
+ * Returns:
467
+ * - Current usage across different time windows
468
+ * - Rate limits based on subscription tier
469
+ * - Remaining quota
470
+ * - Reset times
471
+ *
472
+ * Note: All queries are FREE - this only shows rate limit status.
473
+ */
474
+ export const getSharedRepositoryLimits = <ThrowOnError extends boolean = false>(options: Options<GetSharedRepositoryLimitsData, ThrowOnError>) => {
475
+ return (options.client ?? _heyApiClient).get<GetSharedRepositoryLimitsResponses, GetSharedRepositoryLimitsErrors, ThrowOnError>({
476
+ security: [
477
+ {
478
+ name: 'X-API-Key',
479
+ type: 'apiKey'
480
+ },
481
+ {
482
+ scheme: 'bearer',
483
+ type: 'http'
484
+ }
485
+ ],
486
+ url: '/v1/user/limits/shared-repositories/{repository}',
487
+ ...options
488
+ });
489
+ };
490
+
491
+ /**
492
+ * Get all shared repository limits
493
+ * Get rate limit status for all shared repositories the user has access to.
494
+ */
495
+ export const getAllSharedRepositoryLimits = <ThrowOnError extends boolean = false>(options?: Options<GetAllSharedRepositoryLimitsData, ThrowOnError>) => {
496
+ return (options?.client ?? _heyApiClient).get<GetAllSharedRepositoryLimitsResponses, GetAllSharedRepositoryLimitsErrors, 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/summary',
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 Connection Options
690
+ * Get metadata about all available data connection providers.
691
+ *
692
+ * This endpoint returns comprehensive information about each supported provider:
693
+ *
694
+ * **SEC EDGAR**: Public entity financial filings
695
+ * - No authentication required (public data)
696
+ * - 10-K, 10-Q, 8-K reports with XBRL data
697
+ * - Historical and real-time filing access
698
+ *
699
+ * **QuickBooks Online**: Full accounting system integration
700
+ * - OAuth 2.0 authentication
701
+ * - Chart of accounts, transactions, trial balance
702
+ * - Real-time sync capabilities
703
+ *
704
+ * **Plaid**: Bank account connections
705
+ * - Secure bank authentication via Plaid Link
706
+ * - Transaction history and balances
707
+ * - Multi-account support
708
+ *
709
+ * No credits are consumed for viewing connection options.
710
+ */
711
+ export const getConnectionOptions = <ThrowOnError extends boolean = false>(options: Options<GetConnectionOptionsData, ThrowOnError>) => {
712
+ return (options.client ?? _heyApiClient).get<GetConnectionOptionsResponses, GetConnectionOptionsErrors, ThrowOnError>({
713
+ security: [
714
+ {
715
+ name: 'X-API-Key',
716
+ type: 'apiKey'
717
+ },
718
+ {
719
+ scheme: 'bearer',
720
+ type: 'http'
721
+ }
722
+ ],
723
+ url: '/v1/{graph_id}/connections/options',
724
+ ...options
725
+ });
726
+ };
727
+
728
+ /**
729
+ * List Connections
730
+ * List all data connections in the graph.
731
+ *
732
+ * Returns active and inactive connections with their current status.
733
+ * Connections can be filtered by:
734
+ * - **Entity**: Show connections for a specific entity
735
+ * - **Provider**: Filter by connection type (sec, quickbooks, plaid)
736
+ *
737
+ * Each connection shows:
738
+ * - Current sync status and health
739
+ * - Last successful sync timestamp
740
+ * - Configuration metadata
741
+ * - Error messages if any
742
+ *
743
+ * No credits are consumed for listing connections.
744
+ */
745
+ export const listConnections = <ThrowOnError extends boolean = false>(options: Options<ListConnectionsData, ThrowOnError>) => {
746
+ return (options.client ?? _heyApiClient).get<ListConnectionsResponses, ListConnectionsErrors, ThrowOnError>({
747
+ security: [
748
+ {
749
+ name: 'X-API-Key',
750
+ type: 'apiKey'
751
+ },
752
+ {
753
+ scheme: 'bearer',
754
+ type: 'http'
755
+ }
756
+ ],
757
+ url: '/v1/{graph_id}/connections',
758
+ ...options
759
+ });
760
+ };
761
+
762
+ /**
763
+ * Create Connection
764
+ * Create a new data connection for external system integration.
765
+ *
766
+ * This endpoint initiates connections to external data sources:
767
+ *
768
+ * **SEC Connections**:
769
+ * - Provide entity CIK for automatic filing retrieval
770
+ * - No authentication needed
771
+ * - Begins immediate data sync
772
+ *
773
+ * **QuickBooks Connections**:
774
+ * - Returns OAuth URL for authorization
775
+ * - Requires admin permissions in QuickBooks
776
+ * - Complete with OAuth callback
777
+ *
778
+ * **Plaid Connections**:
779
+ * - Returns Plaid Link token
780
+ * - User completes bank authentication
781
+ * - Exchange public token for access
782
+ *
783
+ * Note:
784
+ * This operation is FREE - no credit consumption required.
785
+ */
786
+ export const createConnection = <ThrowOnError extends boolean = false>(options: Options<CreateConnectionData, ThrowOnError>) => {
787
+ return (options.client ?? _heyApiClient).post<CreateConnectionResponses, CreateConnectionErrors, ThrowOnError>({
788
+ security: [
789
+ {
790
+ name: 'X-API-Key',
791
+ type: 'apiKey'
792
+ },
793
+ {
794
+ scheme: 'bearer',
795
+ type: 'http'
796
+ }
797
+ ],
798
+ url: '/v1/{graph_id}/connections',
799
+ ...options,
800
+ headers: {
801
+ 'Content-Type': 'application/json',
802
+ ...options.headers
803
+ }
804
+ });
805
+ };
806
+
807
+ /**
808
+ * Delete Connection
809
+ * Delete a data connection and clean up related resources.
810
+ *
811
+ * This operation:
812
+ * - Removes the connection configuration
813
+ * - Preserves any imported data in the graph
814
+ * - Performs provider-specific cleanup
815
+ * - Revokes stored credentials
816
+ *
817
+ * Note:
818
+ * This operation is FREE - no credit consumption required.
819
+ *
820
+ * Only users with admin role can delete connections.
821
+ */
822
+ export const deleteConnection = <ThrowOnError extends boolean = false>(options: Options<DeleteConnectionData, ThrowOnError>) => {
823
+ return (options.client ?? _heyApiClient).delete<DeleteConnectionResponses, DeleteConnectionErrors, ThrowOnError>({
824
+ security: [
825
+ {
826
+ name: 'X-API-Key',
827
+ type: 'apiKey'
828
+ },
829
+ {
830
+ scheme: 'bearer',
831
+ type: 'http'
832
+ }
833
+ ],
834
+ url: '/v1/{graph_id}/connections/{connection_id}',
835
+ ...options
836
+ });
837
+ };
838
+
839
+ /**
840
+ * Get Connection
841
+ * Get detailed information about a specific connection.
842
+ *
843
+ * Returns comprehensive connection details including:
844
+ * - Current status and health indicators
845
+ * - Authentication state
846
+ * - Sync history and statistics
847
+ * - Error details if any
848
+ * - Provider-specific metadata
849
+ *
850
+ * No credits are consumed for viewing connection details.
851
+ */
852
+ export const getConnection = <ThrowOnError extends boolean = false>(options: Options<GetConnectionData, ThrowOnError>) => {
853
+ return (options.client ?? _heyApiClient).get<GetConnectionResponses, GetConnectionErrors, 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/{connection_id}',
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
+ * Create Backup
1235
+ * Create a backup of the graph database.
1236
+ *
1237
+ * Creates a complete backup of the Kuzu database (.kuzu file) with:
1238
+ * - **Format**: Full database backup only (complete .kuzu file)
1239
+ * - **Compression**: Always enabled for optimal storage
1240
+ * - **Encryption**: Optional AES-256 encryption for security
1241
+ * - **Retention**: Configurable retention period (1-2555 days)
1242
+ *
1243
+ * **Backup Features:**
1244
+ * - **Complete Backup**: Full database file backup
1245
+ * - **Consistency**: Point-in-time consistent snapshot
1246
+ * - **Download Support**: Unencrypted backups can be downloaded
1247
+ * - **Restore Support**: Future support for encrypted backup restoration
1248
+ *
1249
+ * **Progress Monitoring:**
1250
+ * Use the returned operation_id to connect to the SSE stream:
1251
+ * ```javascript
1252
+ * const eventSource = new EventSource('/v1/operations/{operation_id}/stream');
1253
+ * eventSource.addEventListener('operation_progress', (event) => {
1254
+ * const data = JSON.parse(event.data);
1255
+ * console.log('Backup progress:', data.progress_percent + '%');
1256
+ * });
1257
+ * ```
1258
+ *
1259
+ * **SSE Connection Limits:**
1260
+ * - Maximum 5 concurrent SSE connections per user
1261
+ * - Rate limited to 10 new connections per minute
1262
+ * - Automatic circuit breaker for Redis failures
1263
+ * - Graceful degradation if event system unavailable
1264
+ *
1265
+ * **Important Notes:**
1266
+ * - Only full_dump format is supported (no CSV/JSON exports)
1267
+ * - Compression is always enabled
1268
+ * - Encrypted backups cannot be downloaded (security measure)
1269
+ * - All backups are stored securely in cloud storage
1270
+ *
1271
+ * **Credit Consumption:**
1272
+ * - Base cost: 25.0 credits
1273
+ * - Large databases (>10GB): 50.0 credits
1274
+ * - Multiplied by graph tier
1275
+ *
1276
+ * Returns operation details for SSE monitoring.
1277
+ */
1278
+ export const createBackup = <ThrowOnError extends boolean = false>(options: Options<CreateBackupData, ThrowOnError>) => {
1279
+ return (options.client ?? _heyApiClient).post<CreateBackupResponses, CreateBackupErrors, ThrowOnError>({
1280
+ security: [
1281
+ {
1282
+ name: 'X-API-Key',
1283
+ type: 'apiKey'
1284
+ },
1285
+ {
1286
+ scheme: 'bearer',
1287
+ type: 'http'
1288
+ }
1289
+ ],
1290
+ url: '/v1/{graph_id}/backup/create',
1291
+ ...options,
1292
+ headers: {
1293
+ 'Content-Type': 'application/json',
1294
+ ...options.headers
1295
+ }
1296
+ });
1297
+ };
1298
+
1299
+ /**
1300
+ * List Kuzu graph backups
1301
+ * List all backups for the specified graph database
1302
+ */
1303
+ export const listBackups = <ThrowOnError extends boolean = false>(options: Options<ListBackupsData, ThrowOnError>) => {
1304
+ return (options.client ?? _heyApiClient).get<ListBackupsResponses, ListBackupsErrors, ThrowOnError>({
1305
+ security: [
1306
+ {
1307
+ name: 'X-API-Key',
1308
+ type: 'apiKey'
1309
+ },
1310
+ {
1311
+ scheme: 'bearer',
1312
+ type: 'http'
1313
+ }
1314
+ ],
1315
+ url: '/v1/{graph_id}/backup/list',
1316
+ ...options
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}/backup/export',
1337
+ ...options,
1338
+ headers: {
1339
+ 'Content-Type': 'application/json',
1340
+ ...options.headers
1341
+ }
1342
+ });
1343
+ };
1344
+
1345
+ /**
1346
+ * Restore Encrypted Backup
1347
+ * Restore a graph database from an encrypted backup.
1348
+ *
1349
+ * Restores a complete Kuzu database from an encrypted backup:
1350
+ * - **Format**: Only full_dump backups can be restored
1351
+ * - **Encryption**: Only encrypted backups can be restored (security requirement)
1352
+ * - **System Backup**: Creates automatic backup of existing database before restore
1353
+ * - **Verification**: Optionally verifies database integrity after restore
1354
+ *
1355
+ * **Restore Features:**
1356
+ * - **Atomic Operation**: Complete replacement of database
1357
+ * - **Rollback Protection**: System backup created before restore
1358
+ * - **Data Integrity**: Verification ensures successful restore
1359
+ * - **Security**: Only encrypted backups to prevent data tampering
1360
+ *
1361
+ * **Progress Monitoring:**
1362
+ * Use the returned operation_id to connect to the SSE stream:
1363
+ * ```javascript
1364
+ * const eventSource = new EventSource('/v1/operations/{operation_id}/stream');
1365
+ * eventSource.addEventListener('operation_progress', (event) => {
1366
+ * const data = JSON.parse(event.data);
1367
+ * console.log('Restore progress:', data.message);
1368
+ * });
1369
+ * ```
1370
+ *
1371
+ * **SSE Connection Limits:**
1372
+ * - Maximum 5 concurrent SSE connections per user
1373
+ * - Rate limited to 10 new connections per minute
1374
+ * - Automatic circuit breaker for Redis failures
1375
+ * - Graceful degradation if event system unavailable
1376
+ *
1377
+ * **Important Notes:**
1378
+ * - Only encrypted backups can be restored (security measure)
1379
+ * - Existing database is backed up to S3 before restore
1380
+ * - Restore is a destructive operation - existing data is replaced
1381
+ * - System backups are stored separately for recovery
1382
+ *
1383
+ * **Credit Consumption:**
1384
+ * - Base cost: 100.0 credits
1385
+ * - Large databases (>10GB): 200.0 credits
1386
+ * - Multiplied by graph tier
1387
+ *
1388
+ * Returns operation details for SSE monitoring.
1389
+ */
1390
+ export const restoreBackup = <ThrowOnError extends boolean = false>(options: Options<RestoreBackupData, ThrowOnError>) => {
1391
+ return (options.client ?? _heyApiClient).post<RestoreBackupResponses, RestoreBackupErrors, ThrowOnError>({
1392
+ security: [
1393
+ {
1394
+ name: 'X-API-Key',
1395
+ type: 'apiKey'
1396
+ },
1397
+ {
1398
+ scheme: 'bearer',
1399
+ type: 'http'
1400
+ }
1401
+ ],
1402
+ url: '/v1/{graph_id}/backup/restore',
1403
+ ...options,
1404
+ headers: {
1405
+ 'Content-Type': 'application/json',
1406
+ ...options.headers
1407
+ }
1408
+ });
1409
+ };
1410
+
1411
+ /**
1412
+ * Get backup statistics
1413
+ * Get comprehensive backup statistics for the specified graph database
1414
+ */
1415
+ export const getBackupStats = <ThrowOnError extends boolean = false>(options: Options<GetBackupStatsData, ThrowOnError>) => {
1416
+ return (options.client ?? _heyApiClient).get<GetBackupStatsResponses, GetBackupStatsErrors, ThrowOnError>({
1417
+ security: [
1418
+ {
1419
+ name: 'X-API-Key',
1420
+ type: 'apiKey'
1421
+ },
1422
+ {
1423
+ scheme: 'bearer',
1424
+ type: 'http'
1425
+ }
1426
+ ],
1427
+ url: '/v1/{graph_id}/backup/stats',
1428
+ ...options
1429
+ });
1430
+ };
1431
+
1432
+ /**
1433
+ * Check Kuzu backup system health
1434
+ * Check the health status of the Kuzu backup system
1435
+ */
1436
+ export const kuzuBackupHealth = <ThrowOnError extends boolean = false>(options: Options<KuzuBackupHealthData, ThrowOnError>) => {
1437
+ return (options.client ?? _heyApiClient).get<KuzuBackupHealthResponses, KuzuBackupHealthErrors, ThrowOnError>({
1438
+ security: [
1439
+ {
1440
+ name: 'X-API-Key',
1441
+ type: 'apiKey'
1442
+ },
1443
+ {
1444
+ scheme: 'bearer',
1445
+ type: 'http'
1446
+ }
1447
+ ],
1448
+ url: '/v1/{graph_id}/backup/health',
1449
+ ...options
1450
+ });
1451
+ };
1452
+
1453
+ /**
1454
+ * Get temporary download URL for backup
1455
+ * Generate a temporary download URL for a backup (unencrypted, compressed .kuzu files only)
1456
+ */
1457
+ export const getBackupDownloadUrl = <ThrowOnError extends boolean = false>(options: Options<GetBackupDownloadUrlData, ThrowOnError>) => {
1458
+ return (options.client ?? _heyApiClient).get<GetBackupDownloadUrlResponses, GetBackupDownloadUrlErrors, ThrowOnError>({
1459
+ security: [
1460
+ {
1461
+ name: 'X-API-Key',
1462
+ type: 'apiKey'
1463
+ },
1464
+ {
1465
+ scheme: 'bearer',
1466
+ type: 'http'
1467
+ }
1468
+ ],
1469
+ url: '/v1/{graph_id}/backup/{backup_id}/download',
1470
+ ...options
1471
+ });
1472
+ };
1473
+
1474
+ /**
1475
+ * Get Graph Metrics
1476
+ * Get comprehensive metrics for the graph database.
1477
+ *
1478
+ * Provides detailed analytics including:
1479
+ * - **Node Statistics**: Counts by type (Entity, Report, Account, Transaction)
1480
+ * - **Relationship Metrics**: Connection counts and patterns
1481
+ * - **Data Quality**: Completeness scores and validation results
1482
+ * - **Performance Metrics**: Query response times and database health
1483
+ * - **Storage Analytics**: Database size and growth trends
1484
+ *
1485
+ * This data helps with:
1486
+ * - Monitoring data completeness
1487
+ * - Identifying data quality issues
1488
+ * - Capacity planning
1489
+ * - Performance optimization
1490
+ *
1491
+ * Note:
1492
+ * This operation is FREE - no credit consumption required.
1493
+ */
1494
+ export const getGraphMetrics = <ThrowOnError extends boolean = false>(options: Options<GetGraphMetricsData, ThrowOnError>) => {
1495
+ return (options.client ?? _heyApiClient).get<GetGraphMetricsResponses, GetGraphMetricsErrors, ThrowOnError>({
1496
+ security: [
1497
+ {
1498
+ name: 'X-API-Key',
1499
+ type: 'apiKey'
1500
+ },
1501
+ {
1502
+ scheme: 'bearer',
1503
+ type: 'http'
1504
+ }
1505
+ ],
1506
+ url: '/v1/{graph_id}/analytics',
1507
+ ...options
1508
+ });
1509
+ };
1510
+
1511
+ /**
1512
+ * Get Usage Statistics
1513
+ * Get detailed usage statistics for the graph.
1514
+ *
1515
+ * Provides temporal usage patterns including:
1516
+ * - **Query Volume**: API calls per day/hour
1517
+ * - **Credit Consumption**: Usage patterns and trends
1518
+ * - **Operation Breakdown**: Usage by operation type
1519
+ * - **User Activity**: Access patterns by user role
1520
+ * - **Peak Usage Times**: Identify high-activity periods
1521
+ *
1522
+ * Time ranges available:
1523
+ * - Last 24 hours (hourly breakdown)
1524
+ * - Last 7 days (daily breakdown)
1525
+ * - Last 30 days (daily breakdown)
1526
+ * - Custom date ranges
1527
+ *
1528
+ * Useful for:
1529
+ * - Capacity planning
1530
+ * - Cost optimization
1531
+ * - Usage trend analysis
1532
+ * - Performance tuning
1533
+ *
1534
+ * Note:
1535
+ * This operation is FREE - no credit consumption required.
1536
+ */
1537
+ export const getGraphUsageStats = <ThrowOnError extends boolean = false>(options: Options<GetGraphUsageStatsData, ThrowOnError>) => {
1538
+ return (options.client ?? _heyApiClient).get<GetGraphUsageStatsResponses, GetGraphUsageStatsErrors, ThrowOnError>({
1539
+ security: [
1540
+ {
1541
+ name: 'X-API-Key',
1542
+ type: 'apiKey'
1543
+ },
1544
+ {
1545
+ scheme: 'bearer',
1546
+ type: 'http'
1547
+ }
1548
+ ],
1549
+ url: '/v1/{graph_id}/analytics/usage',
1550
+ ...options
1551
+ });
1552
+ };
1553
+
1554
+ /**
1555
+ * Execute Cypher Query
1556
+ * Execute a Cypher query with intelligent response optimization.
1557
+ *
1558
+ * This endpoint automatically selects the best execution strategy based on:
1559
+ * - Query characteristics (size, complexity)
1560
+ * - Client capabilities (SSE, NDJSON, JSON)
1561
+ * - System load (queue status, concurrent queries)
1562
+ * - User preferences (mode parameter, headers)
1563
+ *
1564
+ * **Response Modes:**
1565
+ * - `auto` (default): Intelligent automatic selection
1566
+ * - `sync`: Force synchronous JSON response (best for testing)
1567
+ * - `async`: Force queued response with SSE monitoring endpoints (no polling needed)
1568
+ * - `stream`: Force streaming response (SSE or NDJSON)
1569
+ *
1570
+ * **Client Detection:**
1571
+ * - Automatically detects testing tools (Postman, Swagger UI)
1572
+ * - Adjusts behavior for better interactive experience
1573
+ * - Respects Accept and Prefer headers for capabilities
1574
+ *
1575
+ * **Streaming Support (SSE):**
1576
+ * - Real-time events with progress updates
1577
+ * - Maximum 5 concurrent SSE connections per user
1578
+ * - Rate limited to 10 new connections per minute
1579
+ * - Automatic circuit breaker for Redis failures
1580
+ * - Graceful degradation if event system unavailable
1581
+ * - 30-second keepalive to prevent timeouts
1582
+ *
1583
+ * **Streaming Support (NDJSON):**
1584
+ * - Efficient line-delimited JSON for large results
1585
+ * - Automatic chunking (configurable 10-10000 rows)
1586
+ * - No connection limits (stateless streaming)
1587
+ *
1588
+ * **Queue Management:**
1589
+ * - Automatic queuing under high load
1590
+ * - Real-time monitoring via SSE events (no polling needed)
1591
+ * - Priority based on subscription tier
1592
+ * - Queue position and progress updates pushed via SSE
1593
+ * - Connect to returned `/v1/operations/{id}/stream` endpoint for updates
1594
+ *
1595
+ * **Error Handling:**
1596
+ * - `429 Too Many Requests`: Rate limit or connection limit exceeded
1597
+ * - `503 Service Unavailable`: Circuit breaker open or SSE disabled
1598
+ * - Clients should implement exponential backoff
1599
+ *
1600
+ * **Note:**
1601
+ * Query operations are FREE - no credit consumption required.
1602
+ * Queue position is based on subscription tier for priority.
1603
+ */
1604
+ export const executeCypherQuery = <ThrowOnError extends boolean = false>(options: Options<ExecuteCypherQueryData, ThrowOnError>) => {
1605
+ return (options.client ?? _heyApiClient).post<ExecuteCypherQueryResponses, ExecuteCypherQueryErrors, ThrowOnError>({
1606
+ security: [
1607
+ {
1608
+ name: 'X-API-Key',
1609
+ type: 'apiKey'
1610
+ },
1611
+ {
1612
+ scheme: 'bearer',
1613
+ type: 'http'
1614
+ }
1615
+ ],
1616
+ url: '/v1/{graph_id}/query',
1617
+ ...options,
1618
+ headers: {
1619
+ 'Content-Type': 'application/json',
1620
+ ...options.headers
1621
+ }
1622
+ });
1623
+ };
1624
+
1625
+ /**
1626
+ * Get Runtime Graph Schema Information
1627
+ * Get runtime schema information for the specified graph database.
1628
+ *
1629
+ * This endpoint inspects the actual graph database structure and returns:
1630
+ * - **Node Labels**: All node types currently in the database
1631
+ * - **Relationship Types**: All relationship types currently in the database
1632
+ * - **Node Properties**: Properties for each node type (limited to first 10 for performance)
1633
+ *
1634
+ * This is different from custom schema management - it shows what actually exists in the database,
1635
+ * useful for understanding the current graph structure before writing queries.
1636
+ *
1637
+ * This operation is FREE - no credit consumption required.
1638
+ */
1639
+ export const getGraphSchemaInfo = <ThrowOnError extends boolean = false>(options: Options<GetGraphSchemaInfoData, ThrowOnError>) => {
1640
+ return (options.client ?? _heyApiClient).get<GetGraphSchemaInfoResponses, GetGraphSchemaInfoErrors, ThrowOnError>({
1641
+ security: [
1642
+ {
1643
+ name: 'X-API-Key',
1644
+ type: 'apiKey'
1645
+ },
1646
+ {
1647
+ scheme: 'bearer',
1648
+ type: 'http'
1649
+ }
1650
+ ],
1651
+ url: '/v1/{graph_id}/schema/info',
1652
+ ...options
1653
+ });
1654
+ };
1655
+
1656
+ /**
1657
+ * Validate Schema
1658
+ * Validate a custom schema definition before deployment.
1659
+ *
1660
+ * This endpoint performs comprehensive validation including:
1661
+ * - **Structure Validation**: Ensures proper JSON/YAML format
1662
+ * - **Type Checking**: Validates data types (STRING, INT, DOUBLE, etc.)
1663
+ * - **Constraint Verification**: Checks primary keys and unique constraints
1664
+ * - **Relationship Integrity**: Validates node references in relationships
1665
+ * - **Naming Conventions**: Ensures valid identifiers
1666
+ * - **Compatibility**: Checks against existing extensions if specified
1667
+ *
1668
+ * Supported formats:
1669
+ * - JSON schema definitions
1670
+ * - YAML schema definitions
1671
+ * - Direct dictionary format
1672
+ *
1673
+ * Validation helps prevent:
1674
+ * - Schema deployment failures
1675
+ * - Data integrity issues
1676
+ * - Performance problems
1677
+ * - Naming conflicts
1678
+ *
1679
+ * This operation is FREE - no credit consumption required.
1680
+ */
1681
+ export const validateSchema = <ThrowOnError extends boolean = false>(options: Options<ValidateSchemaData, ThrowOnError>) => {
1682
+ return (options.client ?? _heyApiClient).post<ValidateSchemaResponses, ValidateSchemaErrors, 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/validate',
1694
+ ...options,
1695
+ headers: {
1696
+ 'Content-Type': 'application/json',
1697
+ ...options.headers
1698
+ }
1699
+ });
1700
+ };
1701
+
1702
+ /**
1703
+ * Export Graph Schema
1704
+ * Export the schema of an existing graph in JSON, YAML, or Cypher format
1705
+ */
1706
+ export const exportGraphSchema = <ThrowOnError extends boolean = false>(options: Options<ExportGraphSchemaData, ThrowOnError>) => {
1707
+ return (options.client ?? _heyApiClient).get<ExportGraphSchemaResponses, ExportGraphSchemaErrors, ThrowOnError>({
1708
+ security: [
1709
+ {
1710
+ name: 'X-API-Key',
1711
+ type: 'apiKey'
1712
+ },
1713
+ {
1714
+ scheme: 'bearer',
1715
+ type: 'http'
1716
+ }
1717
+ ],
1718
+ url: '/v1/{graph_id}/schema/export',
1719
+ ...options
1720
+ });
1721
+ };
1722
+
1723
+ /**
1724
+ * List Available Schema Extensions
1725
+ * Get list of available schema extensions and compatibility groups
1726
+ */
1727
+ export const listSchemaExtensions = <ThrowOnError extends boolean = false>(options: Options<ListSchemaExtensionsData, ThrowOnError>) => {
1728
+ return (options.client ?? _heyApiClient).get<ListSchemaExtensionsResponses, ListSchemaExtensionsErrors, ThrowOnError>({
1729
+ security: [
1730
+ {
1731
+ name: 'X-API-Key',
1732
+ type: 'apiKey'
1733
+ },
1734
+ {
1735
+ scheme: 'bearer',
1736
+ type: 'http'
1737
+ }
1738
+ ],
1739
+ url: '/v1/{graph_id}/schema/extensions',
1740
+ ...options
1741
+ });
1742
+ };
1743
+
1744
+ /**
1745
+ * Get Current Bill
1746
+ * Get current month's billing details for the graph.
1747
+ *
1748
+ * Returns comprehensive billing information including:
1749
+ * - **Credit Usage**: Consumed vs. allocated credits
1750
+ * - **Storage Charges**: Current storage usage and costs
1751
+ * - **Subscription Tier**: Current plan and features
1752
+ * - **Pro-rated Charges**: If plan changed mid-month
1753
+ * - **Estimated Total**: Current charges to date
1754
+ *
1755
+ * Billing calculations are updated hourly. Storage is measured in GB-months.
1756
+ *
1757
+ * ℹ️ No credits are consumed for viewing billing information.
1758
+ */
1759
+ export const getCurrentGraphBill = <ThrowOnError extends boolean = false>(options: Options<GetCurrentGraphBillData, ThrowOnError>) => {
1760
+ return (options.client ?? _heyApiClient).get<GetCurrentGraphBillResponses, GetCurrentGraphBillErrors, ThrowOnError>({
1761
+ security: [
1762
+ {
1763
+ name: 'X-API-Key',
1764
+ type: 'apiKey'
1765
+ },
1766
+ {
1767
+ scheme: 'bearer',
1768
+ type: 'http'
1769
+ }
1770
+ ],
1771
+ url: '/v1/{graph_id}/billing/current',
1772
+ ...options
1773
+ });
1774
+ };
1775
+
1776
+ /**
1777
+ * Get Monthly Bill
1778
+ * Get billing details for a specific month.
1779
+ *
1780
+ * Retrieve historical billing information for any previous month.
1781
+ * Useful for:
1782
+ * - Reconciling past charges
1783
+ * - Tracking usage trends
1784
+ * - Expense reporting
1785
+ * - Budget analysis
1786
+ *
1787
+ * Returns the same detailed breakdown as the current bill endpoint.
1788
+ *
1789
+ * ℹ️ No credits are consumed for viewing billing history.
1790
+ */
1791
+ export const getGraphMonthlyBill = <ThrowOnError extends boolean = false>(options: Options<GetGraphMonthlyBillData, ThrowOnError>) => {
1792
+ return (options.client ?? _heyApiClient).get<GetGraphMonthlyBillResponses, GetGraphMonthlyBillErrors, ThrowOnError>({
1793
+ security: [
1794
+ {
1795
+ name: 'X-API-Key',
1796
+ type: 'apiKey'
1797
+ },
1798
+ {
1799
+ scheme: 'bearer',
1800
+ type: 'http'
1801
+ }
1802
+ ],
1803
+ url: '/v1/{graph_id}/billing/history/{year}/{month}',
1804
+ ...options
1805
+ });
1806
+ };
1807
+
1808
+ /**
1809
+ * Get Billing History
1810
+ * Get billing history for the graph.
1811
+ *
1812
+ * Returns a chronological list of monthly bills, perfect for:
1813
+ * - Tracking spending trends over time
1814
+ * - Identifying usage patterns
1815
+ * - Budget forecasting
1816
+ * - Financial reporting
1817
+ *
1818
+ * Each month includes:
1819
+ * - Credit usage and overages
1820
+ * - Storage charges
1821
+ * - Total charges
1822
+ * - Usage metrics
1823
+ *
1824
+ * ℹ️ No credits are consumed for viewing billing history.
1825
+ */
1826
+ export const getGraphBillingHistory = <ThrowOnError extends boolean = false>(options: Options<GetGraphBillingHistoryData, ThrowOnError>) => {
1827
+ return (options.client ?? _heyApiClient).get<GetGraphBillingHistoryResponses, GetGraphBillingHistoryErrors, ThrowOnError>({
1828
+ security: [
1829
+ {
1830
+ name: 'X-API-Key',
1831
+ type: 'apiKey'
1832
+ },
1833
+ {
1834
+ scheme: 'bearer',
1835
+ type: 'http'
1836
+ }
1837
+ ],
1838
+ url: '/v1/{graph_id}/billing/history',
1839
+ ...options
1840
+ });
1841
+ };
1842
+
1843
+ /**
1844
+ * Get Usage Details
1845
+ * Get detailed usage metrics for the graph.
1846
+ *
1847
+ * Provides granular usage information including:
1848
+ * - **Daily Credit Consumption**: Track credit usage patterns
1849
+ * - **Storage Growth**: Monitor database size over time
1850
+ * - **Operation Breakdown**: Credits by operation type
1851
+ * - **Peak Usage Times**: Identify high-activity periods
1852
+ * - **API Call Volumes**: Request counts and patterns
1853
+ *
1854
+ * Useful for:
1855
+ * - Optimizing credit consumption
1856
+ * - Capacity planning
1857
+ * - Usage trend analysis
1858
+ * - Cost optimization
1859
+ *
1860
+ * ℹ️ No credits are consumed for viewing usage details.
1861
+ */
1862
+ export const getGraphUsageDetails = <ThrowOnError extends boolean = false>(options: Options<GetGraphUsageDetailsData, ThrowOnError>) => {
1863
+ return (options.client ?? _heyApiClient).get<GetGraphUsageDetailsResponses, GetGraphUsageDetailsErrors, ThrowOnError>({
1864
+ security: [
1865
+ {
1866
+ name: 'X-API-Key',
1867
+ type: 'apiKey'
1868
+ },
1869
+ {
1870
+ scheme: 'bearer',
1871
+ type: 'http'
1872
+ }
1873
+ ],
1874
+ url: '/v1/{graph_id}/billing/usage',
1875
+ ...options
1876
+ });
1877
+ };
1878
+
1879
+ /**
1880
+ * Get Graph Pricing Info
1881
+ * Get pricing information for a specific graph database.
1882
+ */
1883
+ export const getGraphPricingInfoV1GraphIdBillingPricingGet = <ThrowOnError extends boolean = false>(options: Options<GetGraphPricingInfoV1GraphIdBillingPricingGetData, ThrowOnError>) => {
1884
+ return (options.client ?? _heyApiClient).get<GetGraphPricingInfoV1GraphIdBillingPricingGetResponses, GetGraphPricingInfoV1GraphIdBillingPricingGetErrors, ThrowOnError>({
1885
+ security: [
1886
+ {
1887
+ name: 'X-API-Key',
1888
+ type: 'apiKey'
1889
+ },
1890
+ {
1891
+ scheme: 'bearer',
1892
+ type: 'http'
1893
+ }
1894
+ ],
1895
+ url: '/v1/{graph_id}/billing/pricing',
1896
+ ...options
1897
+ });
1898
+ };
1899
+
1900
+ /**
1901
+ * Upgrade Graph Subscription
1902
+ * Upgrade subscription for a specific graph database.
1903
+ */
1904
+ export const upgradeGraphSubscriptionV1GraphIdBillingSubscriptionUpgradePost = <ThrowOnError extends boolean = false>(options: Options<UpgradeGraphSubscriptionV1GraphIdBillingSubscriptionUpgradePostData, ThrowOnError>) => {
1905
+ return (options.client ?? _heyApiClient).post<UpgradeGraphSubscriptionV1GraphIdBillingSubscriptionUpgradePostResponses, UpgradeGraphSubscriptionV1GraphIdBillingSubscriptionUpgradePostErrors, ThrowOnError>({
1906
+ security: [
1907
+ {
1908
+ name: 'X-API-Key',
1909
+ type: 'apiKey'
1910
+ },
1911
+ {
1912
+ scheme: 'bearer',
1913
+ type: 'http'
1914
+ }
1915
+ ],
1916
+ url: '/v1/{graph_id}/billing/subscription/upgrade',
1917
+ ...options,
1918
+ headers: {
1919
+ 'Content-Type': 'application/json',
1920
+ ...options.headers
1921
+ }
1922
+ });
1923
+ };
1924
+
1925
+ /**
1926
+ * Get Graph Subscription
1927
+ * Get current subscription for a graph database.
1928
+ */
1929
+ export const getGraphSubscriptionV1GraphIdBillingSubscriptionGet = <ThrowOnError extends boolean = false>(options: Options<GetGraphSubscriptionV1GraphIdBillingSubscriptionGetData, ThrowOnError>) => {
1930
+ return (options.client ?? _heyApiClient).get<GetGraphSubscriptionV1GraphIdBillingSubscriptionGetResponses, GetGraphSubscriptionV1GraphIdBillingSubscriptionGetErrors, ThrowOnError>({
1931
+ security: [
1932
+ {
1933
+ name: 'X-API-Key',
1934
+ type: 'apiKey'
1935
+ },
1936
+ {
1937
+ scheme: 'bearer',
1938
+ type: 'http'
1939
+ }
1940
+ ],
1941
+ url: '/v1/{graph_id}/billing/subscription',
1942
+ ...options
1943
+ });
1944
+ };
1945
+
1946
+ /**
1947
+ * Get Available Subscription Plans
1948
+ * Get available subscription plans for upgrade.
1949
+ */
1950
+ export const getAvailableSubscriptionPlansV1GraphIdBillingAvailablePlansGet = <ThrowOnError extends boolean = false>(options: Options<GetAvailableSubscriptionPlansV1GraphIdBillingAvailablePlansGetData, ThrowOnError>) => {
1951
+ return (options.client ?? _heyApiClient).get<GetAvailableSubscriptionPlansV1GraphIdBillingAvailablePlansGetResponses, GetAvailableSubscriptionPlansV1GraphIdBillingAvailablePlansGetErrors, ThrowOnError>({
1952
+ security: [
1953
+ {
1954
+ name: 'X-API-Key',
1955
+ type: 'apiKey'
1956
+ },
1957
+ {
1958
+ scheme: 'bearer',
1959
+ type: 'http'
1960
+ }
1961
+ ],
1962
+ url: '/v1/{graph_id}/billing/available-plans',
1963
+ ...options
1964
+ });
1965
+ };
1966
+
1967
+ /**
1968
+ * Get Credit Billing Info
1969
+ * Get credit-based billing information for a specific graph.
1970
+ *
1971
+ * This endpoint provides comprehensive credit usage and billing information
1972
+ * without consuming credits (for billing transparency).
1973
+ */
1974
+ export const getCreditBillingInfoV1GraphIdBillingCreditsGet = <ThrowOnError extends boolean = false>(options: Options<GetCreditBillingInfoV1GraphIdBillingCreditsGetData, ThrowOnError>) => {
1975
+ return (options.client ?? _heyApiClient).get<GetCreditBillingInfoV1GraphIdBillingCreditsGetResponses, GetCreditBillingInfoV1GraphIdBillingCreditsGetErrors, ThrowOnError>({
1976
+ security: [
1977
+ {
1978
+ name: 'X-API-Key',
1979
+ type: 'apiKey'
1980
+ },
1981
+ {
1982
+ scheme: 'bearer',
1983
+ type: 'http'
1984
+ }
1985
+ ],
1986
+ url: '/v1/{graph_id}/billing/credits',
1987
+ ...options
1988
+ });
1989
+ };
1990
+
1991
+ /**
1992
+ * Get Credit Summary
1993
+ * Retrieve comprehensive credit usage summary for the specified graph.
1994
+ *
1995
+ * This endpoint provides:
1996
+ * - Current credit balance and monthly allocation
1997
+ * - Credit consumption metrics for the current month
1998
+ * - Graph tier and credit multiplier information
1999
+ * - Usage percentage to help monitor credit consumption
2000
+ *
2001
+ * No credits are consumed for checking credit status.
2002
+ */
2003
+ export const getCreditSummary = <ThrowOnError extends boolean = false>(options: Options<GetCreditSummaryData, ThrowOnError>) => {
2004
+ return (options.client ?? _heyApiClient).get<GetCreditSummaryResponses, GetCreditSummaryErrors, ThrowOnError>({
2005
+ security: [
2006
+ {
2007
+ name: 'X-API-Key',
2008
+ type: 'apiKey'
2009
+ },
2010
+ {
2011
+ scheme: 'bearer',
2012
+ type: 'http'
2013
+ }
2014
+ ],
2015
+ url: '/v1/{graph_id}/credits/summary',
2016
+ ...options
2017
+ });
2018
+ };
2019
+
2020
+ /**
2021
+ * List Credit Transactions
2022
+ * Retrieve detailed credit transaction history for the specified graph.
2023
+ *
2024
+ * This enhanced endpoint provides:
2025
+ * - Detailed transaction records with idempotency information
2026
+ * - Summary by operation type to identify high-consumption operations
2027
+ * - Date range filtering for analysis
2028
+ * - Metadata search capabilities
2029
+ *
2030
+ * Transaction types include:
2031
+ * - ALLOCATION: Monthly credit allocations
2032
+ * - CONSUMPTION: Credit usage for operations
2033
+ * - BONUS: Bonus credits added by admins
2034
+ * - REFUND: Credit refunds
2035
+ *
2036
+ * No credits are consumed for viewing transaction history.
2037
+ */
2038
+ export const listCreditTransactions = <ThrowOnError extends boolean = false>(options: Options<ListCreditTransactionsData, ThrowOnError>) => {
2039
+ return (options.client ?? _heyApiClient).get<ListCreditTransactionsResponses, ListCreditTransactionsErrors, ThrowOnError>({
2040
+ security: [
2041
+ {
2042
+ name: 'X-API-Key',
2043
+ type: 'apiKey'
2044
+ },
2045
+ {
2046
+ scheme: 'bearer',
2047
+ type: 'http'
2048
+ }
2049
+ ],
2050
+ url: '/v1/{graph_id}/credits/transactions',
2051
+ ...options
2052
+ });
2053
+ };
2054
+
2055
+ /**
2056
+ * Check Credit Balance
2057
+ * Check if the graph has sufficient credits for a planned operation.
2058
+ *
2059
+ * This endpoint allows you to verify credit availability before performing
2060
+ * an operation, helping prevent failed operations due to insufficient credits.
2061
+ *
2062
+ * The check considers:
2063
+ * - Base operation cost
2064
+ * - Graph tier multiplier
2065
+ * - Current credit balance
2066
+ *
2067
+ * No credits are consumed for checking availability.
2068
+ */
2069
+ export const checkCreditBalance = <ThrowOnError extends boolean = false>(options: Options<CheckCreditBalanceData, ThrowOnError>) => {
2070
+ return (options.client ?? _heyApiClient).post<CheckCreditBalanceResponses, CheckCreditBalanceErrors, ThrowOnError>({
2071
+ security: [
2072
+ {
2073
+ name: 'X-API-Key',
2074
+ type: 'apiKey'
2075
+ },
2076
+ {
2077
+ scheme: 'bearer',
2078
+ type: 'http'
2079
+ }
2080
+ ],
2081
+ url: '/v1/{graph_id}/credits/check',
2082
+ ...options,
2083
+ headers: {
2084
+ 'Content-Type': 'application/json',
2085
+ ...options.headers
2086
+ }
2087
+ });
2088
+ };
2089
+
2090
+ /**
2091
+ * Get Storage Usage
2092
+ * Get storage usage history for a graph.
2093
+ *
2094
+ * Returns detailed storage usage information including:
2095
+ * - Daily average storage consumption
2096
+ * - Storage trends over time
2097
+ * - Credit costs for storage
2098
+ * - Current storage billing information
2099
+ *
2100
+ * This endpoint helps users understand their storage patterns
2101
+ * and associated credit costs.
2102
+ */
2103
+ export const getStorageUsage = <ThrowOnError extends boolean = false>(options: Options<GetStorageUsageData, ThrowOnError>) => {
2104
+ return (options.client ?? _heyApiClient).get<GetStorageUsageResponses, GetStorageUsageErrors, ThrowOnError>({
2105
+ security: [
2106
+ {
2107
+ name: 'X-API-Key',
2108
+ type: 'apiKey'
2109
+ },
2110
+ {
2111
+ scheme: 'bearer',
2112
+ type: 'http'
2113
+ }
2114
+ ],
2115
+ url: '/v1/{graph_id}/credits/storage/usage',
2116
+ ...options
2117
+ });
2118
+ };
2119
+
2120
+ /**
2121
+ * Check Storage Limits
2122
+ * Check storage limits and usage for a graph.
2123
+ *
2124
+ * Returns comprehensive storage limit information including:
2125
+ * - Current storage usage
2126
+ * - Effective limit (override or default)
2127
+ * - Usage percentage and warnings
2128
+ * - Recommendations for limit management
2129
+ *
2130
+ * This endpoint helps users monitor storage usage and plan for potential
2131
+ * limit increases. No credits are consumed for checking storage limits.
2132
+ */
2133
+ export const checkStorageLimits = <ThrowOnError extends boolean = false>(options: Options<CheckStorageLimitsData, ThrowOnError>) => {
2134
+ return (options.client ?? _heyApiClient).get<CheckStorageLimitsResponses, CheckStorageLimitsErrors, ThrowOnError>({
2135
+ security: [
2136
+ {
2137
+ name: 'X-API-Key',
2138
+ type: 'apiKey'
2139
+ },
2140
+ {
2141
+ scheme: 'bearer',
2142
+ type: 'http'
2143
+ }
2144
+ ],
2145
+ url: '/v1/{graph_id}/credits/storage/limits',
2146
+ ...options
2147
+ });
2148
+ };
2149
+
2150
+ /**
2151
+ * Database Health Check
2152
+ * Get comprehensive health information for the graph database.
2153
+ *
2154
+ * Returns detailed health metrics including:
2155
+ * - **Connection Status**: Database connectivity and responsiveness
2156
+ * - **Performance Metrics**: Query execution times and throughput
2157
+ * - **Resource Usage**: Memory and storage utilization
2158
+ * - **Error Monitoring**: Recent error rates and patterns
2159
+ * - **Uptime Statistics**: Service availability metrics
2160
+ *
2161
+ * Health indicators:
2162
+ * - **Status**: healthy, degraded, or unhealthy
2163
+ * - **Query Performance**: Average execution times
2164
+ * - **Error Rates**: Recent failure percentages
2165
+ * - **Resource Usage**: Memory and storage consumption
2166
+ * - **Alerts**: Active warnings or issues
2167
+ *
2168
+ * This endpoint provides essential monitoring data for operational visibility.
2169
+ */
2170
+ export const getDatabaseHealth = <ThrowOnError extends boolean = false>(options: Options<GetDatabaseHealthData, ThrowOnError>) => {
2171
+ return (options.client ?? _heyApiClient).get<GetDatabaseHealthResponses, GetDatabaseHealthErrors, ThrowOnError>({
2172
+ security: [
2173
+ {
2174
+ name: 'X-API-Key',
2175
+ type: 'apiKey'
2176
+ },
2177
+ {
2178
+ scheme: 'bearer',
2179
+ type: 'http'
2180
+ }
2181
+ ],
2182
+ url: '/v1/{graph_id}/status/health',
2183
+ ...options
2184
+ });
2185
+ };
2186
+
2187
+ /**
2188
+ * Database Information
2189
+ * Get comprehensive database information and statistics.
2190
+ *
2191
+ * Returns detailed database metrics including:
2192
+ * - **Database Metadata**: Name, path, size, and timestamps
2193
+ * - **Schema Information**: Node labels, relationship types, and counts
2194
+ * - **Storage Statistics**: Database size and usage metrics
2195
+ * - **Data Composition**: Node and relationship counts
2196
+ * - **Backup Information**: Available backups and last backup date
2197
+ * - **Configuration**: Read-only status and schema version
2198
+ *
2199
+ * Database statistics:
2200
+ * - **Size**: Storage usage in bytes and MB
2201
+ * - **Content**: Node and relationship counts
2202
+ * - **Schema**: Available labels and relationship types
2203
+ * - **Backup Status**: Backup availability and recency
2204
+ * - **Timestamps**: Creation and modification dates
2205
+ *
2206
+ * This endpoint provides essential database information for capacity planning and monitoring.
2207
+ */
2208
+ export const getDatabaseInfo = <ThrowOnError extends boolean = false>(options: Options<GetDatabaseInfoData, ThrowOnError>) => {
2209
+ return (options.client ?? _heyApiClient).get<GetDatabaseInfoResponses, GetDatabaseInfoErrors, ThrowOnError>({
2210
+ security: [
2211
+ {
2212
+ name: 'X-API-Key',
2213
+ type: 'apiKey'
2214
+ },
2215
+ {
2216
+ scheme: 'bearer',
2217
+ type: 'http'
2218
+ }
2219
+ ],
2220
+ url: '/v1/{graph_id}/status/info',
2221
+ ...options
2222
+ });
2223
+ };
2224
+
2225
+ /**
2226
+ * List Subgraphs
2227
+ * List all subgraphs for a parent graph.
2228
+ *
2229
+ * **Requirements:**
2230
+ * - User must have at least read access to parent graph
2231
+ *
2232
+ * **Response includes:**
2233
+ * - List of all subgraphs with metadata
2234
+ * - Current usage vs limits
2235
+ * - Size and statistics per subgraph
2236
+ * - Creation timestamps
2237
+ *
2238
+ * **Filtering:**
2239
+ * Currently returns all subgraphs. Future versions will support:
2240
+ * - Filtering by status
2241
+ * - Filtering by creation date
2242
+ * - Pagination for large lists
2243
+ */
2244
+ export const listSubgraphs = <ThrowOnError extends boolean = false>(options: Options<ListSubgraphsData, ThrowOnError>) => {
2245
+ return (options.client ?? _heyApiClient).get<ListSubgraphsResponses, ListSubgraphsErrors, ThrowOnError>({
2246
+ security: [
2247
+ {
2248
+ name: 'X-API-Key',
2249
+ type: 'apiKey'
2250
+ },
2251
+ {
2252
+ scheme: 'bearer',
2253
+ type: 'http'
2254
+ }
2255
+ ],
2256
+ url: '/v1/{graph_id}/subgraphs',
2257
+ ...options
2258
+ });
2259
+ };
2260
+
2261
+ /**
2262
+ * Create New Subgraph
2263
+ * Create a new subgraph database under an Enterprise or Premium parent graph.
2264
+ *
2265
+ * **Requirements:**
2266
+ * - Parent graph must be Enterprise or Premium tier
2267
+ * - User must have admin access to parent graph
2268
+ * - Subgraph name must be unique within parent
2269
+ * - Subgraph name must be alphanumeric (1-20 chars)
2270
+ *
2271
+ * **Subgraph Benefits:**
2272
+ * - Shares parent's infrastructure (no additional cost)
2273
+ * - Inherits parent's credit pool
2274
+ * - Isolated database on same instance
2275
+ * - Full Kuzu database capabilities
2276
+ *
2277
+ * **Use Cases:**
2278
+ * - Separate environments (dev/staging/prod)
2279
+ * - Department-specific data isolation
2280
+ * - Multi-tenant applications
2281
+ * - Testing and experimentation
2282
+ *
2283
+ * **Schema Inheritance:**
2284
+ * - Subgraphs can use parent's schema or custom extensions
2285
+ * - Extensions are additive only
2286
+ * - Base schema always included
2287
+ *
2288
+ * **Limits:**
2289
+ * - Standard: Not supported (0 subgraphs)
2290
+ * - Enterprise: Configurable limit (default: 10 subgraphs)
2291
+ * - Premium: Unlimited subgraphs
2292
+ * - Limits are defined in deployment configuration
2293
+ *
2294
+ * **Response includes:**
2295
+ * - `graph_id`: Full subgraph identifier
2296
+ * - `parent_graph_id`: Parent graph ID
2297
+ * - `subgraph_name`: Short name within parent
2298
+ * - `status`: Creation status
2299
+ */
2300
+ export const createSubgraph = <ThrowOnError extends boolean = false>(options: Options<CreateSubgraphData, ThrowOnError>) => {
2301
+ return (options.client ?? _heyApiClient).post<CreateSubgraphResponses, CreateSubgraphErrors, ThrowOnError>({
2302
+ security: [
2303
+ {
2304
+ name: 'X-API-Key',
2305
+ type: 'apiKey'
2306
+ },
2307
+ {
2308
+ scheme: 'bearer',
2309
+ type: 'http'
2310
+ }
2311
+ ],
2312
+ url: '/v1/{graph_id}/subgraphs',
2313
+ ...options,
2314
+ headers: {
2315
+ 'Content-Type': 'application/json',
2316
+ ...options.headers
2317
+ }
2318
+ });
2319
+ };
2320
+
2321
+ /**
2322
+ * Delete Subgraph
2323
+ * Delete a subgraph database.
2324
+ *
2325
+ * **Requirements:**
2326
+ * - Must be a valid subgraph (not parent graph)
2327
+ * - User must have admin access to parent graph
2328
+ * - Optional backup before deletion
2329
+ *
2330
+ * **Deletion Options:**
2331
+ * - `force`: Delete even if contains data
2332
+ * - `backup_first`: Create backup before deletion
2333
+ *
2334
+ * **Warning:**
2335
+ * Deletion is permanent unless backup is created.
2336
+ * All data in the subgraph will be lost.
2337
+ *
2338
+ * **Backup Location:**
2339
+ * If backup requested, stored in S3 at:
2340
+ * `s3://robosystems-backups/{instance_id}/{database_name}_{timestamp}.backup`
2341
+ */
2342
+ export const deleteSubgraph = <ThrowOnError extends boolean = false>(options: Options<DeleteSubgraphData, ThrowOnError>) => {
2343
+ return (options.client ?? _heyApiClient).delete<DeleteSubgraphResponses, DeleteSubgraphErrors, ThrowOnError>({
2344
+ security: [
2345
+ {
2346
+ name: 'X-API-Key',
2347
+ type: 'apiKey'
2348
+ },
2349
+ {
2350
+ scheme: 'bearer',
2351
+ type: 'http'
2352
+ }
2353
+ ],
2354
+ url: '/v1/{graph_id}/subgraphs/{subgraph_name}',
2355
+ ...options,
2356
+ headers: {
2357
+ 'Content-Type': 'application/json',
2358
+ ...options.headers
2359
+ }
2360
+ });
2361
+ };
2362
+
2363
+ /**
2364
+ * Get Subgraph Quota
2365
+ * Get subgraph quota and usage information for a parent graph.
2366
+ *
2367
+ * **Shows:**
2368
+ * - Current subgraph count
2369
+ * - Maximum allowed subgraphs per tier
2370
+ * - Remaining capacity
2371
+ * - Total size usage across all subgraphs
2372
+ *
2373
+ * **Tier Limits:**
2374
+ * - Standard: 0 subgraphs (not supported)
2375
+ * - Enterprise: Configurable limit (default: 10 subgraphs)
2376
+ * - Premium: Unlimited subgraphs
2377
+ * - Limits are defined in deployment configuration
2378
+ *
2379
+ * **Size Tracking:**
2380
+ * Provides aggregate size metrics when available.
2381
+ * Individual subgraph sizes shown in list endpoint.
2382
+ */
2383
+ export const getSubgraphQuota = <ThrowOnError extends boolean = false>(options: Options<GetSubgraphQuotaData, ThrowOnError>) => {
2384
+ return (options.client ?? _heyApiClient).get<GetSubgraphQuotaResponses, GetSubgraphQuotaErrors, ThrowOnError>({
2385
+ security: [
2386
+ {
2387
+ name: 'X-API-Key',
2388
+ type: 'apiKey'
2389
+ },
2390
+ {
2391
+ scheme: 'bearer',
2392
+ type: 'http'
2393
+ }
2394
+ ],
2395
+ url: '/v1/{graph_id}/subgraphs/quota',
2396
+ ...options
2397
+ });
2398
+ };
2399
+
2400
+ /**
2401
+ * Get Subgraph Details
2402
+ * Get detailed information about a specific subgraph.
2403
+ *
2404
+ * **Requirements:**
2405
+ * - User must have read access to parent graph
2406
+ *
2407
+ * **Response includes:**
2408
+ * - Full subgraph metadata
2409
+ * - Database statistics (nodes, edges)
2410
+ * - Size information
2411
+ * - Schema configuration
2412
+ * - Creation/modification timestamps
2413
+ * - Last access time (when available)
2414
+ *
2415
+ * **Statistics:**
2416
+ * Real-time statistics queried from Kuzu:
2417
+ * - Node count
2418
+ * - Edge count
2419
+ * - Database size on disk
2420
+ * - Schema information
2421
+ */
2422
+ export const getSubgraphInfo = <ThrowOnError extends boolean = false>(options: Options<GetSubgraphInfoData, ThrowOnError>) => {
2423
+ return (options.client ?? _heyApiClient).get<GetSubgraphInfoResponses, GetSubgraphInfoErrors, ThrowOnError>({
2424
+ security: [
2425
+ {
2426
+ name: 'X-API-Key',
2427
+ type: 'apiKey'
2428
+ },
2429
+ {
2430
+ scheme: 'bearer',
2431
+ type: 'http'
2432
+ }
2433
+ ],
2434
+ url: '/v1/{graph_id}/subgraphs/{subgraph_name}/info',
2435
+ ...options
2436
+ });
2437
+ };
2438
+
2439
+ /**
2440
+ * Create New Graph Database
2441
+ * Create a new graph database with specified schema and optionally an initial entity.
2442
+ *
2443
+ * This endpoint starts an asynchronous graph creation operation and returns
2444
+ * connection details for monitoring progress via Server-Sent Events (SSE).
2445
+ *
2446
+ * **Operation Types:**
2447
+ * - **Generic Graph**: Creates empty graph with schema extensions
2448
+ * - **Entity Graph**: Creates graph with initial entity data
2449
+ *
2450
+ * **Monitoring Progress:**
2451
+ * Use the returned `operation_id` to connect to the SSE stream:
2452
+ * ```javascript
2453
+ * const eventSource = new EventSource('/v1/operations/{operation_id}/stream');
2454
+ * eventSource.onmessage = (event) => {
2455
+ * const data = JSON.parse(event.data);
2456
+ * console.log('Progress:', data.progress_percent + '%');
2457
+ * };
2458
+ * ```
2459
+ *
2460
+ * **SSE Connection Limits:**
2461
+ * - Maximum 5 concurrent SSE connections per user
2462
+ * - Rate limited to 10 new connections per minute
2463
+ * - Automatic circuit breaker for Redis failures
2464
+ * - Graceful degradation if event system unavailable
2465
+ *
2466
+ * **Events Emitted:**
2467
+ * - `operation_started`: Graph creation begins
2468
+ * - `operation_progress`: Schema loading, database setup, etc.
2469
+ * - `operation_completed`: Graph ready with connection details
2470
+ * - `operation_error`: Creation failed with error details
2471
+ *
2472
+ * **Error Handling:**
2473
+ * - `429 Too Many Requests`: SSE connection limit exceeded
2474
+ * - `503 Service Unavailable`: SSE system temporarily disabled
2475
+ * - Clients should implement exponential backoff on errors
2476
+ *
2477
+ * **Response includes:**
2478
+ * - `operation_id`: Unique identifier for monitoring
2479
+ * - `_links.stream`: SSE endpoint for real-time updates
2480
+ * - `_links.status`: Point-in-time status check endpoint
2481
+ */
2482
+ export const createGraph = <ThrowOnError extends boolean = false>(options: Options<CreateGraphData, ThrowOnError>) => {
2483
+ return (options.client ?? _heyApiClient).post<CreateGraphResponses, CreateGraphErrors, ThrowOnError>({
2484
+ security: [
2485
+ {
2486
+ name: 'X-API-Key',
2487
+ type: 'apiKey'
2488
+ },
2489
+ {
2490
+ scheme: 'bearer',
2491
+ type: 'http'
2492
+ }
2493
+ ],
2494
+ url: '/v1/create/graph',
2495
+ ...options,
2496
+ headers: {
2497
+ 'Content-Type': 'application/json',
2498
+ ...options.headers
2499
+ }
2500
+ });
2501
+ };
2502
+
2503
+ /**
2504
+ * Get Available Schema Extensions
2505
+ * List all available schema extensions for graph creation
2506
+ */
2507
+ export const getAvailableExtensions = <ThrowOnError extends boolean = false>(options?: Options<GetAvailableExtensionsData, ThrowOnError>) => {
2508
+ return (options?.client ?? _heyApiClient).get<GetAvailableExtensionsResponses, unknown, ThrowOnError>({
2509
+ security: [
2510
+ {
2511
+ name: 'X-API-Key',
2512
+ type: 'apiKey'
2513
+ },
2514
+ {
2515
+ scheme: 'bearer',
2516
+ type: 'http'
2517
+ }
2518
+ ],
2519
+ url: '/v1/create/graph/extensions',
2520
+ ...options
2521
+ });
2522
+ };
2523
+
2524
+ /**
2525
+ * Get Service Offerings
2526
+ * Get comprehensive information about all subscription offerings.
2527
+ *
2528
+ * This endpoint provides complete information about both graph database subscriptions
2529
+ * and shared repository subscriptions. This is the primary endpoint for frontend
2530
+ * applications to display subscription options.
2531
+ *
2532
+ * Includes:
2533
+ * - Graph subscription tiers (standard, enterprise, premium)
2534
+ * - Shared repository subscriptions (SEC, industry, economic data)
2535
+ * - Operation costs and credit information
2536
+ * - Features and capabilities for each tier
2537
+ * - Enabled/disabled status for repositories
2538
+ *
2539
+ * All data comes from the config-based systems to ensure accuracy with backend behavior.
2540
+ *
2541
+ * No authentication required - this is public service information.
2542
+ */
2543
+ export const getServiceOfferings = <ThrowOnError extends boolean = false>(options?: Options<GetServiceOfferingsData, ThrowOnError>) => {
2544
+ return (options?.client ?? _heyApiClient).get<GetServiceOfferingsResponses, GetServiceOfferingsErrors, ThrowOnError>({
2545
+ url: '/v1/offering',
2546
+ ...options
2547
+ });
2548
+ };
2549
+
2550
+ /**
2551
+ * Stream Operation Events
2552
+ * Stream real-time events for an operation using Server-Sent Events (SSE).
2553
+ *
2554
+ * This endpoint provides real-time monitoring for all non-immediate operations including:
2555
+ * - Graph creation and management
2556
+ * - Agent analysis processing
2557
+ * - Database backups and restores
2558
+ * - Data synchronization tasks
2559
+ *
2560
+ * **Event Types:**
2561
+ * - `operation_started`: Operation began execution
2562
+ * - `operation_progress`: Progress update with details
2563
+ * - `operation_completed`: Operation finished successfully
2564
+ * - `operation_error`: Operation failed with error details
2565
+ * - `operation_cancelled`: Operation was cancelled
2566
+ *
2567
+ * **Features:**
2568
+ * - **Event Replay**: Use `from_sequence` parameter to replay missed events
2569
+ * - **Automatic Reconnection**: Client can reconnect and resume from last seen event
2570
+ * - **Real-time Updates**: Live progress updates during execution
2571
+ * - **Timeout Handling**: 30-second keepalive messages prevent connection timeouts
2572
+ * - **Graceful Degradation**: Automatic fallback if Redis is unavailable
2573
+ *
2574
+ * **Connection Limits:**
2575
+ * - Maximum 5 concurrent SSE connections per user
2576
+ * - Rate limited to 10 new connections per minute
2577
+ * - Automatic cleanup of stale connections
2578
+ * - Circuit breaker protection for Redis failures
2579
+ *
2580
+ * **Client Usage:**
2581
+ * ```javascript
2582
+ * const eventSource = new EventSource('/v1/operations/abc123/stream');
2583
+ * eventSource.onmessage = (event) => {
2584
+ * const data = JSON.parse(event.data);
2585
+ * console.log('Progress:', data);
2586
+ * };
2587
+ * eventSource.onerror = (error) => {
2588
+ * // Handle connection errors or rate limits
2589
+ * console.error('SSE Error:', error);
2590
+ * };
2591
+ * ```
2592
+ *
2593
+ * **Error Handling:**
2594
+ * - `429 Too Many Requests`: Connection limit or rate limit exceeded
2595
+ * - `503 Service Unavailable`: SSE system temporarily disabled
2596
+ * - Clients should implement exponential backoff on errors
2597
+ *
2598
+ * **No credits are consumed for SSE connections.**
2599
+ */
2600
+ export const streamOperationEvents = <ThrowOnError extends boolean = false>(options: Options<StreamOperationEventsData, ThrowOnError>) => {
2601
+ return (options.client ?? _heyApiClient).get<StreamOperationEventsResponses, StreamOperationEventsErrors, ThrowOnError>({
2602
+ security: [
2603
+ {
2604
+ name: 'X-API-Key',
2605
+ type: 'apiKey'
2606
+ },
2607
+ {
2608
+ scheme: 'bearer',
2609
+ type: 'http'
2610
+ }
2611
+ ],
2612
+ url: '/v1/operations/{operation_id}/stream',
2613
+ ...options
2614
+ });
2615
+ };
2616
+
2617
+ /**
2618
+ * Get Operation Status
2619
+ * Get current status and metadata for an operation.
2620
+ *
2621
+ * Returns detailed information including:
2622
+ * - Current status (pending, running, completed, failed, cancelled)
2623
+ * - Creation and update timestamps
2624
+ * - Operation type and associated graph
2625
+ * - Result data (for completed operations)
2626
+ * - Error details (for failed operations)
2627
+ *
2628
+ * This endpoint provides a point-in-time status check, while the `/stream` endpoint
2629
+ * provides real-time updates. Use this for polling or initial status checks.
2630
+ *
2631
+ * **No credits are consumed for status checks.**
2632
+ */
2633
+ export const getOperationStatus = <ThrowOnError extends boolean = false>(options: Options<GetOperationStatusData, ThrowOnError>) => {
2634
+ return (options.client ?? _heyApiClient).get<GetOperationStatusResponses, GetOperationStatusErrors, ThrowOnError>({
2635
+ security: [
2636
+ {
2637
+ name: 'X-API-Key',
2638
+ type: 'apiKey'
2639
+ },
2640
+ {
2641
+ scheme: 'bearer',
2642
+ type: 'http'
2643
+ }
2644
+ ],
2645
+ url: '/v1/operations/{operation_id}/status',
2646
+ ...options
2647
+ });
2648
+ };
2649
+
2650
+ /**
2651
+ * Cancel Operation
2652
+ * Cancel a pending or running operation.
2653
+ *
2654
+ * Cancels the specified operation if it's still in progress. Once cancelled,
2655
+ * the operation cannot be resumed and will emit a cancellation event to any
2656
+ * active SSE connections.
2657
+ *
2658
+ * **Note**: Completed or already failed operations cannot be cancelled.
2659
+ *
2660
+ * **No credits are consumed for cancellation requests.**
2661
+ */
2662
+ export const cancelOperation = <ThrowOnError extends boolean = false>(options: Options<CancelOperationData, ThrowOnError>) => {
2663
+ return (options.client ?? _heyApiClient).delete<CancelOperationResponses, CancelOperationErrors, ThrowOnError>({
2664
+ security: [
2665
+ {
2666
+ name: 'X-API-Key',
2667
+ type: 'apiKey'
2668
+ },
2669
+ {
2670
+ scheme: 'bearer',
2671
+ type: 'http'
2672
+ }
2673
+ ],
2674
+ url: '/v1/operations/{operation_id}',
2675
+ ...options
2676
+ });
2677
+ };