@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.
@@ -0,0 +1,450 @@
1
+ import * as z from "zod";
2
+ import { type ToolClientOptions } from "./bind.js";
3
+ export declare const createBranchWithComputeInputSchema: z.ZodObject<{
4
+ project_id: z.ZodString;
5
+ name: z.ZodOptional<z.ZodString>;
6
+ parent_id: z.ZodOptional<z.ZodString>;
7
+ compute: z.ZodOptional<z.ZodObject<{
8
+ min_cu: z.ZodOptional<z.ZodNumber>;
9
+ max_cu: z.ZodOptional<z.ZodNumber>;
10
+ suspend_timeout_seconds: z.ZodOptional<z.ZodInt>;
11
+ }, z.core.$strict>>;
12
+ pooled: z.ZodOptional<z.ZodBoolean>;
13
+ }, z.core.$strict>;
14
+ export declare const createProjectAndConnectInputSchema: z.ZodObject<{
15
+ pooled: z.ZodOptional<z.ZodBoolean>;
16
+ settings: z.ZodOptional<z.ZodObject<{
17
+ quota: z.ZodOptional<z.ZodObject<{
18
+ active_time_seconds: z.ZodOptional<z.ZodInt>;
19
+ compute_time_seconds: z.ZodOptional<z.ZodInt>;
20
+ written_data_bytes: z.ZodOptional<z.ZodInt>;
21
+ data_transfer_bytes: z.ZodOptional<z.ZodInt>;
22
+ logical_size_bytes: z.ZodOptional<z.ZodInt>;
23
+ }, z.core.$strict>>;
24
+ allowed_ips: z.ZodOptional<z.ZodObject<{
25
+ ips: z.ZodOptional<z.ZodArray<z.ZodString>>;
26
+ protected_branches_only: z.ZodOptional<z.ZodBoolean>;
27
+ }, z.core.$strict>>;
28
+ enable_logical_replication: z.ZodOptional<z.ZodBoolean>;
29
+ maintenance_window: z.ZodOptional<z.ZodObject<{
30
+ weekdays: z.ZodArray<z.ZodInt>;
31
+ start_time: z.ZodString;
32
+ end_time: z.ZodString;
33
+ }, z.core.$strict>>;
34
+ block_public_connections: z.ZodOptional<z.ZodBoolean>;
35
+ block_vpc_connections: z.ZodOptional<z.ZodBoolean>;
36
+ audit_log_level: z.ZodOptional<z.ZodEnum<{
37
+ base: "base";
38
+ extended: "extended";
39
+ full: "full";
40
+ }>>;
41
+ hipaa: z.ZodOptional<z.ZodBoolean>;
42
+ preload_libraries: z.ZodOptional<z.ZodObject<{
43
+ use_defaults: z.ZodOptional<z.ZodBoolean>;
44
+ enabled_libraries: z.ZodOptional<z.ZodArray<z.ZodString>>;
45
+ }, z.core.$strict>>;
46
+ }, z.core.$strict>>;
47
+ name: z.ZodOptional<z.ZodString>;
48
+ branch: z.ZodOptional<z.ZodObject<{
49
+ name: z.ZodOptional<z.ZodString>;
50
+ role_name: z.ZodOptional<z.ZodString>;
51
+ database_name: z.ZodOptional<z.ZodString>;
52
+ annotations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
53
+ }, z.core.$strict>>;
54
+ autoscaling_limit_min_cu: z.ZodOptional<z.ZodNumber>;
55
+ autoscaling_limit_max_cu: z.ZodOptional<z.ZodNumber>;
56
+ provisioner: z.ZodOptional<z.ZodString>;
57
+ region_id: z.ZodOptional<z.ZodString>;
58
+ default_endpoint_settings: z.ZodOptional<z.ZodObject<{
59
+ pg_settings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
60
+ pgbouncer_settings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
61
+ autoscaling_limit_min_cu: z.ZodOptional<z.ZodNumber>;
62
+ autoscaling_limit_max_cu: z.ZodOptional<z.ZodNumber>;
63
+ suspend_timeout_seconds: z.ZodOptional<z.ZodInt>;
64
+ }, z.core.$strict>>;
65
+ pg_version: z.ZodOptional<z.ZodInt>;
66
+ store_passwords: z.ZodOptional<z.ZodBoolean>;
67
+ history_retention_seconds: z.ZodOptional<z.ZodInt>;
68
+ org_id: z.ZodOptional<z.ZodString>;
69
+ }, z.core.$strict>;
70
+ export declare const getDefaultInputSchema: z.ZodObject<{
71
+ project_id: z.ZodString;
72
+ }, z.core.$strict>;
73
+ export declare const connectionStringInputSchema: z.ZodObject<{
74
+ project_id: z.ZodString;
75
+ branch_id: z.ZodOptional<z.ZodString>;
76
+ endpoint_id: z.ZodOptional<z.ZodString>;
77
+ database_name: z.ZodString;
78
+ role_name: z.ZodString;
79
+ pooled: z.ZodOptional<z.ZodBoolean>;
80
+ }, z.core.$strict>;
81
+ export declare const restoreSnapshotInputSchema: z.ZodObject<{
82
+ project_id: z.ZodString;
83
+ snapshot_id: z.ZodString;
84
+ name: z.ZodOptional<z.ZodString>;
85
+ target_branch_id: z.ZodOptional<z.ZodString>;
86
+ finalize: z.ZodOptional<z.ZodBoolean>;
87
+ }, z.core.$strict>;
88
+ export declare const setScheduleInputSchema: z.ZodObject<{
89
+ project_id: z.ZodString;
90
+ branch_id: z.ZodString;
91
+ schedule: z.ZodArray<z.ZodObject<{
92
+ frequency: z.ZodEnum<{
93
+ daily: "daily";
94
+ monthly: "monthly";
95
+ weekly: "weekly";
96
+ }>;
97
+ hour: z.ZodOptional<z.ZodInt>;
98
+ day: z.ZodOptional<z.ZodInt>;
99
+ month: z.ZodOptional<z.ZodInt>;
100
+ retention_seconds: z.ZodOptional<z.ZodInt>;
101
+ }, z.core.$strict>>;
102
+ }, z.core.$strict>;
103
+ export declare const createBranchWithComputeTool: (options: ToolClientOptions) => import("../operation.js").NeonTool<z.ZodObject<{
104
+ project_id: z.ZodString;
105
+ name: z.ZodOptional<z.ZodString>;
106
+ parent_id: z.ZodOptional<z.ZodString>;
107
+ compute: z.ZodOptional<z.ZodObject<{
108
+ min_cu: z.ZodOptional<z.ZodNumber>;
109
+ max_cu: z.ZodOptional<z.ZodNumber>;
110
+ suspend_timeout_seconds: z.ZodOptional<z.ZodInt>;
111
+ }, z.core.$strict>>;
112
+ pooled: z.ZodOptional<z.ZodBoolean>;
113
+ }, z.core.$strict>, "branches_create_with_compute", {
114
+ branch: {
115
+ id: string;
116
+ project_id: string;
117
+ parent_id?: string | null | undefined;
118
+ parent_lsn?: string | null | undefined;
119
+ parent_timestamp?: string | null | undefined;
120
+ name: string;
121
+ current_state: import("@neon/sdk").BranchState;
122
+ pending_state?: string | null | undefined;
123
+ state_changed_at: string;
124
+ logical_size?: number | null | undefined;
125
+ creation_source: string;
126
+ primary?: boolean | null | undefined;
127
+ default: boolean;
128
+ protected: boolean;
129
+ cpu_used_sec: number;
130
+ compute_time_seconds: number;
131
+ active_time_seconds: number;
132
+ written_data_bytes: number;
133
+ data_transfer_bytes: number;
134
+ created_at: string;
135
+ updated_at: string;
136
+ ttl_interval_seconds?: number | null | undefined;
137
+ expires_at?: string | null | undefined;
138
+ last_reset_at?: string | null | undefined;
139
+ created_by?: {
140
+ name?: string | null | undefined;
141
+ image?: string | null | undefined;
142
+ } | null | undefined;
143
+ init_source?: string | null | undefined;
144
+ restore_status?: string | null | undefined;
145
+ restored_from?: string | null | undefined;
146
+ restored_as?: string | null | undefined;
147
+ restricted_actions?: {
148
+ name: string;
149
+ reason: string;
150
+ }[] | null | undefined;
151
+ recovery?: {
152
+ deleted_at: string;
153
+ recoverable_until: string;
154
+ deletion_method: "user" | "ttl";
155
+ } | null | undefined;
156
+ };
157
+ endpoint: {
158
+ host: string;
159
+ id: string;
160
+ name?: string | null | undefined;
161
+ project_id: string;
162
+ branch_id: string;
163
+ autoscaling_limit_min_cu: import("@neon/sdk").ComputeUnit;
164
+ autoscaling_limit_max_cu: import("@neon/sdk").ComputeUnit;
165
+ region_id: string;
166
+ type: import("@neon/sdk").EndpointType;
167
+ current_state: import("@neon/sdk").EndpointState;
168
+ pending_state?: import("@neon/sdk").EndpointState | null | undefined;
169
+ settings: {
170
+ pg_settings?: {
171
+ [x: string]: string;
172
+ } | null | undefined;
173
+ pgbouncer_settings?: {
174
+ [x: string]: string;
175
+ } | null | undefined;
176
+ preload_libraries?: {
177
+ use_defaults?: boolean | null | undefined;
178
+ enabled_libraries?: string[] | null | undefined;
179
+ } | null | undefined;
180
+ };
181
+ pooler_enabled: boolean;
182
+ pooler_mode: import("@neon/sdk").EndpointPoolerMode;
183
+ disabled: boolean;
184
+ passwordless_access: boolean;
185
+ last_active?: string | null | undefined;
186
+ creation_source: string;
187
+ created_at: string;
188
+ updated_at: string;
189
+ started_at?: string | null | undefined;
190
+ suspended_at?: string | null | undefined;
191
+ proxy_host: string;
192
+ suspend_timeout_seconds: import("@neon/sdk").SuspendTimeoutSeconds;
193
+ provisioner: import("@neon/sdk").Provisioner;
194
+ compute_release_version?: string | null | undefined;
195
+ };
196
+ connectionString: string;
197
+ }>;
198
+ export declare const createProjectAndConnectTool: (options: ToolClientOptions) => import("../operation.js").NeonTool<z.ZodObject<{
199
+ pooled: z.ZodOptional<z.ZodBoolean>;
200
+ settings: z.ZodOptional<z.ZodObject<{
201
+ quota: z.ZodOptional<z.ZodObject<{
202
+ active_time_seconds: z.ZodOptional<z.ZodInt>;
203
+ compute_time_seconds: z.ZodOptional<z.ZodInt>;
204
+ written_data_bytes: z.ZodOptional<z.ZodInt>;
205
+ data_transfer_bytes: z.ZodOptional<z.ZodInt>;
206
+ logical_size_bytes: z.ZodOptional<z.ZodInt>;
207
+ }, z.core.$strict>>;
208
+ allowed_ips: z.ZodOptional<z.ZodObject<{
209
+ ips: z.ZodOptional<z.ZodArray<z.ZodString>>;
210
+ protected_branches_only: z.ZodOptional<z.ZodBoolean>;
211
+ }, z.core.$strict>>;
212
+ enable_logical_replication: z.ZodOptional<z.ZodBoolean>;
213
+ maintenance_window: z.ZodOptional<z.ZodObject<{
214
+ weekdays: z.ZodArray<z.ZodInt>;
215
+ start_time: z.ZodString;
216
+ end_time: z.ZodString;
217
+ }, z.core.$strict>>;
218
+ block_public_connections: z.ZodOptional<z.ZodBoolean>;
219
+ block_vpc_connections: z.ZodOptional<z.ZodBoolean>;
220
+ audit_log_level: z.ZodOptional<z.ZodEnum<{
221
+ base: "base";
222
+ extended: "extended";
223
+ full: "full";
224
+ }>>;
225
+ hipaa: z.ZodOptional<z.ZodBoolean>;
226
+ preload_libraries: z.ZodOptional<z.ZodObject<{
227
+ use_defaults: z.ZodOptional<z.ZodBoolean>;
228
+ enabled_libraries: z.ZodOptional<z.ZodArray<z.ZodString>>;
229
+ }, z.core.$strict>>;
230
+ }, z.core.$strict>>;
231
+ name: z.ZodOptional<z.ZodString>;
232
+ branch: z.ZodOptional<z.ZodObject<{
233
+ name: z.ZodOptional<z.ZodString>;
234
+ role_name: z.ZodOptional<z.ZodString>;
235
+ database_name: z.ZodOptional<z.ZodString>;
236
+ annotations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
237
+ }, z.core.$strict>>;
238
+ autoscaling_limit_min_cu: z.ZodOptional<z.ZodNumber>;
239
+ autoscaling_limit_max_cu: z.ZodOptional<z.ZodNumber>;
240
+ provisioner: z.ZodOptional<z.ZodString>;
241
+ region_id: z.ZodOptional<z.ZodString>;
242
+ default_endpoint_settings: z.ZodOptional<z.ZodObject<{
243
+ pg_settings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
244
+ pgbouncer_settings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
245
+ autoscaling_limit_min_cu: z.ZodOptional<z.ZodNumber>;
246
+ autoscaling_limit_max_cu: z.ZodOptional<z.ZodNumber>;
247
+ suspend_timeout_seconds: z.ZodOptional<z.ZodInt>;
248
+ }, z.core.$strict>>;
249
+ pg_version: z.ZodOptional<z.ZodInt>;
250
+ store_passwords: z.ZodOptional<z.ZodBoolean>;
251
+ history_retention_seconds: z.ZodOptional<z.ZodInt>;
252
+ org_id: z.ZodOptional<z.ZodString>;
253
+ }, z.core.$strict>, "projects_create_and_connect", {
254
+ project: {
255
+ data_storage_bytes_hour: number;
256
+ data_transfer_bytes: number;
257
+ written_data_bytes: number;
258
+ compute_time_seconds: number;
259
+ active_time_seconds: number;
260
+ cpu_used_sec: number;
261
+ id: string;
262
+ platform_id: string;
263
+ region_id: string;
264
+ name: string;
265
+ provisioner: import("@neon/sdk").Provisioner;
266
+ default_endpoint_settings?: {
267
+ pg_settings?: {
268
+ [x: string]: string;
269
+ } | null | undefined;
270
+ pgbouncer_settings?: {
271
+ [x: string]: string;
272
+ } | null | undefined;
273
+ autoscaling_limit_min_cu?: number | null | undefined;
274
+ autoscaling_limit_max_cu?: number | null | undefined;
275
+ suspend_timeout_seconds?: number | null | undefined;
276
+ } | null | undefined;
277
+ settings?: {
278
+ quota?: {
279
+ active_time_seconds?: number | null | undefined;
280
+ compute_time_seconds?: number | null | undefined;
281
+ written_data_bytes?: number | null | undefined;
282
+ data_transfer_bytes?: number | null | undefined;
283
+ logical_size_bytes?: number | null | undefined;
284
+ } | null | undefined;
285
+ allowed_ips?: {
286
+ ips?: string[] | null | undefined;
287
+ protected_branches_only?: boolean | null | undefined;
288
+ } | null | undefined;
289
+ enable_logical_replication?: boolean | null | undefined;
290
+ maintenance_window?: {
291
+ weekdays: number[];
292
+ start_time: string;
293
+ end_time: string;
294
+ } | null | undefined;
295
+ block_public_connections?: boolean | null | undefined;
296
+ block_vpc_connections?: boolean | null | undefined;
297
+ audit_log_level?: import("@neon/sdk").ProjectAuditLogLevel | null | undefined;
298
+ hipaa?: boolean | null | undefined;
299
+ preload_libraries?: {
300
+ use_defaults?: boolean | null | undefined;
301
+ enabled_libraries?: string[] | null | undefined;
302
+ } | null | undefined;
303
+ } | null | undefined;
304
+ pg_version: import("@neon/sdk").PgVersion;
305
+ proxy_host: string;
306
+ branch_logical_size_limit: number;
307
+ branch_logical_size_limit_bytes: number;
308
+ store_passwords: boolean;
309
+ maintenance_starts_at?: string | null | undefined;
310
+ creation_source: string;
311
+ history_retention_seconds: number;
312
+ created_at: string;
313
+ updated_at: string;
314
+ synthetic_storage_size?: number | null | undefined;
315
+ consumption_period_start: string;
316
+ consumption_period_end: string;
317
+ quota_reset_at?: string | null | undefined;
318
+ owner_id: string;
319
+ owner?: {
320
+ email: string;
321
+ name: string;
322
+ branches_limit: number;
323
+ subscription_type: import("@neon/sdk").BillingSubscriptionType;
324
+ } | null | undefined;
325
+ compute_last_active_at?: string | null | undefined;
326
+ org_id?: string | null | undefined;
327
+ maintenance_scheduled_for?: string | null | undefined;
328
+ hipaa_enabled_at?: string | null | undefined;
329
+ effective_project_permission?: (import("@neon/sdk").ProjectPermissionLevel | null) | undefined;
330
+ };
331
+ connectionString: string;
332
+ }>;
333
+ export declare const getDefaultTool: (options: ToolClientOptions) => import("../operation.js").NeonTool<z.ZodObject<{
334
+ project_id: z.ZodString;
335
+ }, z.core.$strict>, "branches_get_default", {
336
+ id: string;
337
+ project_id: string;
338
+ parent_id?: string | null | undefined;
339
+ parent_lsn?: string | null | undefined;
340
+ parent_timestamp?: string | null | undefined;
341
+ name: string;
342
+ current_state: import("@neon/sdk").BranchState;
343
+ pending_state?: string | null | undefined;
344
+ state_changed_at: string;
345
+ logical_size?: number | null | undefined;
346
+ creation_source: string;
347
+ primary?: boolean | null | undefined;
348
+ default: boolean;
349
+ protected: boolean;
350
+ cpu_used_sec: number;
351
+ compute_time_seconds: number;
352
+ active_time_seconds: number;
353
+ written_data_bytes: number;
354
+ data_transfer_bytes: number;
355
+ created_at: string;
356
+ updated_at: string;
357
+ ttl_interval_seconds?: number | null | undefined;
358
+ expires_at?: string | null | undefined;
359
+ last_reset_at?: string | null | undefined;
360
+ created_by?: {
361
+ name?: string | null | undefined;
362
+ image?: string | null | undefined;
363
+ } | null | undefined;
364
+ init_source?: string | null | undefined;
365
+ restore_status?: string | null | undefined;
366
+ restored_from?: string | null | undefined;
367
+ restored_as?: string | null | undefined;
368
+ restricted_actions?: {
369
+ name: string;
370
+ reason: string;
371
+ }[] | null | undefined;
372
+ recovery?: {
373
+ deleted_at: string;
374
+ recoverable_until: string;
375
+ deletion_method: "user" | "ttl";
376
+ } | null | undefined;
377
+ }>;
378
+ export declare const connectionStringTool: (options: ToolClientOptions) => import("../operation.js").NeonTool<z.ZodObject<{
379
+ project_id: z.ZodString;
380
+ branch_id: z.ZodOptional<z.ZodString>;
381
+ endpoint_id: z.ZodOptional<z.ZodString>;
382
+ database_name: z.ZodString;
383
+ role_name: z.ZodString;
384
+ pooled: z.ZodOptional<z.ZodBoolean>;
385
+ }, z.core.$strict>, "postgres_connection_string", string>;
386
+ export declare const restoreSnapshotTool: (options: ToolClientOptions) => import("../operation.js").NeonTool<z.ZodObject<{
387
+ project_id: z.ZodString;
388
+ snapshot_id: z.ZodString;
389
+ name: z.ZodOptional<z.ZodString>;
390
+ target_branch_id: z.ZodOptional<z.ZodString>;
391
+ finalize: z.ZodOptional<z.ZodBoolean>;
392
+ }, z.core.$strict>, "snapshots_restore", {
393
+ id: string;
394
+ project_id: string;
395
+ parent_id?: string | null | undefined;
396
+ parent_lsn?: string | null | undefined;
397
+ parent_timestamp?: string | null | undefined;
398
+ name: string;
399
+ current_state: import("@neon/sdk").BranchState;
400
+ pending_state?: string | null | undefined;
401
+ state_changed_at: string;
402
+ logical_size?: number | null | undefined;
403
+ creation_source: string;
404
+ primary?: boolean | null | undefined;
405
+ default: boolean;
406
+ protected: boolean;
407
+ cpu_used_sec: number;
408
+ compute_time_seconds: number;
409
+ active_time_seconds: number;
410
+ written_data_bytes: number;
411
+ data_transfer_bytes: number;
412
+ created_at: string;
413
+ updated_at: string;
414
+ ttl_interval_seconds?: number | null | undefined;
415
+ expires_at?: string | null | undefined;
416
+ last_reset_at?: string | null | undefined;
417
+ created_by?: {
418
+ name?: string | null | undefined;
419
+ image?: string | null | undefined;
420
+ } | null | undefined;
421
+ init_source?: string | null | undefined;
422
+ restore_status?: string | null | undefined;
423
+ restored_from?: string | null | undefined;
424
+ restored_as?: string | null | undefined;
425
+ restricted_actions?: {
426
+ name: string;
427
+ reason: string;
428
+ }[] | null | undefined;
429
+ recovery?: {
430
+ deleted_at: string;
431
+ recoverable_until: string;
432
+ deletion_method: "user" | "ttl";
433
+ } | null | undefined;
434
+ }>;
435
+ export declare const setScheduleTool: (options: ToolClientOptions) => import("../operation.js").NeonTool<z.ZodObject<{
436
+ project_id: z.ZodString;
437
+ branch_id: z.ZodString;
438
+ schedule: z.ZodArray<z.ZodObject<{
439
+ frequency: z.ZodEnum<{
440
+ daily: "daily";
441
+ monthly: "monthly";
442
+ weekly: "weekly";
443
+ }>;
444
+ hour: z.ZodOptional<z.ZodInt>;
445
+ day: z.ZodOptional<z.ZodInt>;
446
+ month: z.ZodOptional<z.ZodInt>;
447
+ retention_seconds: z.ZodOptional<z.ZodInt>;
448
+ }, z.core.$strict>>;
449
+ }, z.core.$strict>, "snapshots_set_schedule", null>;
450
+ //# sourceMappingURL=composed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composed.d.ts","sourceRoot":"","sources":["../../../src/lib/ergonomic/composed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,EAAY,KAAK,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAuB7D,eAAO,MAAM,kCAAkC;;;;;;;;;;kBAY7C,CAAC;AAEH,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAG7C,CAAC;AAEH,eAAO,MAAM,qBAAqB;;kBAEhC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;kBAOtC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;kBAWrC,CAAC;AAIH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;kBASjC,CAAC;AAEH,eAAO,MAAM,2BAA2B,GAAI,SAAS,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2CpE,CAAC;AAEH,eAAO,MAAM,2BAA2B,GAAI,SAAS,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2BpE,CAAC;AAEH,eAAO,MAAM,cAAc,GAAI,SAAS,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsBvD,CAAC;AAEH,eAAO,MAAM,oBAAoB,GAAI,SAAS,iBAAiB;;;;;;;yDA0C7D,CAAC;AAEH,eAAO,MAAM,mBAAmB,GAAI,SAAS,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+B5D,CAAC;AAEH,eAAO,MAAM,eAAe,GAAI,SAAS,iBAAiB;;;;;;;;;;;;;;mDA2BxD,CAAC"}
@@ -0,0 +1,186 @@
1
+ import { zBackupScheduleItem, zBranchCreateRequest, zComputeUnit, zCreateProjectBody, zCreateProjectBranchPath, zGetConnectionUriPath, zGetConnectionUriQuery, zListProjectBranchesPath, zRestoreSnapshotBody, zRestoreSnapshotPath, zSetSnapshotSchedulePath, zSuspendTimeoutSeconds } from "../../generated/zod.gen.js";
2
+ import { bindTool } from "./bind.js";
3
+ import * as z from "zod";
4
+ //#region src/lib/ergonomic/composed.ts
5
+ const writeAnnotations = {
6
+ readOnlyHint: false,
7
+ destructiveHint: true,
8
+ openWorldHint: true
9
+ };
10
+ const readAnnotations = {
11
+ readOnlyHint: true,
12
+ openWorldHint: true
13
+ };
14
+ const pooledField = z.boolean().describe("Return a pooled connection string. Default true. Set false for a direct connection.").optional();
15
+ const branchCreateFields = zBranchCreateRequest.shape.branch.unwrap().shape;
16
+ const projectCreateFields = zCreateProjectBody.shape.project.shape;
17
+ const createBranchWithComputeInputSchema = z.strictObject({
18
+ project_id: zCreateProjectBranchPath.shape.project_id,
19
+ name: branchCreateFields.name,
20
+ parent_id: branchCreateFields.parent_id,
21
+ compute: z.strictObject({
22
+ min_cu: zComputeUnit.optional(),
23
+ max_cu: zComputeUnit.optional(),
24
+ suspend_timeout_seconds: zSuspendTimeoutSeconds.optional()
25
+ }).optional(),
26
+ pooled: pooledField
27
+ });
28
+ const createProjectAndConnectInputSchema = z.strictObject({
29
+ ...projectCreateFields,
30
+ pooled: pooledField
31
+ });
32
+ const getDefaultInputSchema = z.strictObject({ project_id: zListProjectBranchesPath.shape.project_id });
33
+ const connectionStringInputSchema = z.strictObject({
34
+ project_id: zGetConnectionUriPath.shape.project_id,
35
+ branch_id: zGetConnectionUriQuery.shape.branch_id,
36
+ endpoint_id: zGetConnectionUriQuery.shape.endpoint_id,
37
+ database_name: zGetConnectionUriQuery.shape.database_name,
38
+ role_name: zGetConnectionUriQuery.shape.role_name,
39
+ pooled: pooledField
40
+ });
41
+ const restoreSnapshotInputSchema = z.strictObject({
42
+ project_id: zRestoreSnapshotPath.shape.project_id,
43
+ snapshot_id: zRestoreSnapshotPath.shape.snapshot_id,
44
+ name: zRestoreSnapshotBody.shape.name,
45
+ target_branch_id: zRestoreSnapshotBody.shape.target_branch_id,
46
+ finalize: z.boolean().describe("Finalize immediately (move computes onto the restored branch). Defaults to true when restoring as a new branch and false when restoring onto an existing branch.").optional()
47
+ });
48
+ const snapshotFrequency = z.enum([
49
+ "daily",
50
+ "weekly",
51
+ "monthly"
52
+ ]);
53
+ const setScheduleInputSchema = z.strictObject({
54
+ project_id: zSetSnapshotSchedulePath.shape.project_id,
55
+ branch_id: zSetSnapshotSchedulePath.shape.branch_id,
56
+ schedule: z.array(z.strictObject({
57
+ ...zBackupScheduleItem.shape,
58
+ frequency: snapshotFrequency
59
+ }))
60
+ });
61
+ const createBranchWithComputeTool = (options) => bindTool(options, {
62
+ operationId: "branches.createWithCompute",
63
+ id: "branches_create_with_compute",
64
+ title: "Create branch with compute",
65
+ description: "Create a branch with a read-write endpoint and return its connection string. The call waits until operation-backed provisioning finishes, up to five minutes by default.",
66
+ inputSchema: createBranchWithComputeInputSchema,
67
+ annotations: writeAnnotations,
68
+ requiresApproval: true,
69
+ metadata: {
70
+ method: "POST",
71
+ path: "/projects/{project_id}/branches",
72
+ stability: "stable",
73
+ deprecated: false,
74
+ tags: ["Branch"]
75
+ }
76
+ }, (neon, input, signal) => neon.branches.createWithCompute(input.project_id, {
77
+ name: input.name,
78
+ parentId: input.parent_id,
79
+ compute: input.compute === void 0 ? void 0 : {
80
+ minCu: input.compute.min_cu,
81
+ maxCu: input.compute.max_cu,
82
+ suspendTimeoutSeconds: input.compute.suspend_timeout_seconds
83
+ }
84
+ }, {
85
+ signal,
86
+ ...input.pooled === void 0 ? {} : { pooled: input.pooled }
87
+ }));
88
+ const createProjectAndConnectTool = (options) => bindTool(options, {
89
+ operationId: "projects.createAndConnect",
90
+ id: "projects_create_and_connect",
91
+ title: "Create project and connect",
92
+ description: "Create a project and return a connection string to its default branch. The call waits until operation-backed provisioning finishes, up to five minutes by default.",
93
+ inputSchema: createProjectAndConnectInputSchema,
94
+ annotations: writeAnnotations,
95
+ requiresApproval: true,
96
+ metadata: {
97
+ method: "POST",
98
+ path: "/projects",
99
+ stability: "stable",
100
+ deprecated: false,
101
+ tags: ["Project"]
102
+ }
103
+ }, (neon, input, signal) => {
104
+ const { pooled, ...project } = input;
105
+ return neon.projects.createAndConnect(project, {
106
+ signal,
107
+ ...pooled === void 0 ? {} : { pooled }
108
+ });
109
+ });
110
+ const getDefaultTool = (options) => bindTool(options, {
111
+ operationId: "branches.getDefault",
112
+ id: "branches_get_default",
113
+ title: "Get default branch",
114
+ description: "Resolve the project's default branch by the default flag, not by name.",
115
+ inputSchema: getDefaultInputSchema,
116
+ annotations: readAnnotations,
117
+ requiresApproval: false,
118
+ metadata: {
119
+ method: "GET",
120
+ path: "/projects/{project_id}/branches",
121
+ stability: "stable",
122
+ deprecated: false,
123
+ tags: ["Branch"]
124
+ }
125
+ }, (neon, input, signal) => neon.branches.getDefault(input.project_id, { signal }));
126
+ const connectionStringTool = (options) => bindTool(options, {
127
+ operationId: "postgres.connectionString",
128
+ id: "postgres_connection_string",
129
+ title: "Get connection string",
130
+ description: "Resolve a Postgres connection string. Auto-selects the default branch and the sole role and database when those are omitted. Errors when the selection is ambiguous.",
131
+ inputSchema: connectionStringInputSchema,
132
+ annotations: readAnnotations,
133
+ requiresApproval: true,
134
+ metadata: {
135
+ method: "GET",
136
+ path: "/projects/{project_id}/connection_uri",
137
+ stability: "stable",
138
+ deprecated: false,
139
+ tags: ["Project"]
140
+ }
141
+ }, (neon, input, signal) => neon.postgres.connectionString({
142
+ projectId: input.project_id,
143
+ ...input.branch_id === void 0 ? {} : { branchId: input.branch_id },
144
+ ...input.endpoint_id === void 0 ? {} : { endpointId: input.endpoint_id },
145
+ ...input.database_name === void 0 ? {} : { databaseName: input.database_name },
146
+ ...input.role_name === void 0 ? {} : { roleName: input.role_name },
147
+ ...input.pooled === void 0 ? {} : { pooled: input.pooled }
148
+ }, { signal }));
149
+ const restoreSnapshotTool = (options) => bindTool(options, {
150
+ operationId: "snapshots.restore",
151
+ id: "snapshots_restore",
152
+ title: "Restore snapshot",
153
+ description: "Restore a snapshot onto a new or existing branch. The call waits until operation-backed provisioning finishes. Preview callbacks are not available on this tool.",
154
+ inputSchema: restoreSnapshotInputSchema,
155
+ annotations: writeAnnotations,
156
+ requiresApproval: true,
157
+ metadata: {
158
+ method: "POST",
159
+ path: "/projects/{project_id}/snapshots/{snapshot_id}/restore",
160
+ stability: "stable",
161
+ deprecated: false,
162
+ tags: ["Snapshot"]
163
+ }
164
+ }, (neon, input, signal) => neon.snapshots.restore(input.project_id, input.snapshot_id, {
165
+ name: input.name,
166
+ targetBranchId: input.target_branch_id,
167
+ finalize: input.finalize
168
+ }, { signal }));
169
+ const setScheduleTool = (options) => bindTool(options, {
170
+ operationId: "snapshots.setSchedule",
171
+ id: "snapshots_set_schedule",
172
+ title: "Set snapshot schedule",
173
+ description: "Replace a branch's automatic snapshot schedule. Frequency must be daily, weekly, or monthly.",
174
+ inputSchema: setScheduleInputSchema,
175
+ annotations: writeAnnotations,
176
+ requiresApproval: true,
177
+ metadata: {
178
+ method: "PUT",
179
+ path: "/projects/{project_id}/branches/{branch_id}/backup_schedule",
180
+ stability: "stable",
181
+ deprecated: false,
182
+ tags: ["Snapshot"]
183
+ }
184
+ }, (neon, input, signal) => neon.snapshots.setSchedule(input.project_id, input.branch_id, { schedule: input.schedule }, { signal }));
185
+ //#endregion
186
+ export { connectionStringInputSchema, connectionStringTool, createBranchWithComputeInputSchema, createBranchWithComputeTool, createProjectAndConnectInputSchema, createProjectAndConnectTool, getDefaultInputSchema, getDefaultTool, restoreSnapshotInputSchema, restoreSnapshotTool, setScheduleInputSchema, setScheduleTool };
@@ -0,0 +1,7 @@
1
+ export declare const hiddenToolIds: readonly ["operations.waitFor", "branches.create", "projects.create", "postgres.roles.password", "storage.objects.get"];
2
+ export type HiddenToolId = (typeof hiddenToolIds)[number];
3
+ export declare const toolIds: readonly ["projects.list", "projects.get", "projects.createAndConnect", "projects.update", "projects.delete", "projects.recover", "projects.transfer", "projects.transferFromUser", "projects.permissions.list", "projects.permissions.grant", "projects.permissions.revoke", "projects.members.list", "projects.members.setRole", "projects.members.removeRole", "branches.list", "branches.get", "branches.createWithCompute", "branches.update", "branches.delete", "branches.getDefault", "branches.setDefault", "branches.finalizeRestore", "postgres.connectionString", "postgres.endpoints.list", "postgres.endpoints.listByBranch", "postgres.endpoints.get", "postgres.endpoints.create", "postgres.endpoints.update", "postgres.endpoints.delete", "postgres.endpoints.start", "postgres.endpoints.suspend", "postgres.endpoints.restart", "postgres.roles.list", "postgres.roles.get", "postgres.roles.create", "postgres.roles.delete", "postgres.roles.resetPassword", "postgres.databases.list", "postgres.databases.get", "postgres.databases.create", "postgres.databases.update", "postgres.databases.delete", "postgres.dataApi.get", "postgres.dataApi.create", "postgres.dataApi.update", "postgres.dataApi.delete", "storage.get", "storage.buckets.list", "storage.buckets.create", "storage.buckets.delete", "storage.objects.list", "storage.objects.delete", "storage.objects.deleteByPrefix", "storage.objects.presign", "functions.list", "functions.get", "functions.update", "functions.delete", "functions.deploy", "credentials.list", "credentials.create", "credentials.revoke", "aiGateway.get", "logs.query", "logs.fields", "logs.fieldValues", "snapshots.list", "snapshots.create", "snapshots.update", "snapshots.delete", "snapshots.restore", "snapshots.getSchedule", "snapshots.setSchedule", "operations.list", "operations.get", "auth.get", "auth.create", "auth.disable", "auth.updateConfig", "auth.oauthProviders.list", "auth.oauthProviders.add", "auth.oauthProviders.update", "auth.oauthProviders.delete", "auth.trustedDomains.list", "auth.trustedDomains.add", "auth.trustedDomains.delete", "auth.users.create", "auth.users.delete", "auth.users.updateRole", "consumption.perProject", "consumption.perProjectV2", "consumption.perBranchV2", "apiKeys.list", "apiKeys.create", "apiKeys.revoke", "regions.list", "user.me", "user.organizations"];
4
+ export type NeonToolId = (typeof toolIds)[number];
5
+ export declare const isNeonToolId: (id: string) => id is NeonToolId;
6
+ export declare const unpublishedToolError: (id: string) => TypeError;
7
+ //# sourceMappingURL=ids.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ids.d.ts","sourceRoot":"","sources":["../../../src/lib/ergonomic/ids.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,yHAMhB,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1D,eAAO,MAAM,OAAO,gxEAmGV,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;AAElD,eAAO,MAAM,YAAY,GAAI,IAAI,MAAM,KAAG,EAAE,IAAI,UACJ,CAAC;AAa7C,eAAO,MAAM,oBAAoB,GAAI,IAAI,MAAM,KAAG,SAOjD,CAAC"}