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