Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
paambaati committed Aug 8, 2024
2 parents f9a23f0 + 315bbcd commit 3017358
Show file tree
Hide file tree
Showing 10 changed files with 123 additions and 78 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@

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

# [1.25.0](https://github.com/paambaati/neon-js-sdk/compare/v1.24.0...v1.25.0) (2024-08-05)


### Features

* update to track latest spec changes ([d02f771](https://github.com/paambaati/neon-js-sdk/commit/d02f771491aeaa6a72d4caa4140148f83c1ccc86))

# [1.24.0](https://github.com/paambaati/neon-js-sdk/compare/v1.23.0...v1.24.0) (2024-07-29)


Expand Down
9 changes: 9 additions & 0 deletions generated/models/AnnotationCreateValueRequest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { AnnotationValueData } from './AnnotationValueData';
export type AnnotationCreateValueRequest = {
annotation_value?: AnnotationValueData;
};

2 changes: 1 addition & 1 deletion generated/models/AnnotationResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
/* eslint-disable */
import type { AnnotationData } from './AnnotationData';
export type AnnotationResponse = {
annotation?: AnnotationData;
annotation: AnnotationData;
};

3 changes: 3 additions & 0 deletions generated/models/AnnotationValueData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
/**
* Annotation properties.
*/
export type AnnotationValueData = Record<string, string>;
9 changes: 9 additions & 0 deletions generated/models/EndpointType.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
/**
* The compute endpoint type. Either `read_write` or `read_only`.
*
*/
export type EndpointType = 'read_only' | 'read_write';
5 changes: 5 additions & 0 deletions generated/models/OrgDeletionConditionName.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type OrgDeletionConditionName = 'project_count';
71 changes: 49 additions & 22 deletions generated/schemas.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@ export const $Features = {
}
} as const;

export const $FeatureFlags = {
type: 'object',
additionalProperties: {
oneOf: [
{
type: 'boolean'
},
{
type: 'string'
}
]
}
} as const;

export const $ComputeUnit = {
type: 'number',
minimum: 0.25
Expand Down Expand Up @@ -1747,6 +1761,30 @@ export const $ExplainData = {
}
} as const;

export const $NotificationMetricType = {
type: 'string',
description: "The metric type for a given notification",
enum: ['database_size', 'connections', 'cpu', 'ram', 'compute_over_limit']
} as const;

export const $NotificationCategoryType = {
type: 'string',
description: "The category type for a given notification",
enum: ['usage', 'performance']
} as const;

export const $NotificationType = {
type: 'string',
description: "The type of the notification",
enum: ['info', 'warning']
} as const;

export const $NotificationActionType = {
type: 'string',
description: "The action type for a given notification",
enum: ['upgrade_plan', 'upgrade_cu']
} as const;

export const $Role = {
type: 'object',
required: ['branch_id', 'name', 'created_at', 'updated_at'],
Expand Down Expand Up @@ -1880,14 +1918,17 @@ export const $PaymentSource = {

export const $BillingAccount = {
type: 'object',
required: ['payment_source', 'subscription_type', 'quota_reset_at_last', 'name', 'email', 'address_city', 'address_country', 'address_line1', 'address_line2', 'address_postal_code', 'address_state'],
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'],
properties: {
payment_source: {
'$ref': '#/components/schemas/PaymentSource'
},
subscription_type: {
'$ref': '#/components/schemas/BillingSubscriptionType'
},
payment_method: {
'$ref': '#/components/schemas/BillingPaymentMethod'
},
quota_reset_at_last: {
description: "The last time the quota was reset. Defaults to the date-time the account is created.",
type: 'string',
Expand Down Expand Up @@ -1950,6 +1991,12 @@ export const $BillingSubscriptionType = {
enum: ['UNKNOWN', 'direct_sales', 'aws_marketplace', 'free_v2', 'launch', 'scale']
} as const;

export const $BillingPaymentMethod = {
type: 'string',
description: "Indicates whether and how an account makes payments.",
enum: ['UNKNOWN', 'none', 'stripe', 'direct_payment', 'aws_mp', 'vercel_mp']
} as const;

export const $Database = {
type: 'object',
required: ['id', 'branch_id', 'name', 'owner_name', 'created_at', 'updated_at'],
Expand Down Expand Up @@ -2824,14 +2871,6 @@ export const $AnnotationObjectData = {
}
} as const;

export const $AnnotationObjectsData = {
type: 'array',
'x-tags': ['Branch'],
items: {
'$ref': '#/components/schemas/AnnotationObjectData'
}
} as const;

export const $AnnotationCreateValueRequest = {
type: 'object',
'x-tags': ['Branch'],
Expand All @@ -2853,22 +2892,10 @@ export const $AnnotationResponse = {
}
} as const;

export const $AnnotationsResponse = {
type: 'object',
'x-tags': ['Branch'],
properties: {
annotations: {
type: 'array',
items: {
'$ref': '#/components/schemas/AnnotationData'
}
}
}
} as const;

export const $AnnotationsMapResponse = {
type: 'object',
'x-tags': ['Branch'],
required: ['annotations'],
properties: {
annotations: {
type: 'object',
Expand Down
25 changes: 2 additions & 23 deletions generated/services.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import type { CancelablePromise } from './core/CancelablePromise';
import type { BaseHttpRequest } from './core/BaseHttpRequest';
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';
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';

export class ApiKeyService {
constructor(public readonly httpRequest: BaseHttpRequest) { }
Expand Down Expand Up @@ -1067,28 +1067,6 @@ export class BranchService {
});
}

/**
* List annotations
* List annotations
*
* @param data The data for the request.
* @param data.objects A list of annotation objects to query the annotations.
* @returns AnnotationsResponse Annotations provided
* @throws ApiError
*/
public listAnnotations(data: ListAnnotationsData): CancelablePromise<ListAnnotationsResponse> {
return this.httpRequest.request({
method: 'GET',
url: '/annotations',
query: {
objects: data.objects
},
errors: {
default: 'General Error'
}
});
}

}

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

/**
* @deprecated
* Get project consumption metrics
* 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).
Expand Down
3 changes: 2 additions & 1 deletion generated/services/BranchService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { AnnotationCreateValueRequest } from '../models/AnnotationCreateValueRequest';
import type { AnnotationResponse } from '../models/AnnotationResponse';
import type { AnnotationsMapResponse } from '../models/AnnotationsMapResponse';
import type { AnnotationsResponse } from '../models/AnnotationsResponse';
Expand Down Expand Up @@ -49,7 +50,7 @@ export class BranchService {
*/
public createProjectBranch(
projectId: string,
requestBody?: BranchCreateRequest,
requestBody?: (BranchCreateRequest & AnnotationCreateValueRequest),
): CancelablePromise<GeneralError | (BranchResponse & EndpointsResponse & OperationsResponse & RolesResponse & DatabasesResponse & ConnectionURIsOptionalResponse)> {
return this.httpRequest.request({
method: 'POST',
Expand Down
67 changes: 36 additions & 31 deletions generated/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ export type Features = {
[key: string]: (boolean);
};

export type FeatureFlags = {
[key: string]: (boolean | string);
};

export type ComputeUnit = number;

/**
Expand Down Expand Up @@ -1235,6 +1239,30 @@ export type ExplainData = {
'QUERY PLAN': string;
};

/**
* The metric type for a given notification
*
*/
export type NotificationMetricType = 'database_size' | 'connections' | 'cpu' | 'ram' | 'compute_over_limit';

/**
* The category type for a given notification
*
*/
export type NotificationCategoryType = 'usage' | 'performance';

/**
* The type of the notification
*
*/
export type NotificationType = 'info' | 'warning';

/**
* The action type for a given notification
*
*/
export type NotificationActionType = 'upgrade_plan' | 'upgrade_cu';

export type Role = {
/**
* The ID of the branch to which the role belongs
Expand Down Expand Up @@ -1335,6 +1363,7 @@ export type PaymentSource = {
export type BillingAccount = {
payment_source: PaymentSource;
subscription_type: BillingSubscriptionType;
payment_method: BillingPaymentMethod;
/**
* The last time the quota was reset. Defaults to the date-time the account is created.
*
Expand Down Expand Up @@ -1408,6 +1437,12 @@ export type BillingAccount = {
*/
export type BillingSubscriptionType = 'UNKNOWN' | 'direct_sales' | 'aws_marketplace' | 'free_v2' | 'launch' | 'scale';

/**
* Indicates whether and how an account makes payments.
*
*/
export type BillingPaymentMethod = 'UNKNOWN' | 'none' | 'stripe' | 'direct_payment' | 'aws_mp' | 'vercel_mp';

export type Database = {
/**
* The database ID
Expand Down Expand Up @@ -1845,8 +1880,6 @@ export type AnnotationObjectData = {
id: string;
};

export type AnnotationObjectsData = Array<AnnotationObjectData>;

export type AnnotationCreateValueRequest = {
annotation_value?: AnnotationValueData;
};
Expand All @@ -1855,12 +1888,8 @@ export type AnnotationResponse = {
annotation: AnnotationData;
};

export type AnnotationsResponse = {
annotations?: Array<AnnotationData>;
};

export type AnnotationsMapResponse = {
annotations?: {
annotations: {
[key: string]: AnnotationData;
};
};
Expand Down Expand Up @@ -2350,15 +2379,6 @@ export type ResetProjectBranchRolePasswordData = {

export type ResetProjectBranchRolePasswordResponse = RoleOperations;

export type ListAnnotationsData = {
/**
* A list of annotation objects to query the annotations.
*/
objects: AnnotationObjectsData;
};

export type ListAnnotationsResponse = AnnotationsResponse;

export type CreateProjectEndpointData = {
/**
* The Neon project ID
Expand Down Expand Up @@ -3136,21 +3156,6 @@ export type $OpenApiTs = {
};
};
};
'/annotations': {
get: {
req: ListAnnotationsData;
res: {
/**
* Annotations provided
*/
200: AnnotationsResponse;
/**
* General Error
*/
default: GeneralError;
};
};
};
'/projects/{project_id}/endpoints': {
post: {
req: CreateProjectEndpointData;
Expand Down

0 comments on commit 3017358

Please sign in to comment.