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.2.0 to 1.3.0

122

dist/api.gen.js

@@ -86,4 +86,7 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.Api = exports.HttpClient = exports.ContentType = exports.BillingSubscriptionType = exports.EndpointPoolerMode = exports.EndpointType = exports.EndpointState = exports.BranchState = exports.OperationStatus = exports.OperationAction = exports.Provisioner = void 0;
/** The Neon compute provisioner. Select the `k8s-neonvm` provisioner to enable autoscaling. */
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;
/**
* The Neon compute provisioner.
* Specify the `k8s-neonvm` provisioner to create a compute endpoint that supports Autoscaling.
*/
var Provisioner;

@@ -157,5 +160,11 @@ (function (Provisioner) {

BillingSubscriptionType["Pro"] = "pro";
BillingSubscriptionType["PlatformPartnership"] = "platform_partnership";
BillingSubscriptionType["Enterprise"] = "enterprise";
BillingSubscriptionType["DirectSales"] = "direct_sales";
})(BillingSubscriptionType = exports.BillingSubscriptionType || (exports.BillingSubscriptionType = {}));
var SupportTicketSeverity;
(function (SupportTicketSeverity) {
SupportTicketSeverity["Low"] = "low";
SupportTicketSeverity["Normal"] = "normal";
SupportTicketSeverity["High"] = "high";
SupportTicketSeverity["Critical"] = "critical";
})(SupportTicketSeverity = exports.SupportTicketSeverity || (exports.SupportTicketSeverity = {}));
var axios_1 = require("axios");

@@ -184,3 +193,3 @@ var ContentType;

case 0:
_b = (typeof secure === "boolean" ? secure : this.secure) &&
_b = (typeof secure === 'boolean' ? secure : this.secure) &&
this.securityWorker;

@@ -197,13 +206,13 @@ if (!_b) return [3 /*break*/, 2];

responseFormat = format || this.format || undefined;
if (type === ContentType.FormData && body && body !== null && typeof body === "object") {
if (type === ContentType.FormData && body && body !== null && typeof body === 'object') {
body = this.createFormData(body);
}
if (type === ContentType.Text && body && body !== null && typeof body !== "string") {
if (type === ContentType.Text && body && body !== null && typeof body !== 'string') {
body = JSON.stringify(body);
}
return [2 /*return*/, this.instance.request(__assign(__assign({}, requestParams), { headers: __assign(__assign({}, (requestParams.headers || {})), (type && type !== ContentType.FormData ? { "Content-Type": type } : {})), params: query, responseType: responseFormat, data: body, url: path }))];
return [2 /*return*/, this.instance.request(__assign(__assign({}, requestParams), { headers: __assign(__assign({}, (requestParams.headers || {})), (type && type !== ContentType.FormData ? { 'Content-Type': type } : {})), params: query, responseType: responseFormat, data: body, url: path }))];
}
});
}); };
this.instance = axios_1.default.create(__assign(__assign({}, axiosConfig), { baseURL: axiosConfig.baseURL || "https://console.neon.tech/api/v2" }));
this.instance = axios_1.default.create(__assign(__assign({}, axiosConfig), { baseURL: axiosConfig.baseURL || 'https://console.neon.tech/api/v2' }));
this.secure = secure;

@@ -218,3 +227,3 @@ this.format = format;

HttpClient.prototype.stringifyFormItem = function (formItem) {
if (typeof formItem === "object" && formItem !== null) {
if (typeof formItem === 'object' && formItem !== null) {
return JSON.stringify(formItem);

@@ -270,3 +279,3 @@ }

if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/api_keys", method: "GET", secure: true, format: "json" }, params));
return _this.request(__assign({ path: "/api_keys", method: 'GET', secure: true, format: 'json' }, params));
};

@@ -284,3 +293,3 @@ /**

if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/api_keys", method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
return _this.request(__assign({ path: "/api_keys", method: 'POST', body: data, secure: true, type: ContentType.Json, format: 'json' }, params));
};

@@ -298,3 +307,3 @@ /**

if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/api_keys/".concat(keyId), method: "DELETE", secure: true, format: "json" }, params));
return _this.request(__assign({ path: "/api_keys/".concat(keyId), method: 'DELETE', secure: true, format: 'json' }, params));
};

@@ -312,3 +321,3 @@ /**

if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/projects/".concat(projectId, "/operations/").concat(operationId), method: "GET", secure: true, format: "json" }, params));
return _this.request(__assign({ path: "/projects/".concat(projectId, "/operations/").concat(operationId), method: 'GET', secure: true, format: 'json' }, params));
};

@@ -326,3 +335,3 @@ /**

if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/projects", method: "GET", query: query, secure: true, format: "json" }, params));
return _this.request(__assign({ path: "/projects", method: 'GET', query: query, secure: true, format: 'json' }, params));
};

@@ -340,3 +349,3 @@ /**

if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/projects", method: "POST", body: data, secure: true, type: ContentType.Json }, params));
return _this.request(__assign({ path: "/projects", method: 'POST', body: data, secure: true, type: ContentType.Json }, params));
};

@@ -354,3 +363,3 @@ /**

if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/projects/".concat(projectId), method: "GET", secure: true, format: "json" }, params));
return _this.request(__assign({ path: "/projects/".concat(projectId), method: 'GET', secure: true, format: 'json' }, params));
};

@@ -368,3 +377,3 @@ /**

if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/projects/".concat(projectId), method: "PATCH", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
return _this.request(__assign({ path: "/projects/".concat(projectId), method: 'PATCH', body: data, secure: true, type: ContentType.Json, format: 'json' }, params));
};

@@ -382,3 +391,3 @@ /**

if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/projects/".concat(projectId), method: "DELETE", secure: true, format: "json" }, params));
return _this.request(__assign({ path: "/projects/".concat(projectId), method: 'DELETE', secure: true, format: 'json' }, params));
};

@@ -397,3 +406,3 @@ /**

if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/projects/".concat(projectId, "/operations"), method: "GET", query: query, secure: true }, params));
return _this.request(__assign({ path: "/projects/".concat(projectId, "/operations"), method: 'GET', query: query, secure: true }, params));
};

@@ -411,3 +420,3 @@ /**

if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/projects/".concat(projectId, "/branches"), method: "POST", body: data, secure: true, type: ContentType.Json }, params));
return _this.request(__assign({ path: "/projects/".concat(projectId, "/branches"), method: 'POST', body: data, secure: true, type: ContentType.Json }, params));
};

@@ -425,3 +434,3 @@ /**

if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/projects/".concat(projectId, "/branches"), method: "GET", secure: true, format: "json" }, params));
return _this.request(__assign({ path: "/projects/".concat(projectId, "/branches"), method: 'GET', secure: true, format: 'json' }, params));
};

@@ -439,3 +448,3 @@ /**

if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/projects/".concat(projectId, "/branches/").concat(branchId), method: "GET", secure: true, format: "json" }, params));
return _this.request(__assign({ path: "/projects/".concat(projectId, "/branches/").concat(branchId), method: 'GET', secure: true, format: 'json' }, params));
};

@@ -453,3 +462,3 @@ /**

if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/projects/".concat(projectId, "/branches/").concat(branchId), method: "DELETE", secure: true, format: "json" }, params));
return _this.request(__assign({ path: "/projects/".concat(projectId, "/branches/").concat(branchId), method: 'DELETE', secure: true, format: 'json' }, params));
};

@@ -467,3 +476,3 @@ /**

if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/projects/".concat(projectId, "/branches/").concat(branchId), method: "PATCH", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
return _this.request(__assign({ path: "/projects/".concat(projectId, "/branches/").concat(branchId), method: 'PATCH', body: data, secure: true, type: ContentType.Json, format: 'json' }, params));
};

@@ -481,3 +490,3 @@ /**

if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/projects/".concat(projectId, "/branches/").concat(branchId, "/set_as_primary"), method: "POST", secure: true, format: "json" }, params));
return _this.request(__assign({ path: "/projects/".concat(projectId, "/branches/").concat(branchId, "/set_as_primary"), method: 'POST', secure: true, format: 'json' }, params));
};

@@ -495,3 +504,3 @@ /**

if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/projects/".concat(projectId, "/branches/").concat(branchId, "/endpoints"), method: "GET", secure: true, format: "json" }, params));
return _this.request(__assign({ path: "/projects/".concat(projectId, "/branches/").concat(branchId, "/endpoints"), method: 'GET', secure: true, format: 'json' }, params));
};

@@ -509,3 +518,3 @@ /**

if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/projects/".concat(projectId, "/branches/").concat(branchId, "/databases"), method: "GET", secure: true, format: "json" }, params));
return _this.request(__assign({ path: "/projects/".concat(projectId, "/branches/").concat(branchId, "/databases"), method: 'GET', secure: true, format: 'json' }, params));
};

@@ -523,3 +532,3 @@ /**

if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/projects/".concat(projectId, "/branches/").concat(branchId, "/databases"), method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
return _this.request(__assign({ path: "/projects/".concat(projectId, "/branches/").concat(branchId, "/databases"), method: 'POST', body: data, secure: true, type: ContentType.Json, format: 'json' }, params));
};

@@ -537,3 +546,3 @@ /**

if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/projects/".concat(projectId, "/branches/").concat(branchId, "/databases/").concat(databaseName), method: "GET", secure: true, format: "json" }, params));
return _this.request(__assign({ path: "/projects/".concat(projectId, "/branches/").concat(branchId, "/databases/").concat(databaseName), method: 'GET', secure: true, format: 'json' }, params));
};

@@ -551,3 +560,3 @@ /**

if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/projects/".concat(projectId, "/branches/").concat(branchId, "/databases/").concat(databaseName), method: "PATCH", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
return _this.request(__assign({ path: "/projects/".concat(projectId, "/branches/").concat(branchId, "/databases/").concat(databaseName), method: 'PATCH', body: data, secure: true, type: ContentType.Json, format: 'json' }, params));
};

@@ -565,3 +574,3 @@ /**

if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/projects/".concat(projectId, "/branches/").concat(branchId, "/databases/").concat(databaseName), method: "DELETE", secure: true, format: "json" }, params));
return _this.request(__assign({ path: "/projects/".concat(projectId, "/branches/").concat(branchId, "/databases/").concat(databaseName), method: 'DELETE', secure: true, format: 'json' }, params));
};

@@ -579,6 +588,6 @@ /**

if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/projects/".concat(projectId, "/branches/").concat(branchId, "/roles"), method: "GET", secure: true, format: "json" }, params));
return _this.request(__assign({ path: "/projects/".concat(projectId, "/branches/").concat(branchId, "/roles"), method: 'GET', secure: true, format: 'json' }, params));
};
/**
* @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 read-write endpoint will be dropped. If the read-write endpoint is idle, the endpoint becomes active for a short period of time and is suspended afterward.
* @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.
*

@@ -593,3 +602,3 @@ * @tags Branch

if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/projects/".concat(projectId, "/branches/").concat(branchId, "/roles"), method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
return _this.request(__assign({ path: "/projects/".concat(projectId, "/branches/").concat(branchId, "/roles"), method: 'POST', body: data, secure: true, type: ContentType.Json, format: 'json' }, params));
};

@@ -607,3 +616,3 @@ /**

if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/projects/".concat(projectId, "/branches/").concat(branchId, "/roles/").concat(roleName), method: "GET", secure: true, format: "json" }, params));
return _this.request(__assign({ path: "/projects/".concat(projectId, "/branches/").concat(branchId, "/roles/").concat(roleName), method: 'GET', secure: true, format: 'json' }, params));
};

@@ -621,3 +630,3 @@ /**

if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/projects/".concat(projectId, "/branches/").concat(branchId, "/roles/").concat(roleName), method: "DELETE", secure: true, format: "json" }, params));
return _this.request(__assign({ path: "/projects/".concat(projectId, "/branches/").concat(branchId, "/roles/").concat(roleName), method: 'DELETE', secure: true, format: 'json' }, params));
};

@@ -635,6 +644,6 @@ /**

if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/projects/".concat(projectId, "/branches/").concat(branchId, "/roles/").concat(roleName, "/reveal_password"), method: "GET", secure: true, format: "json" }, params));
return _this.request(__assign({ path: "/projects/".concat(projectId, "/branches/").concat(branchId, "/roles/").concat(roleName, "/reveal_password"), method: 'GET', secure: true, format: 'json' }, params));
};
/**
* @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 read-write endpoint are dropped. If idle, the read-write 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 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/).
*

@@ -649,6 +658,6 @@ * @tags Branch

if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/projects/".concat(projectId, "/branches/").concat(branchId, "/roles/").concat(roleName, "/reset_password"), method: "POST", secure: true, format: "json" }, params));
return _this.request(__assign({ path: "/projects/".concat(projectId, "/branches/").concat(branchId, "/roles/").concat(roleName, "/reset_password"), method: 'POST', secure: true, format: 'json' }, params));
};
/**
* @description Creates an endpoint for the specified branch. An endpoint is a Neon compute instance. There is a maximum of one endpoint per branch. If the specified branch already has an endpoint, the operation fails. 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. Currently, only the `read_write` endpoint type is supported. 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 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/).
*

@@ -663,3 +672,3 @@ * @tags Endpoint

if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/projects/".concat(projectId, "/endpoints"), method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
return _this.request(__assign({ path: "/projects/".concat(projectId, "/endpoints"), method: 'POST', body: data, secure: true, type: ContentType.Json, format: 'json' }, params));
};

@@ -677,3 +686,3 @@ /**

if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/projects/".concat(projectId, "/endpoints"), method: "GET", secure: true, format: "json" }, params));
return _this.request(__assign({ path: "/projects/".concat(projectId, "/endpoints"), method: 'GET', secure: true, format: 'json' }, params));
};

@@ -691,3 +700,3 @@ /**

if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/projects/".concat(projectId, "/endpoints/").concat(endpointId), method: "GET", secure: true, format: "json" }, params));
return _this.request(__assign({ path: "/projects/".concat(projectId, "/endpoints/").concat(endpointId), method: 'GET', secure: true, format: 'json' }, params));
};

@@ -705,3 +714,3 @@ /**

if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/projects/".concat(projectId, "/endpoints/").concat(endpointId), method: "DELETE", secure: true, format: "json" }, params));
return _this.request(__assign({ path: "/projects/".concat(projectId, "/endpoints/").concat(endpointId), method: 'DELETE', secure: true, format: 'json' }, params));
};

@@ -719,3 +728,3 @@ /**

if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/projects/".concat(projectId, "/endpoints/").concat(endpointId), method: "PATCH", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
return _this.request(__assign({ path: "/projects/".concat(projectId, "/endpoints/").concat(endpointId), method: 'PATCH', body: data, secure: true, type: ContentType.Json, format: 'json' }, params));
};

@@ -733,3 +742,3 @@ /**

if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/projects/".concat(projectId, "/endpoints/").concat(endpointId, "/start"), method: "POST", secure: true, format: "json" }, params));
return _this.request(__assign({ path: "/projects/".concat(projectId, "/endpoints/").concat(endpointId, "/start"), method: 'POST', secure: true, format: 'json' }, params));
};

@@ -747,3 +756,3 @@ /**

if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/projects/".concat(projectId, "/endpoints/").concat(endpointId, "/suspend"), method: "POST", secure: true, format: "json" }, params));
return _this.request(__assign({ path: "/projects/".concat(projectId, "/endpoints/").concat(endpointId, "/suspend"), method: 'POST', secure: true, format: 'json' }, params));
};

@@ -755,3 +764,3 @@ /**

* @name ListProjectsConsumption
* @summary Rerives a list consumption metrics for each project
* @summary Retrieves a list consumption metrics for each project
* @request GET:/consumption/projects

@@ -762,4 +771,17 @@ * @secure

if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/consumption/projects", method: "GET", query: query, secure: true, format: "json" }, params));
return _this.request(__assign({ path: "/consumption/projects", method: 'GET', query: query, secure: true, format: 'json' }, params));
};
/**
* @description Retrieves information about the current user
*
* @tags Users
* @name GetCurrentUserInfo
* @summary Get current user details
* @request GET:/users/me
* @secure
*/
_this.getCurrentUserInfo = function (params) {
if (params === void 0) { params = {}; }
return _this.request(__assign({ path: "/users/me", method: 'GET', secure: true, format: 'json' }, params));
};
return _this;

@@ -766,0 +788,0 @@ }

@@ -31,3 +31,5 @@ "use strict";

var api_gen_1 = require("./api.gen");
var createApiClient = function (config) { return new api_gen_1.Api(__assign(__assign({}, config), { headers: __assign(__assign({}, config.headers), { 'Authorization': "Bearer ".concat(config.apiKey) }) })); };
var createApiClient = function (config) {
return new api_gen_1.Api(__assign(__assign({}, config), { headers: __assign(__assign({}, config.headers), { Authorization: "Bearer ".concat(config.apiKey) }) }));
};
exports.createApiClient = createApiClient;

@@ -8,9 +8,10 @@ export * from './api.gen';

apiKey: string;
}
) => new Api<SecurityDataType>({
...config,
headers: {
...config.headers,
'Authorization': `Bearer ${config.apiKey}`,
},
});
) =>
new Api<SecurityDataType>({
...config,
headers: {
...config.headers,
Authorization: `Bearer ${config.apiKey}`,
},
});
{
"name": "@neondatabase/api-client",
"version": "1.2.0",
"version": "1.3.0",
"description": "Wrapper for Neon API",

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

@@ -8,5 +8,3 @@ {

},
"files": [
"./index.ts"
]
"files": ["./index.ts"]
}

Sorry, the diff of this file is not supported yet

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