New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@neondatabase/api-client

Package Overview
Dependencies
Maintainers
2
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@neondatabase/api-client - npm Package Compare versions

Comparing version 1.4.1 to 1.5.0

168

dist/api.gen.js

@@ -86,3 +86,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.Api = exports.HttpClient = exports.ContentType = exports.SupportTicketSeverity = exports.BillingSubscriptionType = exports.EndpointPoolerMode = exports.EndpointType = exports.EndpointState = exports.BranchState = exports.OperationStatus = exports.OperationAction = exports.Provisioner = void 0;
exports.Api = exports.HttpClient = exports.ContentType = exports.SupportTicketSeverity = exports.IdentityProviderId = exports.MemberRole = exports.BillingSubscriptionType = exports.EndpointPoolerMode = exports.EndpointType = exports.EndpointState = exports.BranchState = exports.OperationStatus = exports.OperationAction = exports.Provisioner = void 0;
/**

@@ -115,2 +115,4 @@ * The Neon compute provisioner.

OperationAction["ApplyStorageConfig"] = "apply_storage_config";
OperationAction["PrepareSecondaryPageserver"] = "prepare_secondary_pageserver";
OperationAction["SwitchPageserver"] = "switch_pageserver";
})(OperationAction = exports.OperationAction || (exports.OperationAction = {}));

@@ -163,3 +165,20 @@ /** The status of the operation */

BillingSubscriptionType["AwsMarketplace"] = "aws_marketplace";
BillingSubscriptionType["FreeV2"] = "free_v2";
BillingSubscriptionType["Launch"] = "launch";
BillingSubscriptionType["Scale"] = "scale";
})(BillingSubscriptionType = exports.BillingSubscriptionType || (exports.BillingSubscriptionType = {}));
/** The role of the organization member */
var MemberRole;
(function (MemberRole) {
MemberRole["Admin"] = "admin";
MemberRole["Member"] = "member";
})(MemberRole = exports.MemberRole || (exports.MemberRole = {}));
/** Identity provider id from keycloak */
var IdentityProviderId;
(function (IdentityProviderId) {
IdentityProviderId["Github"] = "github";
IdentityProviderId["Google"] = "google";
IdentityProviderId["Hasura"] = "hasura";
IdentityProviderId["Keycloak"] = "keycloak";
})(IdentityProviderId = exports.IdentityProviderId || (exports.IdentityProviderId = {}));
var SupportTicketSeverity;

@@ -257,5 +276,5 @@ (function (SupportTicketSeverity) {

*
* The Neon API allows you to access and manage Neon programmatically. You can use the Neon API to manage API keys, projects, branches, endpoints, databases, roles, and operations. For information about these features, refer to the [Neon documentation](https://neon.tech/docs/manage/overview/).
* The Neon API allows you to access and manage Neon programmatically. You can use the Neon API to manage API keys, projects, branches, compute endpoints, databases, roles, and operations. For information about these features, refer to the [Neon documentation](https://neon.tech/docs/manage/overview/).
*
* You can run Neon API requests from this API reference using the **Try It** feature provided for each method. Enter your API key as a **Bearer** token in the **Authoization** section of the page.
* You can run Neon API requests from this API reference using the **Try It** feature. Enter your API key as a **Bearer** token in the **Authoization** section of the page.
*

@@ -334,3 +353,3 @@ * You can create and manage API keys in the Neon Console. See [Manage API keys](https://neon.tech/docs/manage/api-keys/) for instructions.

/**
* @description Creates a Neon project. A project is the top-level object in the Neon object hierarchy. Plan limits define how many projects you can create. Neon's Free plan permits one project per Neon account. For more information, see [Manage projects](https://neon.tech/docs/manage/projects/). You can specify a region and PostgreSQL version in the request body. Neon currently supports PostgreSQL 14 and 15. For supported regions and `region_id` values, see [Regions](https://neon.tech/docs/introduction/regions/).
* @description Creates a Neon project. A project is the top-level object in the Neon object hierarchy. Plan limits define how many projects you can create. Neon's Free plan permits one project per Neon account. For more information, see [Manage projects](https://neon.tech/docs/manage/projects/). You can specify a region and Postgres version in the request body. Neon currently supports PostgreSQL 14, 15, and 16. For supported regions and `region_id` values, see [Regions](https://neon.tech/docs/introduction/regions/).
*

@@ -348,2 +367,15 @@ * @tags Project

/**
* @description Retrieves a list of shared projects for the Neon account. A project is the top-level object in the Neon object hierarchy. For more information, see [Manage projects](https://neon.tech/docs/manage/projects/).
*
* @tags Project
* @name ListSharedProjects
* @summary Get a list of shared projects
* @request GET:/projects/shared
* @secure
*/
_this.listSharedProjects = function (query, params) {
if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/projects/shared", method: 'GET', query: query, secure: true, format: 'json' }, params));
};
/**
* @description Retrieves information about the specified project. A project is the top-level object in the Neon object hierarchy. You can obtain a `project_id` by listing the projects for your Neon account.

@@ -402,4 +434,57 @@ *

/**
* @description Creates a branch in the specified project. You can obtain a `project_id` by listing the projects for your Neon account. This method does not require a request body, but you can specify one to create an endpoint for the branch or to select a non-default parent branch. The default behavior is to create a branch from the project's root branch (`main`) with no endpoint, and the branch name is auto-generated. For related information, see [Manage branches](https://neon.tech/docs/manage/branches/).
* @description Retrieves details about users who have access to the project, including the permission `id`, the granted-to email address, and the date project access was granted.
*
* @tags Project
* @name ListProjectPermissions
* @summary List project access
* @request GET:/projects/{project_id}/permissions
* @secure
*/
_this.listProjectPermissions = function (projectId, params) {
if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/projects/".concat(encodeURIComponent(projectId), "/permissions"), method: 'GET', secure: true, format: 'json' }, params));
};
/**
* @description Grants project access to the account associated with the specified email address
*
* @tags Project
* @name GrantPermissionToProject
* @summary Grant project access
* @request POST:/projects/{project_id}/permissions
* @secure
*/
_this.grantPermissionToProject = function (projectId, data, params) {
if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/projects/".concat(encodeURIComponent(projectId), "/permissions"), method: 'POST', body: data, secure: true, type: ContentType.Json, format: 'json' }, params));
};
/**
* @description Revokes project access from the user associted with the specified permisison `id`. You can retrieve a user's permission `id` by listing project access.
*
* @tags Project
* @name RevokePermissionFromProject
* @summary Revoke project access
* @request DELETE:/projects/{project_id}/permissions/{permission_id}
* @secure
*/
_this.revokePermissionFromProject = function (projectId, permissionId, params) {
if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/projects/".concat(encodeURIComponent(projectId), "/permissions/").concat(encodeURIComponent(permissionId)), method: 'DELETE', secure: true, format: 'json' }, params));
};
/**
* @description Retrieves a connection URI for the specified database. You can obtain a `project_id` by listing the projects for your Neon account. You can obtain the `database_name` by listing the databases for a branch. You can obtain a `role_name` by listing the roles for a branch.
*
* @tags Project
* @name GetConnectionUri
* @summary Get a connection URI
* @request GET:/projects/{project_id}/connection_uri
* @secure
*/
_this.getConnectionUri = function (_a, params) {
var projectId = _a.projectId, query = __rest(_a, ["projectId"]);
if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/projects/".concat(encodeURIComponent(projectId), "/connection_uri"), method: 'GET', query: query, secure: true, format: 'json' }, params));
};
/**
* @description Creates a branch in the specified project. You can obtain a `project_id` by listing the projects for your Neon account. This method does not require a request body, but you can specify one to create a compute endpoint for the branch or to select a non-default parent branch. The default behavior is to create a branch from the project's primary branch with no compute endpoint, and the branch name is auto-generated. There is a maximum of one read-write endpoint per branch. A branch can have multiple read-only endpoints. For related information, see [Manage branches](https://neon.tech/docs/manage/branches/).
*
* @tags Branch

@@ -429,3 +514,3 @@ * @name CreateProjectBranch

/**
* @description Retrieves information about the specified branch. You can obtain a `project_id` by listing the projects for your Neon account. You can obtain a `branch_id` by listing the project's branches. A `branch_id` value has a `br-` prefix. Each Neon project has a root branch named `main`. A project may contain child branches that were branched from `main` or from another branch. A parent branch is identified by a `parent_id` value, which is the `id` of the parent branch. For related information, see [Manage branches](https://neon.tech/docs/manage/branches/).
* @description Retrieves information about the specified branch. You can obtain a `project_id` by listing the projects for your Neon account. You can obtain a `branch_id` by listing the project's branches. A `branch_id` value has a `br-` prefix. Each Neon project is initially created with a root and primary branch named `main`. A project can contain one or more branches. A parent branch is identified by a `parent_id` value, which is the `id` of the parent branch. For related information, see [Manage branches](https://neon.tech/docs/manage/branches/).
*

@@ -443,3 +528,3 @@ * @tags Branch

/**
* @description Deletes the specified branch from a project, and places all endpoints into an idle state, breaking existing client connections. You can obtain a `project_id` by listing the projects for your Neon account. You can obtain a `branch_id` by listing the project's branches. For related information, see [Manage branches](https://neon.tech/docs/manage/branches/). When a successful response status is received, the endpoints are still active, and the branch is not yet deleted from storage. The deletion occurs after all operations finish. You cannot delete a branch if it is the only remaining branch in the project. A project must have at least one branch.
* @description Deletes the specified branch from a project, and places all compute endpoints into an idle state, breaking existing client connections. You can obtain a `project_id` by listing the projects for your Neon account. You can obtain a `branch_id` by listing the project's branches. For related information, see [Manage branches](https://neon.tech/docs/manage/branches/). When a successful response status is received, the compute endpoints are still active, and the branch is not yet deleted from storage. The deletion occurs after all operations finish. You cannot delete a project's root or primary branch, and you cannot delete a branch that has a child branch. A project must have at least one branch.
*

@@ -457,3 +542,3 @@ * @tags Branch

/**
* @description Updates the specified branch. Only changing the branch name is supported. You can obtain a `project_id` by listing the projects for your Neon account. You can obtain the `branch_id` by listing the project's branches. For more information, see [Manage branches](https://neon.tech/docs/manage/branches/).
* @description Updates the specified branch. You can obtain a `project_id` by listing the projects for your Neon account. You can obtain the `branch_id` by listing the project's branches. For more information, see [Manage branches](https://neon.tech/docs/manage/branches/).
*

@@ -471,7 +556,20 @@ * @tags Branch

/**
* @description The primary mark is automatically removed from the previous primary branch. You can obtain a `project_id` by listing the projects for your Neon account. You can obtain the `branch_id` by listing the project's branches. For more information, see [Manage branches](https://neon.tech/docs/manage/branches/).
* @description Restores a branch to an earlier state in its own or another branch's history
*
* @tags Branch
* @name RestoreProjectBranch
* @summary Restore a branch
* @request POST:/projects/{project_id}/branches/{branch_id}/restore
* @secure
*/
_this.restoreProjectBranch = function (projectId, branchId, data, params) {
if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/projects/".concat(encodeURIComponent(projectId), "/branches/").concat(encodeURIComponent(branchId), "/restore"), method: 'POST', body: data, secure: true, type: ContentType.Json, format: 'json' }, params));
};
/**
* @description Sets the specified branch as the project's primary branch. The primary designation is automatically removed from the previous primary branch. You can obtain a `project_id` by listing the projects for your Neon account. You can obtain the `branch_id` by listing the project's branches. For more information, see [Manage branches](https://neon.tech/docs/manage/branches/).
*
* @tags Branch
* @name SetPrimaryProjectBranch
* @summary Set the branch as the primary branch of a project
* @summary Set branch as primary
* @request POST:/projects/{project_id}/branches/{branch_id}/set_as_primary

@@ -485,3 +583,3 @@ * @secure

/**
* @description Retrieves a list of endpoints for the specified branch. Currently, Neon permits only one endpoint per branch. You can obtain a `project_id` by listing the projects for your Neon account. You can obtain the `branch_id` by listing the project's branches.
* @description Retrieves a list of compute endpoints for the specified branch. Neon permits only one read-write compute endpoint per branch. A branch can have multiple read-only compute endpoints. You can obtain a `project_id` by listing the projects for your Neon account. You can obtain the `branch_id` by listing the project's branches.
*

@@ -525,3 +623,3 @@ * @tags Branch

/**
* @description Retrieves information about the specified database. You can obtain a `project_id` by listing the projects for your Neon account. You can obtain the `branch_id` and `database_name` by listing branch's databases. For related information, see [Manage databases](https://neon.tech/docs/manage/databases/).
* @description Retrieves information about the specified database. You can obtain a `project_id` by listing the projects for your Neon account. You can obtain the `branch_id` and `database_name` by listing the branch's databases. For related information, see [Manage databases](https://neon.tech/docs/manage/databases/).
*

@@ -552,3 +650,3 @@ * @tags Branch

/**
* @description Deletes the specified database from the branch. You can obtain a `project_id` by listing the projects for your Neon account. You can obtain the `branch_id` and `database_name` by listing branch's databases. For related information, see [Manage databases](https://neon.tech/docs/manage/databases/).
* @description Deletes the specified database from the branch. You can obtain a `project_id` by listing the projects for your Neon account. You can obtain the `branch_id` and `database_name` by listing the branch's databases. For related information, see [Manage databases](https://neon.tech/docs/manage/databases/).
*

@@ -566,3 +664,3 @@ * @tags Branch

/**
* @description Retrieves a list of roles from the specified branch. You can obtain a `project_id` by listing the projects for your Neon account. You can obtain the `branch_id` by listing the project's branches. In Neon, the terms "role" and "user" are synonymous. For related information, see [Manage roles](https://neon.tech/docs/manage/roles/).
* @description Retrieves a list of Postgres roles from the specified branch. You can obtain a `project_id` by listing the projects for your Neon account. You can obtain the `branch_id` by listing the project's branches. For related information, see [Manage roles](https://neon.tech/docs/manage/roles/).
*

@@ -580,3 +678,3 @@ * @tags Branch

/**
* @description Creates a role in the specified branch. You can obtain a `project_id` by listing the projects for your Neon account. You can obtain the `branch_id` by listing the project's branches. In Neon, the terms "role" and "user" are synonymous. For related information, see [Manage roles](https://neon.tech/docs/manage/roles/). Connections established to the active compute endpoint will be dropped. If the compute endpoint is idle, the endpoint becomes active for a short period of time and is suspended afterward.
* @description Creates a Postgres role in the specified branch. You can obtain a `project_id` by listing the projects for your Neon account. You can obtain the `branch_id` by listing the project's branches. For related information, see [Manage roles](https://neon.tech/docs/manage/roles/). Connections established to the active compute endpoint will be dropped. If the compute endpoint is idle, the endpoint becomes active for a short period of time and is suspended afterward.
*

@@ -607,3 +705,3 @@ * @tags Branch

/**
* @description Deletes the specified role from the branch. You can obtain a `project_id` by listing the projects for your Neon account. You can obtain the `branch_id` by listing the project's branches. You can obtain the `role_name` by listing the roles for a branch. In Neon, the terms "role" and "user" are synonymous. For related information, see [Manage roles](https://neon.tech/docs/manage/roles/).
* @description Deletes the specified Postgres role from the branch. You can obtain a `project_id` by listing the projects for your Neon account. You can obtain the `branch_id` by listing the project's branches. You can obtain the `role_name` by listing the roles for a branch. For related information, see [Manage roles](https://neon.tech/docs/manage/roles/).
*

@@ -621,3 +719,3 @@ * @tags Branch

/**
* @description Retrieves the password for the specified role, if possible. You can obtain a `project_id` by listing the projects for your Neon account. You can obtain the `branch_id` by listing the project's branches. You can obtain the `role_name` by listing the roles for a branch. In Neon, the terms "role" and "user" are synonymous. For related information, see [Manage roles](https://neon.tech/docs/manage/roles/).
* @description Retrieves the password for the specified Postgres role, if possible. You can obtain a `project_id` by listing the projects for your Neon account. You can obtain the `branch_id` by listing the project's branches. You can obtain the `role_name` by listing the roles for a branch. For related information, see [Manage roles](https://neon.tech/docs/manage/roles/).
*

@@ -635,3 +733,3 @@ * @tags Branch

/**
* @description Resets the password for the specified role. Returns a new password and operations. The new password is ready to use when the last operation finishes. The old password remains valid until last operation finishes. Connections to the compute endpoint are dropped. If idle, the compute endpoint becomes active for a short period of time. You can obtain a `project_id` by listing the projects for your Neon account. You can obtain the `branch_id` by listing the project's branches. You can obtain the `role_name` by listing the roles for a branch. In Neon, the terms "role" and "user" are synonymous. For related information, see [Manage roles](https://neon.tech/docs/manage/roles/).
* @description Resets the password for the specified Postgres role. Returns a new password and operations. The new password is ready to use when the last operation finishes. The old password remains valid until last operation finishes. Connections to the compute endpoint are dropped. If idle, the compute endpoint becomes active for a short period of time. You can obtain a `project_id` by listing the projects for your Neon account. You can obtain the `branch_id` by listing the project's branches. You can obtain the `role_name` by listing the roles for a branch. For related information, see [Manage roles](https://neon.tech/docs/manage/roles/).
*

@@ -649,7 +747,7 @@ * @tags Branch

/**
* @description Creates an endpoint for the specified branch. An endpoint is a Neon compute instance. There is a maximum of one read-write endpoint per branch. If the specified branch already has a read-write endpoint, the operation fails. A branch can have multiple read-only endpoints. You can obtain a `project_id` by listing the projects for your Neon account. You can obtain `branch_id` by listing the project's branches. A `branch_id` has a `br-` prefix. For supported regions and `region_id` values, see [Regions](https://neon.tech/docs/introduction/regions/). For more information about endpoints, see [Manage endpoints](https://neon.tech/docs/manage/endpoints/).
* @description Creates a compute endpoint for the specified branch. An endpoint is a Neon compute instance. There is a maximum of one read-write compute endpoint per branch. If the specified branch already has a read-write compute endpoint, the operation fails. A branch can have multiple read-only compute endpoints. You can obtain a `project_id` by listing the projects for your Neon account. You can obtain `branch_id` by listing the project's branches. A `branch_id` has a `br-` prefix. For supported regions and `region_id` values, see [Regions](https://neon.tech/docs/introduction/regions/). For more information about compute endpoints, see [Manage computes](https://neon.tech/docs/manage/endpoints/).
*
* @tags Endpoint
* @name CreateProjectEndpoint
* @summary Create an endpoint
* @summary Create a compute endpoint
* @request POST:/projects/{project_id}/endpoints

@@ -663,7 +761,7 @@ * @secure

/**
* @description Retrieves a list of endpoints for the specified project. An endpoint is a Neon compute instance. You can obtain a `project_id` by listing the projects for your Neon account. For more information about endpoints, see [Manage endpoints](https://neon.tech/docs/manage/endpoints/).
* @description Retrieves a list of compute endpoints for the specified project. A compute endpoint is a Neon compute instance. You can obtain a `project_id` by listing the projects for your Neon account. For information about compute endpoints, see [Manage computes](https://neon.tech/docs/manage/endpoints/).
*
* @tags Endpoint
* @name ListProjectEndpoints
* @summary Get a list of endpoints
* @summary Get a list of compute endpoints
* @request GET:/projects/{project_id}/endpoints

@@ -677,7 +775,7 @@ * @secure

/**
* @description Retrieves information about the specified endpoint. An endpoint is a Neon compute instance. You can obtain a `project_id` by listing the projects for your Neon account. You can obtain an `endpoint_id` by listing your project's endpoints. An `endpoint_id` has an `ep-` prefix. For more information about endpoints, see [Manage endpoints](https://neon.tech/docs/manage/endpoints/).
* @description Retrieves information about the specified compute endpoint. A compute endpoint is a Neon compute instance. You can obtain a `project_id` by listing the projects for your Neon account. You can obtain an `endpoint_id` by listing your project's compute endpoints. An `endpoint_id` has an `ep-` prefix. For information about compute endpoints, see [Manage computes](https://neon.tech/docs/manage/endpoints/).
*
* @tags Endpoint
* @name GetProjectEndpoint
* @summary Get an endpoint
* @summary Get a compute endpoint
* @request GET:/projects/{project_id}/endpoints/{endpoint_id}

@@ -691,7 +789,7 @@ * @secure

/**
* @description Delete the specified endpoint. An endpoint is a Neon compute instance. Deleting an endpoint drops existing network connections to the endpoint. The deletion is completed when last operation in the chain finishes successfully. You can obtain a `project_id` by listing the projects for your Neon account. You can obtain an `endpoint_id` by listing your project's endpoints. An `endpoint_id` has an `ep-` prefix. For more information about endpoints, see [Manage endpoints](https://neon.tech/docs/manage/endpoints/).
* @description Delete the specified compute endpoint. A compute endpoint is a Neon compute instance. Deleting a compute endpoint drops existing network connections to the compute endpoint. The deletion is completed when last operation in the chain finishes successfully. You can obtain a `project_id` by listing the projects for your Neon account. You can obtain an `endpoint_id` by listing your project's compute endpoints. An `endpoint_id` has an `ep-` prefix. For information about compute endpoints, see [Manage computes](https://neon.tech/docs/manage/endpoints/).
*
* @tags Endpoint
* @name DeleteProjectEndpoint
* @summary Delete an endpoint
* @summary Delete a compute endpoint
* @request DELETE:/projects/{project_id}/endpoints/{endpoint_id}

@@ -705,7 +803,7 @@ * @secure

/**
* @description Updates the specified endpoint. Currently, only changing the associated branch is supported. The branch that you specify cannot have an existing endpoint. You can obtain a `project_id` by listing the projects for your Neon account. You can obtain an `endpoint_id` and `branch_id` by listing your project's endpoints. An `endpoint_id` has an `ep-` prefix. A `branch_id` has a `br-` prefix. For more information about endpoints, see [Manage endpoints](https://neon.tech/docs/manage/endpoints/). If the returned list of operations is not empty, the endpoint is not ready to use. The client must wait for the last operation to finish before using the endpoint. If the endpoint was idle before the update, the endpoint becomes active for a short period of time, and the control plane suspends it again after the update.
* @description Updates the specified compute endpoint. You can obtain a `project_id` by listing the projects for your Neon account. You can obtain an `endpoint_id` and `branch_id` by listing your project's compute endpoints. An `endpoint_id` has an `ep-` prefix. A `branch_id` has a `br-` prefix. For more information about compute endpoints, see [Manage computes](https://neon.tech/docs/manage/endpoints/). If the returned list of operations is not empty, the compute endpoint is not ready to use. The client must wait for the last operation to finish before using the compute endpoint. If the compute endpoint was idle before the update, it becomes active for a short period of time, and the control plane suspends it again after the update.
*
* @tags Endpoint
* @name UpdateProjectEndpoint
* @summary Update an endpoint
* @summary Update a compute endpoint
* @request PATCH:/projects/{project_id}/endpoints/{endpoint_id}

@@ -719,7 +817,7 @@ * @secure

/**
* @description Starts an endpoint. The endpoint is ready to use after the last operation in chain finishes successfully. You can obtain a `project_id` by listing the projects for your Neon account. You can obtain an `endpoint_id` by listing your project's endpoints. An `endpoint_id` has an `ep-` prefix. For more information about endpoints, see [Manage endpoints](https://neon.tech/docs/manage/endpoints/).
* @description Starts a compute endpoint. The compute endpoint is ready to use after the last operation in chain finishes successfully. You can obtain a `project_id` by listing the projects for your Neon account. You can obtain an `endpoint_id` by listing your project's compute endpoints. An `endpoint_id` has an `ep-` prefix. For information about compute endpoints, see [Manage computes](https://neon.tech/docs/manage/endpoints/).
*
* @tags Endpoint
* @name StartProjectEndpoint
* @summary Start an endpoint
* @summary Start a compute endpoint
* @request POST:/projects/{project_id}/endpoints/{endpoint_id}/start

@@ -733,7 +831,7 @@ * @secure

/**
* @description Suspend the specified endpoint You can obtain a `project_id` by listing the projects for your Neon account. You can obtain an `endpoint_id` by listing your project's endpoints. An `endpoint_id` has an `ep-` prefix. For more information about endpoints, see [Manage endpoints](https://neon.tech/docs/manage/endpoints/).
* @description Suspend the specified compute endpoint You can obtain a `project_id` by listing the projects for your Neon account. You can obtain an `endpoint_id` by listing your project's compute endpoints. An `endpoint_id` has an `ep-` prefix. For information about compute endpoints, see [Manage computes](https://neon.tech/docs/manage/endpoints/).
*
* @tags Endpoint
* @name SuspendProjectEndpoint
* @summary Suspend an endpoint
* @summary Suspend a compute endpoint
* @request POST:/projects/{project_id}/endpoints/{endpoint_id}/suspend

@@ -747,7 +845,7 @@ * @secure

/**
* @description Retrieves a list consumption metrics for each project for the current billing period. **Important:** This is a preview API and may be subject to changes.
* @description Retrieves consumption metrics for each project for the current billing period. For usage information, see [Retrieving metrics for all projects](https://neon.tech/docs/guides/partner-billing#retrieving-metrics-for-all-projects).
*
* @tags Preview
* @tags Consumption
* @name ListProjectsConsumption
* @summary Retrieves a list consumption metrics for each project
* @summary Get project consumption metrics
* @request GET:/consumption/projects

@@ -754,0 +852,0 @@ * @secure

{
"name": "@neondatabase/api-client",
"version": "1.4.1",
"version": "1.5.0",
"description": "Wrapper for Neon API",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -9,4 +9,6 @@ # @neondatabase/api-client

To install the library, you can use npm or yarn. Run the following command:
You can install the library using `npm` or `yarn`.
`npm`:
```bash

@@ -16,3 +18,3 @@ npm install @neondatabase/api-client

or
`yarn`:

@@ -23,34 +25,35 @@ ```bash

## Getting Started
## Get Started
To get started with the `@neondatabase/api-client` library, follow these steps:
1. Get your api key:
1. Obtain an API key from the [Developer Settings](https://console.neon.tech/app/settings/api-keys) page in the Neon Console.
1. Go to https://console.neon.tech/app/settings/api-keys
1. Click "Generate new API key"
1. Enter name for your key and press "Create"
1. Preserve your api key somewhere, so you can pass it down to your code
2. Click **Generate new API key**.
2. Import the library:
3. Enter name for your API key and click **Create**.
```typescript
import { createApiClient } from '@neondatabase/api-client';
```
4. Save your API key to a secure location that enables you to pass it to your code.
3. Create an instance of the API client by calling the `createApiClient` function:
5. Import the library:
```typescript
const apiClient = createApiClient({
apiKey: 'your-api-key',
});
```
```typescript
import { createApiClient } from '@neondatabase/api-client';
```
4. Use the `apiClient` instance to make API calls. For example:
6. Create an instance of the API client by calling the `createApiClient` function:
```typescript
const response = await apiClient.listProjects({});
console.log(response);
```
```typescript
const apiClient = createApiClient({
apiKey: 'your-api-key',
});
```
7. Use the `apiClient` instance to make API calls. For example:
```typescript
const response = await apiClient.listProjects({});
console.log(response);
```
## API Reference

@@ -57,0 +60,0 @@ https://api-docs.neon.tech/

@@ -6,5 +6,5 @@ {

"skipLibCheck": true,
"lib": ["ES2015", "DOM"]
"lib": ["ES2015", "DOM"],
},
"files": ["./index.ts"]
"files": ["./index.ts"],
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc