@neon/tools 0.4.0 → 0.6.0
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/README.md +55 -109
- package/dist/generated/zod.gen.d.ts +15 -0
- package/dist/generated/zod.gen.d.ts.map +1 -1
- package/dist/generated/zod.gen.js +12 -1
- package/dist/index.d.ts +24 -50
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -43
- package/dist/lib/ergonomic/bind.d.ts +54 -0
- package/dist/lib/ergonomic/bind.d.ts.map +1 -0
- package/dist/lib/ergonomic/bind.js +121 -0
- package/dist/lib/ergonomic/catalog.d.ts +2601 -0
- package/dist/lib/ergonomic/catalog.d.ts.map +1 -0
- package/dist/lib/ergonomic/catalog.js +703 -0
- package/dist/lib/ergonomic/composed.d.ts +450 -0
- package/dist/lib/ergonomic/composed.d.ts.map +1 -0
- package/dist/lib/ergonomic/composed.js +186 -0
- package/dist/lib/ergonomic/ids.d.ts +7 -0
- package/dist/lib/ergonomic/ids.d.ts.map +1 -0
- package/dist/lib/ergonomic/ids.js +122 -0
- package/dist/lib/ergonomic/index.d.ts +4 -0
- package/dist/lib/ergonomic/index.d.ts.map +1 -0
- package/dist/lib/ergonomic/index.js +4 -0
- package/dist/operations.gen.d.ts +9 -1
- package/dist/operations.gen.d.ts.map +1 -1
- package/dist/operations.gen.js +38 -3
- package/dist/schemas.d.ts +1 -1
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +2 -2
- package/package.json +3 -3
- package/dist/lib/workflows.d.ts +0 -315
- package/dist/lib/workflows.d.ts.map +0 -1
- package/dist/lib/workflows.js +0 -113
|
@@ -0,0 +1,703 @@
|
|
|
1
|
+
import { decodeBase64 } from "../binary.js";
|
|
2
|
+
import { bindTool, collectObjectList, collectPages, fromGenerated } from "./bind.js";
|
|
3
|
+
import { connectionStringTool, createBranchWithComputeTool, createProjectAndConnectTool, getDefaultTool, restoreSnapshotTool, setScheduleTool } from "./composed.js";
|
|
4
|
+
import * as z from "zod";
|
|
5
|
+
//#region src/lib/ergonomic/catalog.ts
|
|
6
|
+
const logReadAnnotations = {
|
|
7
|
+
readOnlyHint: true,
|
|
8
|
+
destructiveHint: false,
|
|
9
|
+
idempotentHint: true,
|
|
10
|
+
openWorldHint: true
|
|
11
|
+
};
|
|
12
|
+
const toolFactories = {
|
|
13
|
+
"projects.list": (options) => fromGenerated(options, {
|
|
14
|
+
id: "projects.list",
|
|
15
|
+
generated: "listProjects",
|
|
16
|
+
omit: ["cursor"],
|
|
17
|
+
list: true,
|
|
18
|
+
run: (neon, input, signal) => collectPages(neon.projects.list({
|
|
19
|
+
limit: input.limit,
|
|
20
|
+
search: input.search,
|
|
21
|
+
org_id: input.org_id,
|
|
22
|
+
timeout: input.timeout,
|
|
23
|
+
recoverable: input.recoverable
|
|
24
|
+
}, { signal }), input.limit)
|
|
25
|
+
}),
|
|
26
|
+
"projects.get": (options) => fromGenerated(options, {
|
|
27
|
+
id: "projects.get",
|
|
28
|
+
generated: "getProject",
|
|
29
|
+
run: (neon, input, signal) => neon.projects.get(input.project_id, { signal })
|
|
30
|
+
}),
|
|
31
|
+
"projects.createAndConnect": createProjectAndConnectTool,
|
|
32
|
+
"projects.update": (options) => fromGenerated(options, {
|
|
33
|
+
id: "projects.update",
|
|
34
|
+
generated: "updateProject",
|
|
35
|
+
run: (neon, input, signal) => neon.projects.update(input.project_id, {
|
|
36
|
+
settings: input.settings,
|
|
37
|
+
name: input.name,
|
|
38
|
+
default_endpoint_settings: input.default_endpoint_settings,
|
|
39
|
+
history_retention_seconds: input.history_retention_seconds
|
|
40
|
+
}, { signal })
|
|
41
|
+
}),
|
|
42
|
+
"projects.delete": (options) => fromGenerated(options, {
|
|
43
|
+
id: "projects.delete",
|
|
44
|
+
generated: "deleteProject",
|
|
45
|
+
run: (neon, input, signal) => neon.projects.delete(input.project_id, { signal })
|
|
46
|
+
}),
|
|
47
|
+
"projects.recover": (options) => fromGenerated(options, {
|
|
48
|
+
id: "projects.recover",
|
|
49
|
+
generated: "recoverProject",
|
|
50
|
+
run: (neon, input, signal) => neon.projects.recover(input.project_id, { signal })
|
|
51
|
+
}),
|
|
52
|
+
"projects.transfer": (options) => fromGenerated(options, {
|
|
53
|
+
id: "projects.transfer",
|
|
54
|
+
generated: "transferProjectsFromOrgToOrg",
|
|
55
|
+
run: (neon, input, signal) => neon.projects.transfer({
|
|
56
|
+
fromOrgId: input.source_org_id,
|
|
57
|
+
toOrgId: input.destination_org_id,
|
|
58
|
+
projectIds: input.project_ids
|
|
59
|
+
}, { signal })
|
|
60
|
+
}),
|
|
61
|
+
"projects.transferFromUser": (options) => fromGenerated(options, {
|
|
62
|
+
id: "projects.transferFromUser",
|
|
63
|
+
generated: "transferProjectsFromUserToOrg",
|
|
64
|
+
run: (neon, input, signal) => neon.projects.transferFromUser({
|
|
65
|
+
toOrgId: input.destination_org_id,
|
|
66
|
+
projectIds: input.project_ids
|
|
67
|
+
}, { signal })
|
|
68
|
+
}),
|
|
69
|
+
"projects.permissions.list": (options) => fromGenerated(options, {
|
|
70
|
+
id: "projects.permissions.list",
|
|
71
|
+
generated: "listProjectPermissions",
|
|
72
|
+
run: (neon, input, signal) => neon.projects.permissions.list(input.project_id, { signal })
|
|
73
|
+
}),
|
|
74
|
+
"projects.permissions.grant": (options) => fromGenerated(options, {
|
|
75
|
+
id: "projects.permissions.grant",
|
|
76
|
+
generated: "grantPermissionToProject",
|
|
77
|
+
run: (neon, input, signal) => neon.projects.permissions.grant(input.project_id, input.email, { signal })
|
|
78
|
+
}),
|
|
79
|
+
"projects.permissions.revoke": (options) => fromGenerated(options, {
|
|
80
|
+
id: "projects.permissions.revoke",
|
|
81
|
+
generated: "revokePermissionFromProject",
|
|
82
|
+
run: (neon, input, signal) => neon.projects.permissions.revoke(input.project_id, input.permission_id, { signal })
|
|
83
|
+
}),
|
|
84
|
+
"projects.members.list": (options) => fromGenerated(options, {
|
|
85
|
+
id: "projects.members.list",
|
|
86
|
+
generated: "listProjectMembers",
|
|
87
|
+
omit: ["cursor"],
|
|
88
|
+
list: true,
|
|
89
|
+
run: (neon, input, signal) => collectPages(neon.projects.members.list(input.project_id, { limit: input.limit }, { signal }), input.limit)
|
|
90
|
+
}),
|
|
91
|
+
"projects.members.setRole": (options) => fromGenerated(options, {
|
|
92
|
+
id: "projects.members.setRole",
|
|
93
|
+
generated: "setProjectMemberRole",
|
|
94
|
+
run: (neon, input, signal) => neon.projects.members.setRole(input.project_id, input.member_id, input.role, {
|
|
95
|
+
signal,
|
|
96
|
+
...input.confirm_self_demotion ? { confirmSelfDemotion: true } : {}
|
|
97
|
+
})
|
|
98
|
+
}),
|
|
99
|
+
"projects.members.removeRole": (options) => fromGenerated(options, {
|
|
100
|
+
id: "projects.members.removeRole",
|
|
101
|
+
generated: "removeProjectMemberRole",
|
|
102
|
+
run: (neon, input, signal) => neon.projects.members.removeRole(input.project_id, input.member_id, {
|
|
103
|
+
signal,
|
|
104
|
+
...input.confirm_self_lockout ? { confirmSelfLockout: true } : {}
|
|
105
|
+
})
|
|
106
|
+
}),
|
|
107
|
+
"branches.list": (options) => fromGenerated(options, {
|
|
108
|
+
id: "branches.list",
|
|
109
|
+
generated: "listProjectBranches",
|
|
110
|
+
omit: ["cursor"],
|
|
111
|
+
list: true,
|
|
112
|
+
run: (neon, input, signal) => collectPages(neon.branches.list(input.project_id, {
|
|
113
|
+
search: input.search,
|
|
114
|
+
sort_by: input.sort_by,
|
|
115
|
+
sort_order: input.sort_order,
|
|
116
|
+
limit: input.limit,
|
|
117
|
+
include_deleted: input.include_deleted
|
|
118
|
+
}, { signal }), input.limit)
|
|
119
|
+
}),
|
|
120
|
+
"branches.get": (options) => fromGenerated(options, {
|
|
121
|
+
id: "branches.get",
|
|
122
|
+
generated: "getProjectBranch",
|
|
123
|
+
run: (neon, input, signal) => neon.branches.get(input.project_id, input.branch_id, { signal })
|
|
124
|
+
}),
|
|
125
|
+
"branches.createWithCompute": createBranchWithComputeTool,
|
|
126
|
+
"branches.update": (options) => fromGenerated(options, {
|
|
127
|
+
id: "branches.update",
|
|
128
|
+
generated: "updateProjectBranch",
|
|
129
|
+
run: (neon, input, signal) => neon.branches.update(input.project_id, input.branch_id, {
|
|
130
|
+
name: input.name,
|
|
131
|
+
protected: input.protected,
|
|
132
|
+
expires_at: input.expires_at
|
|
133
|
+
}, { signal })
|
|
134
|
+
}),
|
|
135
|
+
"branches.delete": (options) => fromGenerated(options, {
|
|
136
|
+
id: "branches.delete",
|
|
137
|
+
generated: "deleteProjectBranch",
|
|
138
|
+
omit: ["hard_delete"],
|
|
139
|
+
run: (neon, input, signal) => neon.branches.delete(input.project_id, input.branch_id, { signal })
|
|
140
|
+
}),
|
|
141
|
+
"branches.getDefault": getDefaultTool,
|
|
142
|
+
"branches.setDefault": (options) => fromGenerated(options, {
|
|
143
|
+
id: "branches.setDefault",
|
|
144
|
+
generated: "setDefaultProjectBranch",
|
|
145
|
+
run: (neon, input, signal) => neon.branches.setDefault(input.project_id, input.branch_id, { signal })
|
|
146
|
+
}),
|
|
147
|
+
"branches.finalizeRestore": (options) => fromGenerated(options, {
|
|
148
|
+
id: "branches.finalizeRestore",
|
|
149
|
+
generated: "finalizeRestoreBranch",
|
|
150
|
+
run: (neon, input, signal) => neon.branches.finalizeRestore(input.project_id, input.branch_id, { name: input.name }, { signal })
|
|
151
|
+
}),
|
|
152
|
+
"postgres.connectionString": connectionStringTool,
|
|
153
|
+
"postgres.endpoints.list": (options) => fromGenerated(options, {
|
|
154
|
+
id: "postgres.endpoints.list",
|
|
155
|
+
generated: "listProjectEndpoints",
|
|
156
|
+
run: (neon, input, signal) => neon.postgres.endpoints.list(input.project_id, { signal })
|
|
157
|
+
}),
|
|
158
|
+
"postgres.endpoints.listByBranch": (options) => fromGenerated(options, {
|
|
159
|
+
id: "postgres.endpoints.listByBranch",
|
|
160
|
+
generated: "listProjectBranchEndpoints",
|
|
161
|
+
run: (neon, input, signal) => neon.postgres.endpoints.listByBranch(input.project_id, input.branch_id, { signal })
|
|
162
|
+
}),
|
|
163
|
+
"postgres.endpoints.get": (options) => fromGenerated(options, {
|
|
164
|
+
id: "postgres.endpoints.get",
|
|
165
|
+
generated: "getProjectEndpoint",
|
|
166
|
+
run: (neon, input, signal) => neon.postgres.endpoints.get(input.project_id, input.endpoint_id, { signal })
|
|
167
|
+
}),
|
|
168
|
+
"postgres.endpoints.create": (options) => fromGenerated(options, {
|
|
169
|
+
id: "postgres.endpoints.create",
|
|
170
|
+
generated: "createProjectEndpoint",
|
|
171
|
+
run: (neon, input, signal) => neon.postgres.endpoints.create(input.project_id, {
|
|
172
|
+
branch_id: input.branch_id,
|
|
173
|
+
region_id: input.region_id,
|
|
174
|
+
type: input.type,
|
|
175
|
+
settings: input.settings,
|
|
176
|
+
autoscaling_limit_min_cu: input.autoscaling_limit_min_cu,
|
|
177
|
+
autoscaling_limit_max_cu: input.autoscaling_limit_max_cu,
|
|
178
|
+
provisioner: input.provisioner,
|
|
179
|
+
pooler_enabled: input.pooler_enabled,
|
|
180
|
+
pooler_mode: input.pooler_mode,
|
|
181
|
+
disabled: input.disabled,
|
|
182
|
+
passwordless_access: input.passwordless_access,
|
|
183
|
+
suspend_timeout_seconds: input.suspend_timeout_seconds,
|
|
184
|
+
name: input.name
|
|
185
|
+
}, { signal })
|
|
186
|
+
}),
|
|
187
|
+
"postgres.endpoints.update": (options) => fromGenerated(options, {
|
|
188
|
+
id: "postgres.endpoints.update",
|
|
189
|
+
generated: "updateProjectEndpoint",
|
|
190
|
+
run: (neon, input, signal) => neon.postgres.endpoints.update(input.project_id, input.endpoint_id, {
|
|
191
|
+
branch_id: input.branch_id,
|
|
192
|
+
autoscaling_limit_min_cu: input.autoscaling_limit_min_cu,
|
|
193
|
+
autoscaling_limit_max_cu: input.autoscaling_limit_max_cu,
|
|
194
|
+
provisioner: input.provisioner,
|
|
195
|
+
settings: input.settings,
|
|
196
|
+
pooler_enabled: input.pooler_enabled,
|
|
197
|
+
pooler_mode: input.pooler_mode,
|
|
198
|
+
disabled: input.disabled,
|
|
199
|
+
passwordless_access: input.passwordless_access,
|
|
200
|
+
suspend_timeout_seconds: input.suspend_timeout_seconds,
|
|
201
|
+
name: input.name
|
|
202
|
+
}, { signal })
|
|
203
|
+
}),
|
|
204
|
+
"postgres.endpoints.delete": (options) => fromGenerated(options, {
|
|
205
|
+
id: "postgres.endpoints.delete",
|
|
206
|
+
generated: "deleteProjectEndpoint",
|
|
207
|
+
run: (neon, input, signal) => neon.postgres.endpoints.delete(input.project_id, input.endpoint_id, { signal })
|
|
208
|
+
}),
|
|
209
|
+
"postgres.endpoints.start": (options) => fromGenerated(options, {
|
|
210
|
+
id: "postgres.endpoints.start",
|
|
211
|
+
generated: "startProjectEndpoint",
|
|
212
|
+
run: (neon, input, signal) => neon.postgres.endpoints.start(input.project_id, input.endpoint_id, { signal })
|
|
213
|
+
}),
|
|
214
|
+
"postgres.endpoints.suspend": (options) => fromGenerated(options, {
|
|
215
|
+
id: "postgres.endpoints.suspend",
|
|
216
|
+
generated: "suspendProjectEndpoint",
|
|
217
|
+
run: (neon, input, signal) => neon.postgres.endpoints.suspend(input.project_id, input.endpoint_id, { signal })
|
|
218
|
+
}),
|
|
219
|
+
"postgres.endpoints.restart": (options) => fromGenerated(options, {
|
|
220
|
+
id: "postgres.endpoints.restart",
|
|
221
|
+
generated: "restartProjectEndpoint",
|
|
222
|
+
run: (neon, input, signal) => neon.postgres.endpoints.restart(input.project_id, input.endpoint_id, { signal })
|
|
223
|
+
}),
|
|
224
|
+
"postgres.roles.list": (options) => fromGenerated(options, {
|
|
225
|
+
id: "postgres.roles.list",
|
|
226
|
+
generated: "listProjectBranchRoles",
|
|
227
|
+
run: (neon, input, signal) => neon.postgres.roles.list(input.project_id, input.branch_id, { signal })
|
|
228
|
+
}),
|
|
229
|
+
"postgres.roles.get": (options) => fromGenerated(options, {
|
|
230
|
+
id: "postgres.roles.get",
|
|
231
|
+
generated: "getProjectBranchRole",
|
|
232
|
+
run: (neon, input, signal) => neon.postgres.roles.get(input.project_id, input.branch_id, input.role_name, { signal })
|
|
233
|
+
}),
|
|
234
|
+
"postgres.roles.create": (options) => fromGenerated(options, {
|
|
235
|
+
id: "postgres.roles.create",
|
|
236
|
+
generated: "createProjectBranchRole",
|
|
237
|
+
run: (neon, input, signal) => neon.postgres.roles.create(input.project_id, input.branch_id, {
|
|
238
|
+
name: input.name,
|
|
239
|
+
no_login: input.no_login
|
|
240
|
+
}, { signal })
|
|
241
|
+
}),
|
|
242
|
+
"postgres.roles.delete": (options) => fromGenerated(options, {
|
|
243
|
+
id: "postgres.roles.delete",
|
|
244
|
+
generated: "deleteProjectBranchRole",
|
|
245
|
+
run: (neon, input, signal) => neon.postgres.roles.delete(input.project_id, input.branch_id, input.role_name, { signal })
|
|
246
|
+
}),
|
|
247
|
+
"postgres.roles.resetPassword": (options) => fromGenerated(options, {
|
|
248
|
+
id: "postgres.roles.resetPassword",
|
|
249
|
+
generated: "resetProjectBranchRolePassword",
|
|
250
|
+
run: (neon, input, signal) => neon.postgres.roles.resetPassword(input.project_id, input.branch_id, input.role_name, { signal })
|
|
251
|
+
}),
|
|
252
|
+
"postgres.databases.list": (options) => fromGenerated(options, {
|
|
253
|
+
id: "postgres.databases.list",
|
|
254
|
+
generated: "listProjectBranchDatabases",
|
|
255
|
+
run: (neon, input, signal) => neon.postgres.databases.list(input.project_id, input.branch_id, { signal })
|
|
256
|
+
}),
|
|
257
|
+
"postgres.databases.get": (options) => fromGenerated(options, {
|
|
258
|
+
id: "postgres.databases.get",
|
|
259
|
+
generated: "getProjectBranchDatabase",
|
|
260
|
+
run: (neon, input, signal) => neon.postgres.databases.get(input.project_id, input.branch_id, input.database_name, { signal })
|
|
261
|
+
}),
|
|
262
|
+
"postgres.databases.create": (options) => fromGenerated(options, {
|
|
263
|
+
id: "postgres.databases.create",
|
|
264
|
+
generated: "createProjectBranchDatabase",
|
|
265
|
+
run: (neon, input, signal) => neon.postgres.databases.create(input.project_id, input.branch_id, {
|
|
266
|
+
name: input.name,
|
|
267
|
+
owner_name: input.owner_name
|
|
268
|
+
}, { signal })
|
|
269
|
+
}),
|
|
270
|
+
"postgres.databases.update": (options) => fromGenerated(options, {
|
|
271
|
+
id: "postgres.databases.update",
|
|
272
|
+
generated: "updateProjectBranchDatabase",
|
|
273
|
+
run: (neon, input, signal) => neon.postgres.databases.update(input.project_id, input.branch_id, input.database_name, {
|
|
274
|
+
name: input.name,
|
|
275
|
+
owner_name: input.owner_name
|
|
276
|
+
}, { signal })
|
|
277
|
+
}),
|
|
278
|
+
"postgres.databases.delete": (options) => fromGenerated(options, {
|
|
279
|
+
id: "postgres.databases.delete",
|
|
280
|
+
generated: "deleteProjectBranchDatabase",
|
|
281
|
+
run: (neon, input, signal) => neon.postgres.databases.delete(input.project_id, input.branch_id, input.database_name, { signal })
|
|
282
|
+
}),
|
|
283
|
+
"postgres.dataApi.get": (options) => fromGenerated(options, {
|
|
284
|
+
id: "postgres.dataApi.get",
|
|
285
|
+
generated: "getProjectBranchDataAPI",
|
|
286
|
+
run: (neon, input, signal) => neon.postgres.dataApi.get(input.project_id, input.branch_id, input.database_name, { signal })
|
|
287
|
+
}),
|
|
288
|
+
"postgres.dataApi.create": (options) => fromGenerated(options, {
|
|
289
|
+
id: "postgres.dataApi.create",
|
|
290
|
+
generated: "createProjectBranchDataAPI",
|
|
291
|
+
run: (neon, input, signal) => neon.postgres.dataApi.create(input.project_id, input.branch_id, input.database_name, {
|
|
292
|
+
auth_provider: input.auth_provider,
|
|
293
|
+
jwks_url: input.jwks_url,
|
|
294
|
+
provider_name: input.provider_name,
|
|
295
|
+
jwt_audience: input.jwt_audience,
|
|
296
|
+
add_default_grants: input.add_default_grants,
|
|
297
|
+
skip_auth_schema: input.skip_auth_schema,
|
|
298
|
+
settings: input.settings
|
|
299
|
+
}, { signal })
|
|
300
|
+
}),
|
|
301
|
+
"postgres.dataApi.update": (options) => fromGenerated(options, {
|
|
302
|
+
id: "postgres.dataApi.update",
|
|
303
|
+
generated: "updateProjectBranchDataAPI",
|
|
304
|
+
run: (neon, input, signal) => neon.postgres.dataApi.update(input.project_id, input.branch_id, input.database_name, { settings: {
|
|
305
|
+
db_aggregates_enabled: input.db_aggregates_enabled,
|
|
306
|
+
db_anon_role: input.db_anon_role,
|
|
307
|
+
db_extra_search_path: input.db_extra_search_path,
|
|
308
|
+
db_max_rows: input.db_max_rows,
|
|
309
|
+
db_schemas: input.db_schemas,
|
|
310
|
+
jwt_role_claim_key: input.jwt_role_claim_key,
|
|
311
|
+
jwt_cache_max_lifetime: input.jwt_cache_max_lifetime,
|
|
312
|
+
openapi_mode: input.openapi_mode,
|
|
313
|
+
server_cors_allowed_origins: input.server_cors_allowed_origins,
|
|
314
|
+
server_timing_enabled: input.server_timing_enabled
|
|
315
|
+
} }, { signal })
|
|
316
|
+
}),
|
|
317
|
+
"postgres.dataApi.delete": (options) => fromGenerated(options, {
|
|
318
|
+
id: "postgres.dataApi.delete",
|
|
319
|
+
generated: "deleteProjectBranchDataAPI",
|
|
320
|
+
run: (neon, input, signal) => neon.postgres.dataApi.delete(input.project_id, input.branch_id, input.database_name, { signal })
|
|
321
|
+
}),
|
|
322
|
+
"storage.get": (options) => fromGenerated(options, {
|
|
323
|
+
id: "storage.get",
|
|
324
|
+
generated: "getProjectBranchStorage",
|
|
325
|
+
run: (neon, input, signal) => neon.storage.get(input.project_id, input.branch_id, { signal })
|
|
326
|
+
}),
|
|
327
|
+
"storage.buckets.list": (options) => fromGenerated(options, {
|
|
328
|
+
id: "storage.buckets.list",
|
|
329
|
+
generated: "listProjectBranchBuckets",
|
|
330
|
+
run: (neon, input, signal) => neon.storage.buckets.list(input.project_id, input.branch_id, { signal })
|
|
331
|
+
}),
|
|
332
|
+
"storage.buckets.create": (options) => fromGenerated(options, {
|
|
333
|
+
id: "storage.buckets.create",
|
|
334
|
+
generated: "createProjectBranchBucket",
|
|
335
|
+
run: (neon, input, signal) => neon.storage.buckets.create(input.project_id, input.branch_id, {
|
|
336
|
+
name: input.name,
|
|
337
|
+
access_level: input.access_level
|
|
338
|
+
}, { signal })
|
|
339
|
+
}),
|
|
340
|
+
"storage.buckets.delete": (options) => fromGenerated(options, {
|
|
341
|
+
id: "storage.buckets.delete",
|
|
342
|
+
generated: "deleteProjectBranchBucket",
|
|
343
|
+
run: (neon, input, signal) => neon.storage.buckets.delete(input.project_id, input.branch_id, input.bucket_name, { signal })
|
|
344
|
+
}),
|
|
345
|
+
"storage.objects.list": (options) => fromGenerated(options, {
|
|
346
|
+
id: "storage.objects.list",
|
|
347
|
+
generated: "listProjectBranchBucketObjects",
|
|
348
|
+
omit: ["cursor"],
|
|
349
|
+
list: true,
|
|
350
|
+
run: (neon, input, signal) => collectObjectList(neon, {
|
|
351
|
+
project_id: input.project_id,
|
|
352
|
+
branch_id: input.branch_id,
|
|
353
|
+
bucket_name: input.bucket_name,
|
|
354
|
+
prefix: input.prefix,
|
|
355
|
+
delimiter: input.delimiter,
|
|
356
|
+
limit: input.limit
|
|
357
|
+
}, signal)
|
|
358
|
+
}),
|
|
359
|
+
"storage.objects.delete": (options) => fromGenerated(options, {
|
|
360
|
+
id: "storage.objects.delete",
|
|
361
|
+
generated: "deleteProjectBranchBucketObject",
|
|
362
|
+
run: (neon, input, signal) => neon.storage.objects.delete(input.project_id, input.branch_id, input.bucket_name, input.object_key, { signal })
|
|
363
|
+
}),
|
|
364
|
+
"storage.objects.deleteByPrefix": (options) => fromGenerated(options, {
|
|
365
|
+
id: "storage.objects.deleteByPrefix",
|
|
366
|
+
generated: "deleteProjectBranchBucketObjectsByPrefix",
|
|
367
|
+
run: (neon, input, signal) => neon.storage.objects.deleteByPrefix(input.project_id, input.branch_id, input.bucket_name, input.prefix, { signal })
|
|
368
|
+
}),
|
|
369
|
+
"storage.objects.presign": (options) => fromGenerated(options, {
|
|
370
|
+
id: "storage.objects.presign",
|
|
371
|
+
generated: "presignProjectBranchBucketObject",
|
|
372
|
+
run: (neon, input, signal) => neon.storage.objects.presign(input.project_id, input.branch_id, input.bucket_name, input.object_key, {
|
|
373
|
+
operation: input.operation,
|
|
374
|
+
content_type: input.content_type,
|
|
375
|
+
expires_in_seconds: input.expires_in_seconds
|
|
376
|
+
}, { signal })
|
|
377
|
+
}),
|
|
378
|
+
"functions.list": (options) => fromGenerated(options, {
|
|
379
|
+
id: "functions.list",
|
|
380
|
+
generated: "listProjectBranchFunctions",
|
|
381
|
+
omit: ["cursor"],
|
|
382
|
+
list: true,
|
|
383
|
+
run: (neon, input, signal) => collectPages(neon.functions.list(input.project_id, input.branch_id, { limit: input.limit }, { signal }), input.limit)
|
|
384
|
+
}),
|
|
385
|
+
"functions.get": (options) => fromGenerated(options, {
|
|
386
|
+
id: "functions.get",
|
|
387
|
+
generated: "getProjectBranchFunction",
|
|
388
|
+
run: (neon, input, signal) => neon.functions.get(input.project_id, input.branch_id, input.slug, { signal })
|
|
389
|
+
}),
|
|
390
|
+
"functions.update": (options) => fromGenerated(options, {
|
|
391
|
+
id: "functions.update",
|
|
392
|
+
generated: "updateProjectBranchFunction",
|
|
393
|
+
run: (neon, input, signal) => neon.functions.update(input.project_id, input.branch_id, input.slug, { name: input.name }, { signal })
|
|
394
|
+
}),
|
|
395
|
+
"functions.delete": (options) => fromGenerated(options, {
|
|
396
|
+
id: "functions.delete",
|
|
397
|
+
generated: "deleteProjectBranchFunction",
|
|
398
|
+
run: (neon, input, signal) => neon.functions.delete(input.project_id, input.branch_id, input.slug, { signal })
|
|
399
|
+
}),
|
|
400
|
+
"functions.deploy": (options) => fromGenerated(options, {
|
|
401
|
+
id: "functions.deploy",
|
|
402
|
+
generated: "createProjectBranchFunctionDeployment",
|
|
403
|
+
run: (neon, input, signal) => neon.functions.deploy(input.project_id, input.branch_id, input.slug, {
|
|
404
|
+
zip: input.zip === void 0 ? void 0 : decodeBase64(input.zip),
|
|
405
|
+
runtime: input.runtime,
|
|
406
|
+
environment: input.environment
|
|
407
|
+
}, { signal })
|
|
408
|
+
}),
|
|
409
|
+
"credentials.list": (options) => fromGenerated(options, {
|
|
410
|
+
id: "credentials.list",
|
|
411
|
+
generated: "listCredentials",
|
|
412
|
+
run: (neon, input, signal) => neon.credentials.list(input.project_id, input.branch_id, { signal })
|
|
413
|
+
}),
|
|
414
|
+
"credentials.create": (options) => fromGenerated(options, {
|
|
415
|
+
id: "credentials.create",
|
|
416
|
+
generated: "createCredential",
|
|
417
|
+
run: (neon, input, signal) => neon.credentials.create(input.project_id, input.branch_id, {
|
|
418
|
+
name: input.name,
|
|
419
|
+
scopes: input.scopes,
|
|
420
|
+
principal_type: input.principal_type
|
|
421
|
+
}, { signal })
|
|
422
|
+
}),
|
|
423
|
+
"credentials.revoke": (options) => fromGenerated(options, {
|
|
424
|
+
id: "credentials.revoke",
|
|
425
|
+
generated: "revokeCredential",
|
|
426
|
+
run: (neon, input, signal) => neon.credentials.revoke(input.project_id, input.branch_id, input.token_id, { signal })
|
|
427
|
+
}),
|
|
428
|
+
"aiGateway.get": (options) => fromGenerated(options, {
|
|
429
|
+
id: "aiGateway.get",
|
|
430
|
+
generated: "getProjectBranchAiGateway",
|
|
431
|
+
run: (neon, input, signal) => neon.aiGateway.get(input.project_id, input.branch_id, { signal })
|
|
432
|
+
}),
|
|
433
|
+
"logs.query": (options) => fromGenerated(options, {
|
|
434
|
+
id: "logs.query",
|
|
435
|
+
generated: "queryProjectBranchLogs",
|
|
436
|
+
omit: ["cursor"],
|
|
437
|
+
list: true,
|
|
438
|
+
annotations: logReadAnnotations,
|
|
439
|
+
requiresApproval: false,
|
|
440
|
+
run: (neon, input, signal) => collectPages(neon.logs.query(input.project_id, input.branch_id, {
|
|
441
|
+
since: input.since,
|
|
442
|
+
start_time: input.start_time,
|
|
443
|
+
end_time: input.end_time,
|
|
444
|
+
limit: input.limit,
|
|
445
|
+
sort_order: input.sort_order,
|
|
446
|
+
source: input.source,
|
|
447
|
+
service_name: input.service_name,
|
|
448
|
+
scope_name: input.scope_name,
|
|
449
|
+
minimum_severity: input.minimum_severity,
|
|
450
|
+
severity_text: input.severity_text,
|
|
451
|
+
body_contains: input.body_contains,
|
|
452
|
+
trace_id: input.trace_id,
|
|
453
|
+
logql: input.logql
|
|
454
|
+
}, { signal }), input.limit)
|
|
455
|
+
}),
|
|
456
|
+
"logs.fields": (options) => fromGenerated(options, {
|
|
457
|
+
id: "logs.fields",
|
|
458
|
+
generated: "listProjectBranchLogFields",
|
|
459
|
+
run: (neon, input, signal) => neon.logs.fields(input.project_id, input.branch_id, { signal })
|
|
460
|
+
}),
|
|
461
|
+
"logs.fieldValues": (options) => fromGenerated(options, {
|
|
462
|
+
id: "logs.fieldValues",
|
|
463
|
+
generated: "listProjectBranchLogFieldValues",
|
|
464
|
+
run: (neon, input, signal) => neon.logs.fieldValues(input.project_id, input.branch_id, input.field_name, {
|
|
465
|
+
since: input.since,
|
|
466
|
+
start_time: input.start_time,
|
|
467
|
+
end_time: input.end_time,
|
|
468
|
+
source: input.source,
|
|
469
|
+
limit: input.limit
|
|
470
|
+
}, { signal })
|
|
471
|
+
}),
|
|
472
|
+
"snapshots.list": (options) => fromGenerated(options, {
|
|
473
|
+
id: "snapshots.list",
|
|
474
|
+
generated: "listSnapshots",
|
|
475
|
+
run: (neon, input, signal) => neon.snapshots.list(input.project_id, { signal })
|
|
476
|
+
}),
|
|
477
|
+
"snapshots.create": (options) => fromGenerated(options, {
|
|
478
|
+
id: "snapshots.create",
|
|
479
|
+
generated: "createSnapshot",
|
|
480
|
+
run: (neon, input, signal) => neon.snapshots.create(input.project_id, input.branch_id, {
|
|
481
|
+
name: input.name,
|
|
482
|
+
timestamp: input.timestamp,
|
|
483
|
+
lsn: input.lsn,
|
|
484
|
+
expiresAt: input.expires_at
|
|
485
|
+
}, { signal })
|
|
486
|
+
}),
|
|
487
|
+
"snapshots.update": (options) => fromGenerated(options, {
|
|
488
|
+
id: "snapshots.update",
|
|
489
|
+
generated: "updateSnapshot",
|
|
490
|
+
run: (neon, input, signal) => neon.snapshots.update(input.project_id, input.snapshot_id, {
|
|
491
|
+
name: input.name,
|
|
492
|
+
expiresAt: input.expires_at
|
|
493
|
+
}, { signal })
|
|
494
|
+
}),
|
|
495
|
+
"snapshots.delete": (options) => fromGenerated(options, {
|
|
496
|
+
id: "snapshots.delete",
|
|
497
|
+
generated: "deleteSnapshot",
|
|
498
|
+
run: (neon, input, signal) => neon.snapshots.delete(input.project_id, input.snapshot_id, { signal })
|
|
499
|
+
}),
|
|
500
|
+
"snapshots.restore": restoreSnapshotTool,
|
|
501
|
+
"snapshots.getSchedule": (options) => fromGenerated(options, {
|
|
502
|
+
id: "snapshots.getSchedule",
|
|
503
|
+
generated: "getSnapshotSchedule",
|
|
504
|
+
run: (neon, input, signal) => neon.snapshots.getSchedule(input.project_id, input.branch_id, { signal })
|
|
505
|
+
}),
|
|
506
|
+
"snapshots.setSchedule": setScheduleTool,
|
|
507
|
+
"operations.list": (options) => fromGenerated(options, {
|
|
508
|
+
id: "operations.list",
|
|
509
|
+
generated: "listProjectOperations",
|
|
510
|
+
omit: ["cursor"],
|
|
511
|
+
list: true,
|
|
512
|
+
run: (neon, input, signal) => collectPages(neon.operations.list(input.project_id, { signal }), input.limit)
|
|
513
|
+
}),
|
|
514
|
+
"operations.get": (options) => fromGenerated(options, {
|
|
515
|
+
id: "operations.get",
|
|
516
|
+
generated: "getProjectOperation",
|
|
517
|
+
run: (neon, input, signal) => neon.operations.get(input.project_id, input.operation_id, { signal })
|
|
518
|
+
}),
|
|
519
|
+
"auth.get": (options) => fromGenerated(options, {
|
|
520
|
+
id: "auth.get",
|
|
521
|
+
generated: "getNeonAuth",
|
|
522
|
+
run: (neon, input, signal) => neon.auth.get(input.project_id, input.branch_id, { signal })
|
|
523
|
+
}),
|
|
524
|
+
"auth.create": (options) => fromGenerated(options, {
|
|
525
|
+
id: "auth.create",
|
|
526
|
+
generated: "createNeonAuth",
|
|
527
|
+
run: (neon, input, signal) => neon.auth.create(input.project_id, input.branch_id, {
|
|
528
|
+
auth_provider: input.auth_provider,
|
|
529
|
+
database_name: input.database_name
|
|
530
|
+
}, { signal })
|
|
531
|
+
}),
|
|
532
|
+
"auth.disable": (options) => fromGenerated(options, {
|
|
533
|
+
id: "auth.disable",
|
|
534
|
+
generated: "disableNeonAuth",
|
|
535
|
+
run: (neon, input, signal) => neon.auth.disable(input.project_id, input.branch_id, { deleteData: input.delete_data }, { signal })
|
|
536
|
+
}),
|
|
537
|
+
"auth.updateConfig": (options) => fromGenerated(options, {
|
|
538
|
+
id: "auth.updateConfig",
|
|
539
|
+
generated: "updateNeonAuthConfig",
|
|
540
|
+
run: (neon, input, signal) => neon.auth.updateConfig(input.project_id, input.branch_id, { name: input.name }, { signal })
|
|
541
|
+
}),
|
|
542
|
+
"auth.oauthProviders.list": (options) => fromGenerated(options, {
|
|
543
|
+
id: "auth.oauthProviders.list",
|
|
544
|
+
generated: "listBranchNeonAuthOauthProviders",
|
|
545
|
+
run: (neon, input, signal) => neon.auth.oauthProviders.list(input.project_id, input.branch_id, { signal })
|
|
546
|
+
}),
|
|
547
|
+
"auth.oauthProviders.add": (options) => fromGenerated(options, {
|
|
548
|
+
id: "auth.oauthProviders.add",
|
|
549
|
+
generated: "addBranchNeonAuthOauthProvider",
|
|
550
|
+
run: (neon, input, signal) => neon.auth.oauthProviders.add(input.project_id, input.branch_id, {
|
|
551
|
+
id: input.id,
|
|
552
|
+
client_id: input.client_id,
|
|
553
|
+
client_secret: input.client_secret,
|
|
554
|
+
microsoft_tenant_id: input.microsoft_tenant_id
|
|
555
|
+
}, { signal })
|
|
556
|
+
}),
|
|
557
|
+
"auth.oauthProviders.update": (options) => fromGenerated(options, {
|
|
558
|
+
id: "auth.oauthProviders.update",
|
|
559
|
+
generated: "updateBranchNeonAuthOauthProvider",
|
|
560
|
+
run: (neon, input, signal) => neon.auth.oauthProviders.update(input.project_id, input.branch_id, input.oauth_provider_id, {
|
|
561
|
+
client_id: input.client_id,
|
|
562
|
+
client_secret: input.client_secret,
|
|
563
|
+
microsoft_tenant_id: input.microsoft_tenant_id
|
|
564
|
+
}, { signal })
|
|
565
|
+
}),
|
|
566
|
+
"auth.oauthProviders.delete": (options) => fromGenerated(options, {
|
|
567
|
+
id: "auth.oauthProviders.delete",
|
|
568
|
+
generated: "deleteBranchNeonAuthOauthProvider",
|
|
569
|
+
run: (neon, input, signal) => neon.auth.oauthProviders.delete(input.project_id, input.branch_id, input.oauth_provider_id, { signal })
|
|
570
|
+
}),
|
|
571
|
+
"auth.trustedDomains.list": (options) => fromGenerated(options, {
|
|
572
|
+
id: "auth.trustedDomains.list",
|
|
573
|
+
generated: "listBranchNeonAuthTrustedDomains",
|
|
574
|
+
run: (neon, input, signal) => neon.auth.trustedDomains.list(input.project_id, input.branch_id, { signal })
|
|
575
|
+
}),
|
|
576
|
+
"auth.trustedDomains.add": (options) => fromGenerated(options, {
|
|
577
|
+
id: "auth.trustedDomains.add",
|
|
578
|
+
generated: "addBranchNeonAuthTrustedDomain",
|
|
579
|
+
run: (neon, input, signal) => neon.auth.trustedDomains.add(input.project_id, input.branch_id, {
|
|
580
|
+
domain: input.domain,
|
|
581
|
+
auth_provider: input.auth_provider
|
|
582
|
+
}, { signal })
|
|
583
|
+
}),
|
|
584
|
+
"auth.trustedDomains.delete": (options) => fromGenerated(options, {
|
|
585
|
+
id: "auth.trustedDomains.delete",
|
|
586
|
+
generated: "deleteBranchNeonAuthTrustedDomain",
|
|
587
|
+
run: (neon, input, signal) => neon.auth.trustedDomains.delete(input.project_id, input.branch_id, {
|
|
588
|
+
auth_provider: input.auth_provider,
|
|
589
|
+
domains: input.domains
|
|
590
|
+
}, { signal })
|
|
591
|
+
}),
|
|
592
|
+
"auth.users.create": (options) => fromGenerated(options, {
|
|
593
|
+
id: "auth.users.create",
|
|
594
|
+
generated: "createBranchNeonAuthNewUser",
|
|
595
|
+
run: (neon, input, signal) => neon.auth.users.create(input.project_id, input.branch_id, {
|
|
596
|
+
email: input.email,
|
|
597
|
+
name: input.name
|
|
598
|
+
}, { signal })
|
|
599
|
+
}),
|
|
600
|
+
"auth.users.delete": (options) => fromGenerated(options, {
|
|
601
|
+
id: "auth.users.delete",
|
|
602
|
+
generated: "deleteBranchNeonAuthUser",
|
|
603
|
+
run: (neon, input, signal) => neon.auth.users.delete(input.project_id, input.branch_id, input.auth_user_id, { signal })
|
|
604
|
+
}),
|
|
605
|
+
"auth.users.updateRole": (options) => fromGenerated(options, {
|
|
606
|
+
id: "auth.users.updateRole",
|
|
607
|
+
generated: "updateNeonAuthUserRole",
|
|
608
|
+
run: (neon, input, signal) => neon.auth.users.updateRole(input.project_id, input.branch_id, input.auth_user_id, input.roles, { signal })
|
|
609
|
+
}),
|
|
610
|
+
"consumption.perProject": (options) => fromGenerated(options, {
|
|
611
|
+
id: "consumption.perProject",
|
|
612
|
+
generated: "getConsumptionHistoryPerProject",
|
|
613
|
+
omit: ["cursor"],
|
|
614
|
+
list: true,
|
|
615
|
+
run: (neon, input, signal) => collectPages(neon.consumption.perProject({
|
|
616
|
+
limit: input.limit,
|
|
617
|
+
project_ids: input.project_ids,
|
|
618
|
+
from: input.from,
|
|
619
|
+
to: input.to,
|
|
620
|
+
granularity: input.granularity,
|
|
621
|
+
org_id: input.org_id,
|
|
622
|
+
include_v1_metrics: input.include_v1_metrics,
|
|
623
|
+
metrics: input.metrics
|
|
624
|
+
}, { signal }), input.limit)
|
|
625
|
+
}),
|
|
626
|
+
"consumption.perProjectV2": (options) => fromGenerated(options, {
|
|
627
|
+
id: "consumption.perProjectV2",
|
|
628
|
+
generated: "getConsumptionHistoryPerProjectV2",
|
|
629
|
+
omit: ["cursor"],
|
|
630
|
+
list: true,
|
|
631
|
+
run: (neon, input, signal) => collectPages(neon.consumption.perProjectV2({
|
|
632
|
+
limit: input.limit,
|
|
633
|
+
project_ids: input.project_ids,
|
|
634
|
+
from: input.from,
|
|
635
|
+
to: input.to,
|
|
636
|
+
granularity: input.granularity,
|
|
637
|
+
org_id: input.org_id,
|
|
638
|
+
metrics: input.metrics
|
|
639
|
+
}, { signal }), input.limit)
|
|
640
|
+
}),
|
|
641
|
+
"consumption.perBranchV2": (options) => fromGenerated(options, {
|
|
642
|
+
id: "consumption.perBranchV2",
|
|
643
|
+
generated: "getConsumptionHistoryPerBranchV2",
|
|
644
|
+
omit: ["cursor"],
|
|
645
|
+
list: true,
|
|
646
|
+
run: (neon, input, signal) => collectPages(neon.consumption.perBranchV2({
|
|
647
|
+
limit: input.limit,
|
|
648
|
+
project_ids: input.project_ids,
|
|
649
|
+
branch_ids: input.branch_ids,
|
|
650
|
+
from: input.from,
|
|
651
|
+
to: input.to,
|
|
652
|
+
granularity: input.granularity,
|
|
653
|
+
org_id: input.org_id,
|
|
654
|
+
metrics: input.metrics
|
|
655
|
+
}, { signal }), input.limit)
|
|
656
|
+
}),
|
|
657
|
+
"apiKeys.list": (options) => fromGenerated(options, {
|
|
658
|
+
id: "apiKeys.list",
|
|
659
|
+
generated: "listApiKeys",
|
|
660
|
+
run: (neon, _input, signal) => neon.apiKeys.list({ signal })
|
|
661
|
+
}),
|
|
662
|
+
"apiKeys.create": (options) => fromGenerated(options, {
|
|
663
|
+
id: "apiKeys.create",
|
|
664
|
+
generated: "createApiKey",
|
|
665
|
+
run: (neon, input, signal) => neon.apiKeys.create(input.key_name, { signal })
|
|
666
|
+
}),
|
|
667
|
+
"apiKeys.revoke": (options) => fromGenerated(options, {
|
|
668
|
+
id: "apiKeys.revoke",
|
|
669
|
+
generated: "revokeApiKey",
|
|
670
|
+
run: (neon, input, signal) => neon.apiKeys.revoke(input.key_id, { signal })
|
|
671
|
+
}),
|
|
672
|
+
"regions.list": (options) => bindTool(options, {
|
|
673
|
+
operationId: "regions.list",
|
|
674
|
+
id: "regions_list",
|
|
675
|
+
title: "List regions",
|
|
676
|
+
description: "Lists Neon regions available to the authenticated account.",
|
|
677
|
+
inputSchema: z.strictObject({}),
|
|
678
|
+
annotations: {
|
|
679
|
+
readOnlyHint: true,
|
|
680
|
+
openWorldHint: true
|
|
681
|
+
},
|
|
682
|
+
requiresApproval: false,
|
|
683
|
+
metadata: {
|
|
684
|
+
method: "GET",
|
|
685
|
+
path: "/regions",
|
|
686
|
+
stability: "stable",
|
|
687
|
+
deprecated: false,
|
|
688
|
+
tags: ["Region"]
|
|
689
|
+
}
|
|
690
|
+
}, (neon, _input, signal) => neon.regions.list({ signal })),
|
|
691
|
+
"user.me": (options) => fromGenerated(options, {
|
|
692
|
+
id: "user.me",
|
|
693
|
+
generated: "getCurrentUserInfo",
|
|
694
|
+
run: (neon, _input, signal) => neon.user.me({ signal })
|
|
695
|
+
}),
|
|
696
|
+
"user.organizations": (options) => fromGenerated(options, {
|
|
697
|
+
id: "user.organizations",
|
|
698
|
+
generated: "getCurrentUserOrganizations",
|
|
699
|
+
run: (neon, _input, signal) => neon.user.organizations({ signal })
|
|
700
|
+
})
|
|
701
|
+
};
|
|
702
|
+
//#endregion
|
|
703
|
+
export { toolFactories };
|