Skip to content
This repository was archived by the owner on Jul 23, 2025. It is now read-only.

Commit 3017358

Browse files
committed
Merge remote-tracking branch 'origin/main' into beta
2 parents f9a23f0 + 315bbcd commit 3017358

10 files changed

+123
-78
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,13 @@
8282

8383
* move to @hey-api/openapi-ts, as openapi-typescript-codegen is being deprecated
8484

85+
# [1.25.0](https://github.com/paambaati/neon-js-sdk/compare/v1.24.0...v1.25.0) (2024-08-05)
86+
87+
88+
### Features
89+
90+
* update to track latest spec changes ([d02f771](https://github.com/paambaati/neon-js-sdk/commit/d02f771491aeaa6a72d4caa4140148f83c1ccc86))
91+
8592
# [1.24.0](https://github.com/paambaati/neon-js-sdk/compare/v1.23.0...v1.24.0) (2024-07-29)
8693

8794

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/* generated using openapi-typescript-codegen -- do not edit */
2+
/* istanbul ignore file */
3+
/* tslint:disable */
4+
/* eslint-disable */
5+
import type { AnnotationValueData } from './AnnotationValueData';
6+
export type AnnotationCreateValueRequest = {
7+
annotation_value?: AnnotationValueData;
8+
};
9+

generated/models/AnnotationResponse.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
/* eslint-disable */
55
import type { AnnotationData } from './AnnotationData';
66
export type AnnotationResponse = {
7-
annotation?: AnnotationData;
7+
annotation: AnnotationData;
88
};
99

generated/models/AnnotationValueData.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@
22
/* istanbul ignore file */
33
/* tslint:disable */
44
/* eslint-disable */
5+
/**
6+
* Annotation properties.
7+
*/
58
export type AnnotationValueData = Record<string, string>;

generated/models/EndpointType.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/* generated using openapi-typescript-codegen -- do not edit */
2+
/* istanbul ignore file */
3+
/* tslint:disable */
4+
/* eslint-disable */
5+
/**
6+
* The compute endpoint type. Either `read_write` or `read_only`.
7+
*
8+
*/
9+
export type EndpointType = 'read_only' | 'read_write';
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/* generated using openapi-typescript-codegen -- do not edit */
2+
/* istanbul ignore file */
3+
/* tslint:disable */
4+
/* eslint-disable */
5+
export type OrgDeletionConditionName = 'project_count';

generated/schemas.gen.ts

Lines changed: 49 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@ export const $Features = {
99
}
1010
} as const;
1111

12+
export const $FeatureFlags = {
13+
type: 'object',
14+
additionalProperties: {
15+
oneOf: [
16+
{
17+
type: 'boolean'
18+
},
19+
{
20+
type: 'string'
21+
}
22+
]
23+
}
24+
} as const;
25+
1226
export const $ComputeUnit = {
1327
type: 'number',
1428
minimum: 0.25
@@ -1747,6 +1761,30 @@ export const $ExplainData = {
17471761
}
17481762
} as const;
17491763

1764+
export const $NotificationMetricType = {
1765+
type: 'string',
1766+
description: "The metric type for a given notification",
1767+
enum: ['database_size', 'connections', 'cpu', 'ram', 'compute_over_limit']
1768+
} as const;
1769+
1770+
export const $NotificationCategoryType = {
1771+
type: 'string',
1772+
description: "The category type for a given notification",
1773+
enum: ['usage', 'performance']
1774+
} as const;
1775+
1776+
export const $NotificationType = {
1777+
type: 'string',
1778+
description: "The type of the notification",
1779+
enum: ['info', 'warning']
1780+
} as const;
1781+
1782+
export const $NotificationActionType = {
1783+
type: 'string',
1784+
description: "The action type for a given notification",
1785+
enum: ['upgrade_plan', 'upgrade_cu']
1786+
} as const;
1787+
17501788
export const $Role = {
17511789
type: 'object',
17521790
required: ['branch_id', 'name', 'created_at', 'updated_at'],
@@ -1880,14 +1918,17 @@ export const $PaymentSource = {
18801918

18811919
export const $BillingAccount = {
18821920
type: 'object',
1883-
required: ['payment_source', 'subscription_type', 'quota_reset_at_last', 'name', 'email', 'address_city', 'address_country', 'address_line1', 'address_line2', 'address_postal_code', 'address_state'],
1921+
required: ['payment_source', 'subscription_type', 'payment_method', 'quota_reset_at_last', 'name', 'email', 'address_city', 'address_country', 'address_line1', 'address_line2', 'address_postal_code', 'address_state'],
18841922
properties: {
18851923
payment_source: {
18861924
'$ref': '#/components/schemas/PaymentSource'
18871925
},
18881926
subscription_type: {
18891927
'$ref': '#/components/schemas/BillingSubscriptionType'
18901928
},
1929+
payment_method: {
1930+
'$ref': '#/components/schemas/BillingPaymentMethod'
1931+
},
18911932
quota_reset_at_last: {
18921933
description: "The last time the quota was reset. Defaults to the date-time the account is created.",
18931934
type: 'string',
@@ -1950,6 +1991,12 @@ export const $BillingSubscriptionType = {
19501991
enum: ['UNKNOWN', 'direct_sales', 'aws_marketplace', 'free_v2', 'launch', 'scale']
19511992
} as const;
19521993

1994+
export const $BillingPaymentMethod = {
1995+
type: 'string',
1996+
description: "Indicates whether and how an account makes payments.",
1997+
enum: ['UNKNOWN', 'none', 'stripe', 'direct_payment', 'aws_mp', 'vercel_mp']
1998+
} as const;
1999+
19532000
export const $Database = {
19542001
type: 'object',
19552002
required: ['id', 'branch_id', 'name', 'owner_name', 'created_at', 'updated_at'],
@@ -2824,14 +2871,6 @@ export const $AnnotationObjectData = {
28242871
}
28252872
} as const;
28262873

2827-
export const $AnnotationObjectsData = {
2828-
type: 'array',
2829-
'x-tags': ['Branch'],
2830-
items: {
2831-
'$ref': '#/components/schemas/AnnotationObjectData'
2832-
}
2833-
} as const;
2834-
28352874
export const $AnnotationCreateValueRequest = {
28362875
type: 'object',
28372876
'x-tags': ['Branch'],
@@ -2853,22 +2892,10 @@ export const $AnnotationResponse = {
28532892
}
28542893
} as const;
28552894

2856-
export const $AnnotationsResponse = {
2857-
type: 'object',
2858-
'x-tags': ['Branch'],
2859-
properties: {
2860-
annotations: {
2861-
type: 'array',
2862-
items: {
2863-
'$ref': '#/components/schemas/AnnotationData'
2864-
}
2865-
}
2866-
}
2867-
} as const;
2868-
28692895
export const $AnnotationsMapResponse = {
28702896
type: 'object',
28712897
'x-tags': ['Branch'],
2898+
required: ['annotations'],
28722899
properties: {
28732900
annotations: {
28742901
type: 'object',

generated/services.gen.ts

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import type { CancelablePromise } from './core/CancelablePromise';
44
import type { BaseHttpRequest } from './core/BaseHttpRequest';
5-
import type { ListApiKeysResponse, CreateApiKeyData, CreateApiKeyResponse, RevokeApiKeyData, RevokeApiKeyResponse, GetProjectOperationData, GetProjectOperationResponse, ListProjectOperationsData, ListProjectOperationsResponse, ListProjectsData, ListProjectsResponse, CreateProjectData, CreateProjectResponse, ListSharedProjectsData, ListSharedProjectsResponse, GetProjectData, GetProjectResponse, UpdateProjectData, UpdateProjectResponse, DeleteProjectData, DeleteProjectResponse, ListProjectPermissionsData, ListProjectPermissionsResponse, GrantPermissionToProjectData, GrantPermissionToProjectResponse, RevokePermissionFromProjectData, RevokePermissionFromProjectResponse, GetConnectionUriData, GetConnectionUriResponse, CreateProjectBranchData, CreateProjectBranchResponse, ListProjectBranchesData, ListProjectBranchesResponse, GetProjectBranchData, GetProjectBranchResponse, DeleteProjectBranchData, DeleteProjectBranchResponse, UpdateProjectBranchData, UpdateProjectBranchResponse, RestoreProjectBranchData, RestoreProjectBranchResponse, GetProjectBranchSchemaData, GetProjectBranchSchemaResponse, SetPrimaryProjectBranchData, SetPrimaryProjectBranchResponse, SetDefaultProjectBranchData, SetDefaultProjectBranchResponse, ListProjectBranchEndpointsData, ListProjectBranchEndpointsResponse, ListProjectBranchDatabasesData, ListProjectBranchDatabasesResponse, CreateProjectBranchDatabaseData, CreateProjectBranchDatabaseResponse, GetProjectBranchDatabaseData, GetProjectBranchDatabaseResponse, UpdateProjectBranchDatabaseData, UpdateProjectBranchDatabaseResponse, DeleteProjectBranchDatabaseData, DeleteProjectBranchDatabaseResponse, ListProjectBranchRolesData, ListProjectBranchRolesResponse, CreateProjectBranchRoleData, CreateProjectBranchRoleResponse, GetProjectBranchRoleData, GetProjectBranchRoleResponse, DeleteProjectBranchRoleData, DeleteProjectBranchRoleResponse, GetProjectBranchRolePasswordData, GetProjectBranchRolePasswordResponse, ResetProjectBranchRolePasswordData, ResetProjectBranchRolePasswordResponse, ListAnnotationsData, ListAnnotationsResponse, CreateProjectEndpointData, CreateProjectEndpointResponse, ListProjectEndpointsData, ListProjectEndpointsResponse, GetProjectEndpointData, GetProjectEndpointResponse, DeleteProjectEndpointData, DeleteProjectEndpointResponse, UpdateProjectEndpointData, UpdateProjectEndpointResponse, StartProjectEndpointData, StartProjectEndpointResponse, SuspendProjectEndpointData, SuspendProjectEndpointResponse, RestartProjectEndpointData, RestartProjectEndpointResponse, GetConsumptionHistoryPerAccountData, GetConsumptionHistoryPerAccountResponse, GetConsumptionHistoryPerProjectData, GetConsumptionHistoryPerProjectResponse, ListProjectsConsumptionData, ListProjectsConsumptionResponse, GetCurrentUserInfoResponse, GetCurrentUserOrganizationsResponse } from './types.gen';
5+
import type { ListApiKeysResponse, CreateApiKeyData, CreateApiKeyResponse, RevokeApiKeyData, RevokeApiKeyResponse, GetProjectOperationData, GetProjectOperationResponse, ListProjectOperationsData, ListProjectOperationsResponse, ListProjectsData, ListProjectsResponse, CreateProjectData, CreateProjectResponse, ListSharedProjectsData, ListSharedProjectsResponse, GetProjectData, GetProjectResponse, UpdateProjectData, UpdateProjectResponse, DeleteProjectData, DeleteProjectResponse, ListProjectPermissionsData, ListProjectPermissionsResponse, GrantPermissionToProjectData, GrantPermissionToProjectResponse, RevokePermissionFromProjectData, RevokePermissionFromProjectResponse, GetConnectionUriData, GetConnectionUriResponse, CreateProjectBranchData, CreateProjectBranchResponse, ListProjectBranchesData, ListProjectBranchesResponse, GetProjectBranchData, GetProjectBranchResponse, DeleteProjectBranchData, DeleteProjectBranchResponse, UpdateProjectBranchData, UpdateProjectBranchResponse, RestoreProjectBranchData, RestoreProjectBranchResponse, GetProjectBranchSchemaData, GetProjectBranchSchemaResponse, SetPrimaryProjectBranchData, SetPrimaryProjectBranchResponse, SetDefaultProjectBranchData, SetDefaultProjectBranchResponse, ListProjectBranchEndpointsData, ListProjectBranchEndpointsResponse, ListProjectBranchDatabasesData, ListProjectBranchDatabasesResponse, CreateProjectBranchDatabaseData, CreateProjectBranchDatabaseResponse, GetProjectBranchDatabaseData, GetProjectBranchDatabaseResponse, UpdateProjectBranchDatabaseData, UpdateProjectBranchDatabaseResponse, DeleteProjectBranchDatabaseData, DeleteProjectBranchDatabaseResponse, ListProjectBranchRolesData, ListProjectBranchRolesResponse, CreateProjectBranchRoleData, CreateProjectBranchRoleResponse, GetProjectBranchRoleData, GetProjectBranchRoleResponse, DeleteProjectBranchRoleData, DeleteProjectBranchRoleResponse, GetProjectBranchRolePasswordData, GetProjectBranchRolePasswordResponse, ResetProjectBranchRolePasswordData, ResetProjectBranchRolePasswordResponse, CreateProjectEndpointData, CreateProjectEndpointResponse, ListProjectEndpointsData, ListProjectEndpointsResponse, GetProjectEndpointData, GetProjectEndpointResponse, DeleteProjectEndpointData, DeleteProjectEndpointResponse, UpdateProjectEndpointData, UpdateProjectEndpointResponse, StartProjectEndpointData, StartProjectEndpointResponse, SuspendProjectEndpointData, SuspendProjectEndpointResponse, RestartProjectEndpointData, RestartProjectEndpointResponse, GetConsumptionHistoryPerAccountData, GetConsumptionHistoryPerAccountResponse, GetConsumptionHistoryPerProjectData, GetConsumptionHistoryPerProjectResponse, ListProjectsConsumptionData, ListProjectsConsumptionResponse, GetCurrentUserInfoResponse, GetCurrentUserOrganizationsResponse } from './types.gen';
66

77
export class ApiKeyService {
88
constructor(public readonly httpRequest: BaseHttpRequest) { }
@@ -1067,28 +1067,6 @@ export class BranchService {
10671067
});
10681068
}
10691069

1070-
/**
1071-
* List annotations
1072-
* List annotations
1073-
*
1074-
* @param data The data for the request.
1075-
* @param data.objects A list of annotation objects to query the annotations.
1076-
* @returns AnnotationsResponse Annotations provided
1077-
* @throws ApiError
1078-
*/
1079-
public listAnnotations(data: ListAnnotationsData): CancelablePromise<ListAnnotationsResponse> {
1080-
return this.httpRequest.request({
1081-
method: 'GET',
1082-
url: '/annotations',
1083-
query: {
1084-
objects: data.objects
1085-
},
1086-
errors: {
1087-
default: 'General Error'
1088-
}
1089-
});
1090-
}
1091-
10921070
}
10931071

10941072
export class EndpointService {
@@ -1476,6 +1454,7 @@ Adjust your \`from\` and \`to\` values or select a different \`granularity\`.
14761454
}
14771455

14781456
/**
1457+
* @deprecated
14791458
* Get project consumption metrics
14801459
* Retrieves consumption metrics for each project for the current billing period.
14811460
* For usage information, see [Retrieving metrics for all projects](https://neon.tech/docs/guides/partner-billing#retrieving-metrics-for-all-projects).

generated/services/BranchService.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/* istanbul ignore file */
33
/* tslint:disable */
44
/* eslint-disable */
5+
import type { AnnotationCreateValueRequest } from '../models/AnnotationCreateValueRequest';
56
import type { AnnotationResponse } from '../models/AnnotationResponse';
67
import type { AnnotationsMapResponse } from '../models/AnnotationsMapResponse';
78
import type { AnnotationsResponse } from '../models/AnnotationsResponse';
@@ -49,7 +50,7 @@ export class BranchService {
4950
*/
5051
public createProjectBranch(
5152
projectId: string,
52-
requestBody?: BranchCreateRequest,
53+
requestBody?: (BranchCreateRequest & AnnotationCreateValueRequest),
5354
): CancelablePromise<GeneralError | (BranchResponse & EndpointsResponse & OperationsResponse & RolesResponse & DatabasesResponse & ConnectionURIsOptionalResponse)> {
5455
return this.httpRequest.request({
5556
method: 'POST',

generated/types.gen.ts

Lines changed: 36 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ export type Features = {
44
[key: string]: (boolean);
55
};
66

7+
export type FeatureFlags = {
8+
[key: string]: (boolean | string);
9+
};
10+
711
export type ComputeUnit = number;
812

913
/**
@@ -1235,6 +1239,30 @@ export type ExplainData = {
12351239
'QUERY PLAN': string;
12361240
};
12371241

1242+
/**
1243+
* The metric type for a given notification
1244+
*
1245+
*/
1246+
export type NotificationMetricType = 'database_size' | 'connections' | 'cpu' | 'ram' | 'compute_over_limit';
1247+
1248+
/**
1249+
* The category type for a given notification
1250+
*
1251+
*/
1252+
export type NotificationCategoryType = 'usage' | 'performance';
1253+
1254+
/**
1255+
* The type of the notification
1256+
*
1257+
*/
1258+
export type NotificationType = 'info' | 'warning';
1259+
1260+
/**
1261+
* The action type for a given notification
1262+
*
1263+
*/
1264+
export type NotificationActionType = 'upgrade_plan' | 'upgrade_cu';
1265+
12381266
export type Role = {
12391267
/**
12401268
* The ID of the branch to which the role belongs
@@ -1335,6 +1363,7 @@ export type PaymentSource = {
13351363
export type BillingAccount = {
13361364
payment_source: PaymentSource;
13371365
subscription_type: BillingSubscriptionType;
1366+
payment_method: BillingPaymentMethod;
13381367
/**
13391368
* The last time the quota was reset. Defaults to the date-time the account is created.
13401369
*
@@ -1408,6 +1437,12 @@ export type BillingAccount = {
14081437
*/
14091438
export type BillingSubscriptionType = 'UNKNOWN' | 'direct_sales' | 'aws_marketplace' | 'free_v2' | 'launch' | 'scale';
14101439

1440+
/**
1441+
* Indicates whether and how an account makes payments.
1442+
*
1443+
*/
1444+
export type BillingPaymentMethod = 'UNKNOWN' | 'none' | 'stripe' | 'direct_payment' | 'aws_mp' | 'vercel_mp';
1445+
14111446
export type Database = {
14121447
/**
14131448
* The database ID
@@ -1845,8 +1880,6 @@ export type AnnotationObjectData = {
18451880
id: string;
18461881
};
18471882

1848-
export type AnnotationObjectsData = Array<AnnotationObjectData>;
1849-
18501883
export type AnnotationCreateValueRequest = {
18511884
annotation_value?: AnnotationValueData;
18521885
};
@@ -1855,12 +1888,8 @@ export type AnnotationResponse = {
18551888
annotation: AnnotationData;
18561889
};
18571890

1858-
export type AnnotationsResponse = {
1859-
annotations?: Array<AnnotationData>;
1860-
};
1861-
18621891
export type AnnotationsMapResponse = {
1863-
annotations?: {
1892+
annotations: {
18641893
[key: string]: AnnotationData;
18651894
};
18661895
};
@@ -2350,15 +2379,6 @@ export type ResetProjectBranchRolePasswordData = {
23502379

23512380
export type ResetProjectBranchRolePasswordResponse = RoleOperations;
23522381

2353-
export type ListAnnotationsData = {
2354-
/**
2355-
* A list of annotation objects to query the annotations.
2356-
*/
2357-
objects: AnnotationObjectsData;
2358-
};
2359-
2360-
export type ListAnnotationsResponse = AnnotationsResponse;
2361-
23622382
export type CreateProjectEndpointData = {
23632383
/**
23642384
* The Neon project ID
@@ -3136,21 +3156,6 @@ export type $OpenApiTs = {
31363156
};
31373157
};
31383158
};
3139-
'/annotations': {
3140-
get: {
3141-
req: ListAnnotationsData;
3142-
res: {
3143-
/**
3144-
* Annotations provided
3145-
*/
3146-
200: AnnotationsResponse;
3147-
/**
3148-
* General Error
3149-
*/
3150-
default: GeneralError;
3151-
};
3152-
};
3153-
};
31543159
'/projects/{project_id}/endpoints': {
31553160
post: {
31563161
req: CreateProjectEndpointData;

0 commit comments

Comments
 (0)