neonctl 2.37.0 → 2.38.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.
Files changed (160) hide show
  1. package/{LICENSE.md → LICENSE} +27 -3
  2. package/README.md +15 -700
  3. package/bin/cli.js +3 -0
  4. package/package.json +8 -75
  5. package/dist/analytics.js +0 -168
  6. package/dist/api.js +0 -720
  7. package/dist/auth.js +0 -125
  8. package/dist/callback.html +0 -51
  9. package/dist/cli.js +0 -9
  10. package/dist/commands/api.js +0 -278
  11. package/dist/commands/auth.js +0 -214
  12. package/dist/commands/bootstrap.js +0 -481
  13. package/dist/commands/branches.js +0 -488
  14. package/dist/commands/bucket.js +0 -549
  15. package/dist/commands/checkout.js +0 -321
  16. package/dist/commands/config.js +0 -626
  17. package/dist/commands/connection_string.js +0 -172
  18. package/dist/commands/data_api.js +0 -284
  19. package/dist/commands/databases.js +0 -82
  20. package/dist/commands/deploy.js +0 -26
  21. package/dist/commands/dev.js +0 -698
  22. package/dist/commands/diff.js +0 -222
  23. package/dist/commands/env.js +0 -189
  24. package/dist/commands/functions.js +0 -373
  25. package/dist/commands/index.js +0 -62
  26. package/dist/commands/init.js +0 -73
  27. package/dist/commands/inspect.js +0 -65
  28. package/dist/commands/ip_allow.js +0 -137
  29. package/dist/commands/link.js +0 -1121
  30. package/dist/commands/neon_auth.js +0 -1028
  31. package/dist/commands/operations.js +0 -28
  32. package/dist/commands/orgs.js +0 -24
  33. package/dist/commands/projects.js +0 -413
  34. package/dist/commands/psql.js +0 -62
  35. package/dist/commands/roles.js +0 -65
  36. package/dist/commands/schema_diff.js +0 -151
  37. package/dist/commands/set_context.js +0 -29
  38. package/dist/commands/snapshots.js +0 -455
  39. package/dist/commands/status.js +0 -40
  40. package/dist/commands/user.js +0 -15
  41. package/dist/commands/vpc_endpoints.js +0 -134
  42. package/dist/config.js +0 -11
  43. package/dist/config_format.js +0 -72
  44. package/dist/context.js +0 -231
  45. package/dist/current_branch_fast_path.js +0 -55
  46. package/dist/dev/env.js +0 -244
  47. package/dist/dev/functions.js +0 -70
  48. package/dist/dev/inputs.js +0 -63
  49. package/dist/dev/runtime.js +0 -146
  50. package/dist/env.js +0 -36
  51. package/dist/env_file.js +0 -159
  52. package/dist/errors.js +0 -80
  53. package/dist/functions_api.js +0 -48
  54. package/dist/help.js +0 -146
  55. package/dist/index.js +0 -240
  56. package/dist/log.js +0 -18
  57. package/dist/parameters.gen.js +0 -480
  58. package/dist/pkg.js +0 -25
  59. package/dist/psql/cli.js +0 -53
  60. package/dist/psql/command/cmd_cond.js +0 -437
  61. package/dist/psql/command/cmd_connect.js +0 -820
  62. package/dist/psql/command/cmd_copy.js +0 -1035
  63. package/dist/psql/command/cmd_describe.js +0 -1815
  64. package/dist/psql/command/cmd_format.js +0 -948
  65. package/dist/psql/command/cmd_io.js +0 -2193
  66. package/dist/psql/command/cmd_lo.js +0 -393
  67. package/dist/psql/command/cmd_meta.js +0 -969
  68. package/dist/psql/command/cmd_misc.js +0 -187
  69. package/dist/psql/command/cmd_pipeline.js +0 -1148
  70. package/dist/psql/command/cmd_restrict.js +0 -171
  71. package/dist/psql/command/cmd_show.js +0 -766
  72. package/dist/psql/command/dispatch.js +0 -343
  73. package/dist/psql/command/inputQueue.js +0 -42
  74. package/dist/psql/command/shared.js +0 -71
  75. package/dist/psql/complete/filenames.js +0 -139
  76. package/dist/psql/complete/index.js +0 -104
  77. package/dist/psql/complete/matcher.js +0 -315
  78. package/dist/psql/complete/psqlVars.js +0 -249
  79. package/dist/psql/complete/queries.js +0 -493
  80. package/dist/psql/complete/rules.js +0 -2424
  81. package/dist/psql/core/common.js +0 -1253
  82. package/dist/psql/core/help.js +0 -576
  83. package/dist/psql/core/mainloop.js +0 -1360
  84. package/dist/psql/core/prompt.js +0 -439
  85. package/dist/psql/core/settings.js +0 -686
  86. package/dist/psql/core/sqlHelp.js +0 -1066
  87. package/dist/psql/core/startup.js +0 -846
  88. package/dist/psql/core/syncVars.js +0 -116
  89. package/dist/psql/core/variables.js +0 -287
  90. package/dist/psql/describe/formatters.js +0 -1330
  91. package/dist/psql/describe/processNamePattern.js +0 -270
  92. package/dist/psql/describe/queries.js +0 -2452
  93. package/dist/psql/describe/versionGate.js +0 -44
  94. package/dist/psql/index.js +0 -2030
  95. package/dist/psql/io/history.js +0 -299
  96. package/dist/psql/io/input.js +0 -120
  97. package/dist/psql/io/lineEditor/buffer.js +0 -325
  98. package/dist/psql/io/lineEditor/complete.js +0 -227
  99. package/dist/psql/io/lineEditor/filename.js +0 -159
  100. package/dist/psql/io/lineEditor/index.js +0 -893
  101. package/dist/psql/io/lineEditor/keymap.js +0 -745
  102. package/dist/psql/io/lineEditor/vt100.js +0 -363
  103. package/dist/psql/io/pgpass.js +0 -202
  104. package/dist/psql/io/pgservice.js +0 -194
  105. package/dist/psql/io/psqlrc.js +0 -422
  106. package/dist/psql/print/aligned.js +0 -1748
  107. package/dist/psql/print/asciidoc.js +0 -230
  108. package/dist/psql/print/crosstab.js +0 -463
  109. package/dist/psql/print/csv.js +0 -76
  110. package/dist/psql/print/html.js +0 -240
  111. package/dist/psql/print/json.js +0 -96
  112. package/dist/psql/print/latex.js +0 -379
  113. package/dist/psql/print/pager.js +0 -267
  114. package/dist/psql/print/troff.js +0 -240
  115. package/dist/psql/print/unaligned.js +0 -99
  116. package/dist/psql/print/units.js +0 -188
  117. package/dist/psql/scanner/slash.js +0 -515
  118. package/dist/psql/scanner/sql.js +0 -914
  119. package/dist/psql/scanner/stringutils.js +0 -394
  120. package/dist/psql/types/backslash.js +0 -1
  121. package/dist/psql/types/connection.js +0 -1
  122. package/dist/psql/types/index.js +0 -7
  123. package/dist/psql/types/printer.js +0 -1
  124. package/dist/psql/types/repl.js +0 -1
  125. package/dist/psql/types/scanner.js +0 -24
  126. package/dist/psql/types/settings.js +0 -1
  127. package/dist/psql/types/variables.js +0 -1
  128. package/dist/psql/wire/connection.js +0 -2857
  129. package/dist/psql/wire/copy.js +0 -108
  130. package/dist/psql/wire/notify.js +0 -59
  131. package/dist/psql/wire/pipeline.js +0 -521
  132. package/dist/psql/wire/protocol.js +0 -466
  133. package/dist/psql/wire/sasl.js +0 -294
  134. package/dist/psql/wire/tls.js +0 -602
  135. package/dist/storage_api.js +0 -147
  136. package/dist/test_utils/fixtures.js +0 -121
  137. package/dist/test_utils/oauth_server.js +0 -9
  138. package/dist/types.js +0 -1
  139. package/dist/utils/ai_gateway_notice.js +0 -180
  140. package/dist/utils/api_enums.js +0 -33
  141. package/dist/utils/auth.js +0 -5
  142. package/dist/utils/branch_notice.js +0 -22
  143. package/dist/utils/branch_picker.js +0 -103
  144. package/dist/utils/compute_units.js +0 -28
  145. package/dist/utils/config_diff.js +0 -185
  146. package/dist/utils/enrichers.js +0 -161
  147. package/dist/utils/esbuild.js +0 -158
  148. package/dist/utils/formats.js +0 -18
  149. package/dist/utils/git_diff.js +0 -90
  150. package/dist/utils/inspect_db.js +0 -153
  151. package/dist/utils/inspect_queries.js +0 -372
  152. package/dist/utils/middlewares.js +0 -20
  153. package/dist/utils/openapi.js +0 -114
  154. package/dist/utils/package_manager.js +0 -68
  155. package/dist/utils/point_in_time.js +0 -56
  156. package/dist/utils/psql.js +0 -120
  157. package/dist/utils/string.js +0 -5
  158. package/dist/utils/ui.js +0 -59
  159. package/dist/utils/zip.js +0 -4
  160. package/dist/writer.js +0 -97
@@ -1,480 +0,0 @@
1
- // FILE IS GENERATED, DO NOT EDIT
2
- export const projectCreateRequest = {
3
- 'project.settings.quota.active_time_seconds': {
4
- type: "number",
5
- description: "The total amount of wall-clock time allowed to be spent by the project's compute endpoints.\n",
6
- demandOption: false,
7
- },
8
- 'project.settings.quota.compute_time_seconds': {
9
- type: "number",
10
- description: "The total amount of CPU seconds allowed to be spent by the project's compute endpoints.\n",
11
- demandOption: false,
12
- },
13
- 'project.settings.quota.written_data_bytes': {
14
- type: "number",
15
- description: "Total amount of data written to all of a project's branches.\n",
16
- demandOption: false,
17
- },
18
- 'project.settings.quota.data_transfer_bytes': {
19
- type: "number",
20
- description: "Total amount of data transferred from all of a project's branches using the proxy.\n",
21
- demandOption: false,
22
- },
23
- 'project.settings.quota.logical_size_bytes': {
24
- type: "number",
25
- description: "Limit on the logical size of every project's branch.\n\nIf a branch exceeds its `logical_size_bytes` quota, computes can still be started,\nbut write operations will fail—allowing data to be deleted to free up space.\nComputes on other branches are not affected.\n\nSetting `logical_size_bytes` overrides any lower value set by the `neon.max_cluster_size` Postgres setting.\n",
26
- demandOption: false,
27
- },
28
- 'project.settings.allowed_ips.ips': {
29
- type: "array",
30
- description: "A list of IP addresses that are allowed to connect to the endpoint.",
31
- demandOption: false,
32
- },
33
- 'project.settings.allowed_ips.protected_branches_only': {
34
- type: "boolean",
35
- description: "If true, the list will be applied only to protected branches.",
36
- demandOption: false,
37
- },
38
- 'project.settings.enable_logical_replication': {
39
- type: "boolean",
40
- description: "Sets wal_level=logical for all compute endpoints in this project.\nAll active endpoints will be suspended.\nOnce enabled, logical replication cannot be disabled.\n",
41
- demandOption: false,
42
- },
43
- 'project.settings.maintenance_window.weekdays': {
44
- type: "array",
45
- description: "A list of weekdays when the maintenance window is active.\nEncoded as ints, where 1 - Monday, and 7 - Sunday.\n",
46
- demandOption: true,
47
- },
48
- 'project.settings.maintenance_window.start_time': {
49
- type: "string",
50
- description: "Start time of the maintenance window, in the format of \"HH:MM\". Uses UTC.\n",
51
- demandOption: true,
52
- },
53
- 'project.settings.maintenance_window.end_time': {
54
- type: "string",
55
- description: "End time of the maintenance window, in the format of \"HH:MM\". Uses UTC.\n",
56
- demandOption: true,
57
- },
58
- 'project.settings.block_public_connections': {
59
- type: "boolean",
60
- description: "When set, connections from the public internet\nare disallowed. This supersedes the AllowedIPs list.\nThis parameter is under active development and its semantics may change in the future.\n",
61
- demandOption: false,
62
- },
63
- 'project.settings.block_vpc_connections': {
64
- type: "boolean",
65
- description: "When set, connections using VPC endpoints are disallowed.\nThis parameter is under active development and its semantics may change in the future.\n",
66
- demandOption: false,
67
- },
68
- 'project.settings.audit_log_level': {
69
- type: "string",
70
- description: undefined,
71
- demandOption: false,
72
- choices: ["base", "extended", "full"],
73
- },
74
- 'project.settings.hipaa': {
75
- type: "boolean",
76
- description: undefined,
77
- demandOption: false,
78
- },
79
- 'project.settings.preload_libraries.use_defaults': {
80
- type: "boolean",
81
- description: undefined,
82
- demandOption: false,
83
- },
84
- 'project.settings.preload_libraries.enabled_libraries': {
85
- type: "array",
86
- description: undefined,
87
- demandOption: false,
88
- },
89
- 'project.name': {
90
- type: "string",
91
- description: "The project name. If not specified, the name will be identical to the generated project ID",
92
- demandOption: false,
93
- },
94
- 'project.branch.name': {
95
- type: "string",
96
- description: "The default branch name. If not specified, the default branch name, `main`, will be used.\n",
97
- demandOption: false,
98
- },
99
- 'project.branch.role_name': {
100
- type: "string",
101
- description: "The role name. If not specified, the default role name, `{database_name}_owner`, will be used.\n",
102
- demandOption: false,
103
- },
104
- 'project.branch.database_name': {
105
- type: "string",
106
- description: "The database name. If not specified, the default database name, `neondb`, will be used.\n",
107
- demandOption: false,
108
- },
109
- 'project.provisioner': {
110
- type: "string",
111
- description: "The Neon compute provisioner.\nSpecify the `k8s-neonvm` provisioner to create a compute endpoint that supports Autoscaling.\n\nProvisioner can be one of the following values:\n* k8s-pod\n* k8s-neonvm\n* serverless-platform\n\nClients must expect, that any string value that is not documented in the description above should be treated as a error. UNKNOWN value if safe to treat as an error too.\n",
112
- demandOption: false,
113
- },
114
- 'project.region_id': {
115
- type: "string",
116
- description: "The region identifier. Refer to our [Regions](https://neon.com/docs/introduction/regions) documentation for supported regions. Values are specified in this format: `aws-us-east-1`\n",
117
- demandOption: false,
118
- },
119
- 'project.default_endpoint_settings.suspend_timeout_seconds': {
120
- type: "number",
121
- description: "Duration of inactivity in seconds after which the compute endpoint is\nautomatically suspended. The value `0` means use the default value.\nThe value `-1` means never suspend. The default value is `300` seconds (5 minutes).\nThe minimum value is `60` seconds (1 minute).\nThe maximum value is `604800` seconds (1 week). For more information, see\n[Scale to zero configuration](https://neon.com/docs/manage/endpoints#scale-to-zero-configuration).\n",
122
- demandOption: false,
123
- },
124
- 'project.pg_version': {
125
- type: "number",
126
- description: "The major Postgres version number. Generally available versions are `14`, `15`, `16`, `17`, and `18`. `19` is being rolled out and is only accepted in regions where it has been enabled; requesting it in a region where it is not yet available returns an error.",
127
- demandOption: false,
128
- },
129
- 'project.store_passwords': {
130
- type: "boolean",
131
- description: "Whether or not passwords are stored for roles in the Neon project. Storing passwords facilitates access to Neon features that require authorization.\n",
132
- demandOption: false,
133
- },
134
- 'project.history_retention_seconds': {
135
- type: "number",
136
- description: "The number of seconds to retain the shared history for all branches in this project.\nThe default is 1 day (86400 seconds).\n",
137
- demandOption: false,
138
- },
139
- 'project.org_id': {
140
- type: "string",
141
- description: "Organization id in case the project created belongs to an organization.\nIf not present, project is owned by a user and not by org.\n",
142
- demandOption: false,
143
- },
144
- };
145
- export const projectUpdateRequest = {
146
- 'project.settings.quota.active_time_seconds': {
147
- type: "number",
148
- description: "The total amount of wall-clock time allowed to be spent by the project's compute endpoints.\n",
149
- demandOption: false,
150
- },
151
- 'project.settings.quota.compute_time_seconds': {
152
- type: "number",
153
- description: "The total amount of CPU seconds allowed to be spent by the project's compute endpoints.\n",
154
- demandOption: false,
155
- },
156
- 'project.settings.quota.written_data_bytes': {
157
- type: "number",
158
- description: "Total amount of data written to all of a project's branches.\n",
159
- demandOption: false,
160
- },
161
- 'project.settings.quota.data_transfer_bytes': {
162
- type: "number",
163
- description: "Total amount of data transferred from all of a project's branches using the proxy.\n",
164
- demandOption: false,
165
- },
166
- 'project.settings.quota.logical_size_bytes': {
167
- type: "number",
168
- description: "Limit on the logical size of every project's branch.\n\nIf a branch exceeds its `logical_size_bytes` quota, computes can still be started,\nbut write operations will fail—allowing data to be deleted to free up space.\nComputes on other branches are not affected.\n\nSetting `logical_size_bytes` overrides any lower value set by the `neon.max_cluster_size` Postgres setting.\n",
169
- demandOption: false,
170
- },
171
- 'project.settings.allowed_ips.ips': {
172
- type: "array",
173
- description: "A list of IP addresses that are allowed to connect to the endpoint.",
174
- demandOption: false,
175
- },
176
- 'project.settings.allowed_ips.protected_branches_only': {
177
- type: "boolean",
178
- description: "If true, the list will be applied only to protected branches.",
179
- demandOption: false,
180
- },
181
- 'project.settings.enable_logical_replication': {
182
- type: "boolean",
183
- description: "Sets wal_level=logical for all compute endpoints in this project.\nAll active endpoints will be suspended.\nOnce enabled, logical replication cannot be disabled.\n",
184
- demandOption: false,
185
- },
186
- 'project.settings.maintenance_window.weekdays': {
187
- type: "array",
188
- description: "A list of weekdays when the maintenance window is active.\nEncoded as ints, where 1 - Monday, and 7 - Sunday.\n",
189
- demandOption: true,
190
- },
191
- 'project.settings.maintenance_window.start_time': {
192
- type: "string",
193
- description: "Start time of the maintenance window, in the format of \"HH:MM\". Uses UTC.\n",
194
- demandOption: true,
195
- },
196
- 'project.settings.maintenance_window.end_time': {
197
- type: "string",
198
- description: "End time of the maintenance window, in the format of \"HH:MM\". Uses UTC.\n",
199
- demandOption: true,
200
- },
201
- 'project.settings.block_public_connections': {
202
- type: "boolean",
203
- description: "When set, connections from the public internet\nare disallowed. This supersedes the AllowedIPs list.\nThis parameter is under active development and its semantics may change in the future.\n",
204
- demandOption: false,
205
- },
206
- 'project.settings.block_vpc_connections': {
207
- type: "boolean",
208
- description: "When set, connections using VPC endpoints are disallowed.\nThis parameter is under active development and its semantics may change in the future.\n",
209
- demandOption: false,
210
- },
211
- 'project.settings.audit_log_level': {
212
- type: "string",
213
- description: undefined,
214
- demandOption: false,
215
- choices: ["base", "extended", "full"],
216
- },
217
- 'project.settings.hipaa': {
218
- type: "boolean",
219
- description: undefined,
220
- demandOption: false,
221
- },
222
- 'project.settings.preload_libraries.use_defaults': {
223
- type: "boolean",
224
- description: undefined,
225
- demandOption: false,
226
- },
227
- 'project.settings.preload_libraries.enabled_libraries': {
228
- type: "array",
229
- description: undefined,
230
- demandOption: false,
231
- },
232
- 'project.name': {
233
- type: "string",
234
- description: "The project name",
235
- demandOption: false,
236
- },
237
- 'project.default_endpoint_settings.suspend_timeout_seconds': {
238
- type: "number",
239
- description: "Duration of inactivity in seconds after which the compute endpoint is\nautomatically suspended. The value `0` means use the default value.\nThe value `-1` means never suspend. The default value is `300` seconds (5 minutes).\nThe minimum value is `60` seconds (1 minute).\nThe maximum value is `604800` seconds (1 week). For more information, see\n[Scale to zero configuration](https://neon.com/docs/manage/endpoints#scale-to-zero-configuration).\n",
240
- demandOption: false,
241
- },
242
- 'project.history_retention_seconds': {
243
- type: "number",
244
- description: "The number of seconds to retain the shared history for all branches in this project.\nThe default is 1 day (604800 seconds).\n",
245
- demandOption: false,
246
- },
247
- };
248
- export const branchCreateRequest = {
249
- 'endpoints': {
250
- type: "array",
251
- description: undefined,
252
- demandOption: false,
253
- },
254
- 'branch.parent_id': {
255
- type: "string",
256
- description: "The `branch_id` of the parent branch. If omitted or empty, the branch will be created from the project's default branch.\n",
257
- demandOption: false,
258
- },
259
- 'branch.name': {
260
- type: "string",
261
- description: "The branch name\n",
262
- demandOption: false,
263
- },
264
- 'branch.parent_lsn': {
265
- type: "string",
266
- description: "A Log Sequence Number (LSN) on the parent branch. The branch will be created with data from this LSN.\n",
267
- demandOption: false,
268
- },
269
- 'branch.parent_timestamp': {
270
- type: "string",
271
- description: "A timestamp identifying a point in time on the parent branch. The branch will be created with data starting from this point in time.\nThe timestamp must be provided in ISO 8601 format; for example: `2024-02-26T12:00:00Z`.\n",
272
- demandOption: false,
273
- },
274
- 'branch.protected': {
275
- type: "boolean",
276
- description: "Whether the branch is protected\n",
277
- demandOption: false,
278
- },
279
- 'branch.archived': {
280
- type: "boolean",
281
- description: "Whether to create the branch as archived\n",
282
- demandOption: false,
283
- },
284
- 'branch.init_source': {
285
- type: "string",
286
- description: "The source of initialization for the branch. Valid values are `schema-only` and `parent-data` (default).\n * `schema-only` - creates a new root branch containing only the schema. Use `parent_id` to specify the source branch. Optionally, you can provide `parent_lsn` or `parent_timestamp` to branch from a specific point in time or LSN. These fields define which branch to copy the schema from and at what point—they do not establish a parent-child relationship between the `parent_id` branch and the new schema-only branch.\n * `parent-data` - creates the branch with both schema and data from the parent.\n",
287
- demandOption: false,
288
- },
289
- 'branch.expires_at': {
290
- type: "string",
291
- description: "The timestamp when the branch is scheduled to expire and be automatically deleted. Must be set by the client following the [RFC 3339, section 5.6](https://tools.ietf.org/html/rfc3339#section-5.6) format with precision up to seconds (such as 2025-06-09T18:02:16Z). Deletion is performed by a background job and may not occur exactly at the specified time.\n\nAccess to this feature is currently limited to participants in the Early Access Program.\n",
292
- demandOption: false,
293
- },
294
- };
295
- export const branchCreateRequestEndpointOptions = {
296
- 'type': {
297
- type: "string",
298
- description: "The compute endpoint type. Either `read_write` or `read_only`.\n",
299
- demandOption: true,
300
- choices: ["read_only", "read_write"],
301
- },
302
- 'settings.preload_libraries.use_defaults': {
303
- type: "boolean",
304
- description: undefined,
305
- demandOption: false,
306
- },
307
- 'settings.preload_libraries.enabled_libraries': {
308
- type: "array",
309
- description: undefined,
310
- demandOption: false,
311
- },
312
- 'provisioner': {
313
- type: "string",
314
- description: "The Neon compute provisioner.\nSpecify the `k8s-neonvm` provisioner to create a compute endpoint that supports Autoscaling.\n\nProvisioner can be one of the following values:\n* k8s-pod\n* k8s-neonvm\n* serverless-platform\n\nClients must expect, that any string value that is not documented in the description above should be treated as a error. UNKNOWN value if safe to treat as an error too.\n",
315
- demandOption: false,
316
- },
317
- 'suspend_timeout_seconds': {
318
- type: "number",
319
- description: "Duration of inactivity in seconds after which the compute endpoint is\nautomatically suspended. The value `0` means use the default value.\nThe value `-1` means never suspend. The default value is `300` seconds (5 minutes).\nThe minimum value is `60` seconds (1 minute).\nThe maximum value is `604800` seconds (1 week). For more information, see\n[Scale to zero configuration](https://neon.com/docs/manage/endpoints#scale-to-zero-configuration).\n",
320
- demandOption: false,
321
- },
322
- };
323
- export const branchUpdateRequest = {
324
- 'branch.name': {
325
- type: "string",
326
- description: undefined,
327
- demandOption: false,
328
- },
329
- 'branch.protected': {
330
- type: "boolean",
331
- description: undefined,
332
- demandOption: false,
333
- },
334
- 'branch.expires_at': {
335
- type: "string",
336
- description: "The timestamp when the branch is scheduled to expire and be automatically deleted. Must be set by the client following the [RFC 3339, section 5.6](https://tools.ietf.org/html/rfc3339#section-5.6) format with precision up to seconds (such as 2025-06-09T18:02:16Z). Deletion is performed by a background job and may not occur exactly at the specified time. If this field is set to null, the expiration timestamp is removed.\n\nAccess to this feature is currently limited to participants in the Early Access Program.\n",
337
- demandOption: false,
338
- },
339
- };
340
- export const endpointCreateRequest = {
341
- 'endpoint.branch_id': {
342
- type: "string",
343
- description: "The ID of the branch the compute endpoint will be associated with\n",
344
- demandOption: true,
345
- },
346
- 'endpoint.region_id': {
347
- type: "string",
348
- description: "The region where the compute endpoint will be created. Only the project's `region_id` is permitted.\n",
349
- demandOption: false,
350
- },
351
- 'endpoint.type': {
352
- type: "string",
353
- description: "The compute endpoint type. Either `read_write` or `read_only`.\n",
354
- demandOption: true,
355
- choices: ["read_only", "read_write"],
356
- },
357
- 'endpoint.settings.preload_libraries.use_defaults': {
358
- type: "boolean",
359
- description: undefined,
360
- demandOption: false,
361
- },
362
- 'endpoint.settings.preload_libraries.enabled_libraries': {
363
- type: "array",
364
- description: undefined,
365
- demandOption: false,
366
- },
367
- 'endpoint.provisioner': {
368
- type: "string",
369
- description: "The Neon compute provisioner.\nSpecify the `k8s-neonvm` provisioner to create a compute endpoint that supports Autoscaling.\n\nProvisioner can be one of the following values:\n* k8s-pod\n* k8s-neonvm\n* serverless-platform\n\nClients must expect, that any string value that is not documented in the description above should be treated as a error. UNKNOWN value if safe to treat as an error too.\n",
370
- demandOption: false,
371
- },
372
- 'endpoint.pooler_enabled': {
373
- type: "boolean",
374
- description: "DEPRECATED. Whether to enable connection pooling for the compute endpoint.\nThe recommended way to enable connection pooling is to append `-pooler` to the endpoint ID in the connection string.\nSee [How to use connection pooling](https://neon.com/docs/connect/connection-pooling#how-to-use-connection-pooling)\n",
375
- demandOption: false,
376
- },
377
- 'endpoint.pooler_mode': {
378
- type: "string",
379
- description: "DEPRECATED. The connection pooler mode. This field is deprecated and will be removed after 2026-06-20.\n",
380
- demandOption: false,
381
- choices: ["transaction"],
382
- },
383
- 'endpoint.disabled': {
384
- type: "boolean",
385
- description: "Whether to restrict connections to the compute endpoint.\nEnabling this option schedules a suspend compute operation.\nA disabled compute endpoint cannot be enabled by a connection or\nconsole action. However, the compute endpoint is periodically\nenabled by check_availability operations.\n",
386
- demandOption: false,
387
- },
388
- 'endpoint.passwordless_access': {
389
- type: "boolean",
390
- description: "NOT YET IMPLEMENTED. Whether to permit passwordless access to the compute endpoint.\n",
391
- demandOption: false,
392
- },
393
- 'endpoint.suspend_timeout_seconds': {
394
- type: "number",
395
- description: "Duration of inactivity in seconds after which the compute endpoint is\nautomatically suspended. The value `0` means use the default value.\nThe value `-1` means never suspend. The default value is `300` seconds (5 minutes).\nThe minimum value is `60` seconds (1 minute).\nThe maximum value is `604800` seconds (1 week). For more information, see\n[Scale to zero configuration](https://neon.com/docs/manage/endpoints#scale-to-zero-configuration).\n",
396
- demandOption: false,
397
- },
398
- 'endpoint.name': {
399
- type: "string",
400
- description: "Optional name of the compute endpoint\n",
401
- demandOption: false,
402
- },
403
- };
404
- export const endpointUpdateRequest = {
405
- 'endpoint.branch_id': {
406
- type: "string",
407
- description: "DEPRECATED: This field will be removed in a future release.\nThe destination branch ID. The destination branch must not have an existing read-write endpoint.\n",
408
- demandOption: false,
409
- },
410
- 'endpoint.provisioner': {
411
- type: "string",
412
- description: "The Neon compute provisioner.\nSpecify the `k8s-neonvm` provisioner to create a compute endpoint that supports Autoscaling.\n\nProvisioner can be one of the following values:\n* k8s-pod\n* k8s-neonvm\n* serverless-platform\n\nClients must expect, that any string value that is not documented in the description above should be treated as a error. UNKNOWN value if safe to treat as an error too.\n",
413
- demandOption: false,
414
- },
415
- 'endpoint.settings.preload_libraries.use_defaults': {
416
- type: "boolean",
417
- description: undefined,
418
- demandOption: false,
419
- },
420
- 'endpoint.settings.preload_libraries.enabled_libraries': {
421
- type: "array",
422
- description: undefined,
423
- demandOption: false,
424
- },
425
- 'endpoint.pooler_enabled': {
426
- type: "boolean",
427
- description: "DEPRECATED. Whether to enable connection pooling for the compute endpoint.\nThe recommended way to enable connection pooling is to append `-pooler` to the endpoint ID in the connection string.\nSee [How to use connection pooling](https://neon.com/docs/connect/connection-pooling#how-to-use-connection-pooling)\n",
428
- demandOption: false,
429
- },
430
- 'endpoint.pooler_mode': {
431
- type: "string",
432
- description: "DEPRECATED. The connection pooler mode. This field is deprecated and will be removed after 2026-06-20.\n",
433
- demandOption: false,
434
- choices: ["transaction"],
435
- },
436
- 'endpoint.disabled': {
437
- type: "boolean",
438
- description: "Whether to restrict connections to the compute endpoint.\nEnabling this option schedules a suspend compute operation.\nA disabled compute endpoint cannot be enabled by a connection or\nconsole action. However, the compute endpoint is periodically\nenabled by check_availability operations.\n",
439
- demandOption: false,
440
- },
441
- 'endpoint.passwordless_access': {
442
- type: "boolean",
443
- description: "NOT YET IMPLEMENTED. Whether to permit passwordless access to the compute endpoint.\n",
444
- demandOption: false,
445
- },
446
- 'endpoint.suspend_timeout_seconds': {
447
- type: "number",
448
- description: "Duration of inactivity in seconds after which the compute endpoint is\nautomatically suspended. The value `0` means use the default value.\nThe value `-1` means never suspend. The default value is `300` seconds (5 minutes).\nThe minimum value is `60` seconds (1 minute).\nThe maximum value is `604800` seconds (1 week). For more information, see\n[Scale to zero configuration](https://neon.com/docs/manage/endpoints#scale-to-zero-configuration).\n",
449
- demandOption: false,
450
- },
451
- 'endpoint.name': {
452
- type: "string",
453
- description: "Optional name of the compute endpoint\n",
454
- demandOption: false,
455
- },
456
- };
457
- export const databaseCreateRequest = {
458
- 'database.name': {
459
- type: "string",
460
- description: "The name of the database\n",
461
- demandOption: true,
462
- },
463
- 'database.owner_name': {
464
- type: "string",
465
- description: "The name of the role that owns the database\n",
466
- demandOption: true,
467
- },
468
- };
469
- export const roleCreateRequest = {
470
- 'role.name': {
471
- type: "string",
472
- description: "The role name. Cannot exceed 63 bytes in length.\n",
473
- demandOption: true,
474
- },
475
- 'role.no_login': {
476
- type: "boolean",
477
- description: "Whether to create a role that cannot login.\n",
478
- demandOption: false,
479
- },
480
- };
package/dist/pkg.js DELETED
@@ -1,25 +0,0 @@
1
- import { readFileSync } from "node:fs";
2
- import { dirname, join } from "node:path";
3
- import { fileURLToPath } from "node:url";
4
- /**
5
- * Load the CLI's package.json for version metadata. In the built CLI it sits right next to
6
- * this module (the build copies it into `dist`); when running from source (tests, `tsx`) it
7
- * does not, so we walk up to the nearest `package.json`. Both layouts resolve to the same
8
- * file, keeping `pkg.version` correct everywhere without a test-only shim.
9
- */
10
- const loadPkg = () => {
11
- let dir = dirname(fileURLToPath(import.meta.url));
12
- for (;;) {
13
- try {
14
- return JSON.parse(readFileSync(join(dir, "package.json"), "utf-8"));
15
- }
16
- catch {
17
- const parent = dirname(dir);
18
- if (parent === dir) {
19
- throw new Error("Could not locate package.json for version detection.");
20
- }
21
- dir = parent;
22
- }
23
- }
24
- };
25
- export default loadPkg();
package/dist/psql/cli.js DELETED
@@ -1,53 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Standalone psql shim.
4
- *
5
- * Thin wrapper around `runPsql` that lets the conformance harness — and any
6
- * caller that wants a psql-compatible CLI — invoke our embedded TypeScript
7
- * psql directly via `node dist/psql/cli.js`, without going through the
8
- * neonctl yargs entrypoint.
9
- *
10
- * Why this exists: `dist/cli.js` is the neonctl entrypoint; yargs eats
11
- * libpq-style flags (e.g. `-v ON_ERROR_STOP=0` collides with yargs'
12
- * built-in `--version`). The conformance suite needs to spawn a binary
13
- * that accepts the upstream psql flag grammar (`-h`/`-p`/`-U`/`-d`/`-X`/
14
- * `-v VAR=VALUE`/`--no-psqlrc`/`--echo-all`/`--quiet`/etc.) and reads SQL
15
- * from stdin. This shim wires `process.argv.slice(2)` straight into
16
- * `runPsql`, which already speaks that grammar via `parseStartupArgs`.
17
- *
18
- * Argv shape:
19
- * - If the first positional looks like a connection URI / conninfo
20
- * (per `looksLikeConnectionString`), it stays at argv[0] — same shape
21
- * as the legacy native-psql call site in `src/utils/psql.ts` and the
22
- * existing `runPsql` API.
23
- * - Otherwise (the regress harness case: bare libpq flags), we prepend
24
- * an empty placeholder URI so `runPsql([''] + flags)` falls through to
25
- * `parseStartupArgs` and resolves the connection from `-h`/`-p`/`-U`/
26
- * `-d` plus PG* env / pgpass / service via the layered resolver.
27
- *
28
- * Exit code: forwarded straight from `runPsql` (matches upstream psql's
29
- * EXIT_SUCCESS / EXIT_FAILURE / EXIT_USER / EXIT_BADCONN values; see
30
- * `core/mainloop.ts`).
31
- */
32
- import { looksLikeConnectionString, runPsql } from "./index.js";
33
- const main = async () => {
34
- const raw = process.argv.slice(2);
35
- // Detect whether the first arg is a connection URI/conninfo string.
36
- // libpq's `recognized_connection_string()` covers both `postgres[ql]://…`
37
- // URIs and bare `key=value` conninfo strings — `looksLikeConnectionString`
38
- // mirrors that test.
39
- const argv = raw.length > 0 && looksLikeConnectionString(raw[0])
40
- ? raw
41
- : ["", ...raw];
42
- const code = await runPsql(argv, {
43
- stdin: process.stdin,
44
- stdout: process.stdout,
45
- stderr: process.stderr,
46
- });
47
- process.exit(code);
48
- };
49
- main().catch((err) => {
50
- const msg = err instanceof Error ? err.message : String(err);
51
- process.stderr.write(`psql: fatal: ${msg}\n`);
52
- process.exit(1);
53
- });