All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
The release incorporates the up-to-date API contract as of 2024-12-08 10:35:00 GMT.
- Added the attribute
Archived
to the typeBranchCreateRequestBranch
to create archived branches.
- [BREAKING] Removed the attribute
ProtectedBranchOnly
from the typeAllowedIps
.
The release incorporates the up-to-date API contract as of 2024-11-21 00:12:18 GMT.
- Added the
MaintenanceWindow
attribute of theProjectSettingsData
type to configure the Neon project's maintenance window.
The release incorporates the up-to-date API contract as of 2024-11-09 11:12:00 GMT.
-
Added the methods to manipulate JWKS for the project:
AddProjectJWKS
: adds the JWKS URL to the project.GetProjectJWKS
: retrieve all JWKS URLs configured for the project.DeleteProjectJWKS
: deletes the JWKS URL from the project.
-
Added the method
GetOrganization
to read the organization's info -
Added the methods to manage the organization's membership invitations:
GetOrganizationInvitations
: retrieves the memberships invitations for the organization.GetOrganizationMember
: reads the info about the organization's members.GetOrganizationMembers
: retrieves the info about all organization's members.
-
Added Vercel as the identity provider's enum value.
- [BREAKING] Changed the type of the attributes
Primary
in theBranch
struct to the pointer to bool from bool.
The release incorporates the up-to-date API contract as of 2024-10-28 22:27:00 GMT.
- [BREAKING] Added the argument
search
to the methodListProjectBranches
to list branches by name or id. A partial name or id values may be specified to filter results. - Added the property
BillingAccount
of the typeCurrentUserInfoResponse
: added theState
to define the billing account's state. - Added the attribute
CreatedBy
to the typeApiKeysListResponseItem
to define the user who created the API key. - Added the endpoint
GetActiveRegions
to list active regions to provision databases.
The release incorporates the up-to-date API contract as of 2024-10-20 11:15:00 GMT.
-
Added the attributes to reflect when and who created, or revoked API keys:
- Added
CreatedBy
toApiKeyCreateResponse
andApiKeysListResponseItem
; - Added
CreatedAt
andCreatedBy
toApiKeyRevokeResponse
.
- Added
-
Added the attribute
StateChangedAt
to the typeBranch
to reflect when the "current_state" began.
- [BREAKING] Removed the method to list projects consumption
ListProjectsConsumption
.
The release incorporates the up-to-date API contract as of 2024-10-08 00:11:00 GMT.
- Added the mapping of the enum value "archived" to the type
BranchState
. - Added the mapping of the enum values "timeline_archive" and "timeline_unarchive" to the type
OperationAction
.
The release incorporates the up-to-date API contract as of 2024-10-01 06:44:00 GMT.
- Added "azure_mp" as a
BillingPaymentMethod
enum value.
- Changed the response type of the method
ListProjects
,ListProjectsRespObj
. It includes the mapProjectsApplicationsMapResponse
which contains all applications available in the project.
- Deprecated
Login
field in the typesCurrentUserAuthAccount
andCurrentUserInfoResponse
.
The release incorporates the up-to-date API contract as of 2024-09-28 21:53:00 GMT.
- Added the method
TransferProjectsFromUserToOrg
to migrate personal projects to organisation. - Added the payment method attribute to the struct
BillingAccount
. - Added
Business
subscription type's value. - Added the attribute
CreatedBy
to the structBranch
to indicate who created the branch.
- [BREAKING] Change the signatures of the methods:
ListProjectBranches
;CreateProjectBranch
;GetProjectBranch
;GetProjectBranchSchema
.
The release incorporates the up-to-date API contract as of 2024-06-24 22:03:00 GMT.
- Added support of the following ENUMs as type aliases:
- The type
BillingSubscriptionType
as the attribute of the response of the methodGetCurrentUserInfo
. - The type
BranchState
as attributes of the response of the methodGetProjectBranch
. - The type
ConsumptionHistoryGranularity
as the argument of the methodGetConsumptionHistoryPerAccount
andGetConsumptionHistoryPerProject
. - The types
EndpointPoolerMode
,EndpointState
as the attributes of the structEndpoint
, which defines the response of the methodGetProjectEndpoint
. - The type
EndpointType
as the attribute which defines the endpoint's type to create an endpoint, or define the options of the branch's endpoints. - The type
IdentityProviderId
as the attribute of the structCurrentUserAuthAccount
which defines the response of the methodGetCurrentUserInfo
. - The types
OperationAction
andOperationStatus
as the attributes of the structOperation
which defines the response of several endpoints which include the operations. - The type
Provisioner
which defines the Neon compute provisioner's type.
- The type
- Added the method
GetProjectBranchSchema
to retrieve the database schema, see details here. - Added the methods to retrieve the consumption metrics:
- Added the method
GetCurrentUserOrganizations
to read all organization which a given user belongs to. - Added support of the organization ID (
orgID
argument) when using the following methods:ListProjectsConsumption
, see details here.
- Added the name, the address and the tax information to the billing details of the account:
BillingAccount
struct.
- All arguments which end with the suffices Id/Ids, Url/Urls, Uri/Uris will follow the Go convention. For example,
the query parameter
project_ids
will correspond to the method's argumentprojectIDs
.
- The method
SetPrimaryProjectBranch
is deprecated, please use the methodSetDefaultProjectBranch
instead. - The label "primary" branch and the attributes
Primary
is deprecated for the label "default" and the respective attributeDefault
. See the structBranch
for example. - The attribute
ProxyHost
of the structEndpoint
is deprecated, please use the attributeHost
instead. - The attribute
CpuUsedSec
of the structsProject
andProjectListItem
is deprecated, please use the attributeComputeTimeSeconds
instead. - The attribute
QuotaResetAt
of the structsProject
andProjectListItem
is deprecated, please use the attributeConsumptionPeriodEnd
instead.
The release incorporates the up-to-date API contract as of 2024-04-13 11:00:00 GMT.
- Added the filtering argument
orgID
to the methodListProjects
to enhance the projects listing functionality. - Added the method
RestartProjectEndpoint
to restart the project's endpoint. Find details here. - Added the filter
ProtectedBranchesOnly
provision the list of allowed IP addresses only for the protected branches. - Added the field
ComputeReleaseVersion
to the structEndpoint
to reflect the version of the compute resources.
- Changed the type of the
HistoryRetentionSeconds
toint32
attribute.
- Fixed the method
GetConnectionURI
by correcting the logic of building the request query.
The release incorporates the up-to-date API contract as of 2024-03-21 23:20:00 GMT.
- Added the method
GetConnectionURI
to retrieve the connection URI for the given role and database, see details. - The branch can be set as protected at creation, or update using the attribute
Protected
.
The release incorporates the up-to-date API contract as of 2024-03-05 00:08:00 GMT.
- Added the
RestoreProjectBranch
method to restore the branch to a specified state: details.
The release incorporates the up-to-date API contract as of 2024-02-25 00:08:00 GMT.
- [BREAKING] Removed the method
VerifyUserPassword
.
The release incorporates the up-to-date API contract as of 2024-02-22 00:08:00 GMT.
- [BREAKING] The signature of the method
VerifyUserPassword
includes the password sent for verification.
The release incorporates the up-to-date API contract as of 2024-02-18 11:14:00 GMT.
- [BREAKING] Added the
search
argument to the signature of the methodsListProjects
andListSharedProjects
. It allows to filter the search results by the project name or ID (see more). - Added the methods
GetCurrentUserAuthInfo
andVerifyUserPassword
to query the user identity.
- Trailing "?"-sign for empty request queries.
The release incorporates the up-to-date API contract as of 2024-01-19 13:00:00 GMT.
- Added support to manage the project's permissions:
- List permissions:
ListProjectPermissions
; - Grant project's permissions to the user:
GrantPermissionToProject
; - Revoke project's permissions from the user:
RevokePermissionFromProject
.
- List permissions:
- [BREAKING] Changed the type of the attribute
Ips
in the structAllowedIps
.
The release incorporates the up-to-date API contract as of 2024-01-11 05:27:00 GMT.
- Added support to list the projects shared with the account. Find more here.
The release incorporates the up-to-date API contract as of 2023-12-22 01:09:10 GMT.
- Activation of the data logical replication for CDC.
- [BREAKING] All optional fields present in the structs of the API request and response payloads are now defined as pointers.
The release incorporates the up-to-date API contract as of 2023-12-20 10:37:20 GMT.
- Project level configuration of IP addresses allowed to connect to the endpoints.
LastResetAt
attribute indicating the last time when a branch was reset.
The release incorporates the up-to-date API contract as of 2023-11-02 13:54:20 GMT.
- [BREAKING]
ListProjectsConsumption
has the arguments "from" and "to" to filter by the billing period time now. - [BREAKING]
ProjectConsumption
contains the billing period's information including the period's start and end timestamps now. ProjectsConsumptionResponse
contains the number of billing periodsPeriodsInResponse
now.
- [BREAKING]
ProjectConsumption
does not contain the attributesComputeLastActiveAt
andID
now.
- [Linting] Private method
requestHandler
is assigned to theClient
instead of a pointer to it.
-
The interface
Client
is removed and the output of theNewClient
is the pointer to the struct now. It will facilitate stub of the SDK client. -
[BREAKING]
NewClient
requiresConfig
to initialise a Neon client. It's meant to improve security by eliminating support of environment variables for authentication by default. It also simplifies the codebase.Example
package main import ( "log" neon "github.com/kislerdm/neon-sdk-go" ) func main() { client, err := neon.NewClient(neon.Config{Key: "{{.NeonApiKey}}"}) if err != nil { panic(err) } v, err := client.ListProjects() if err != nil { panic(err) } log.Printf("%d projects found", len(v.Projects)) }
-
[BREAKING] Removed support of variadic functions used to configure SDK client.
The release incorporates the up-to-date API contract as of 2023-10-11 00:08:16 GMT.
- [BREAKING] Method
UpdateProject
returns the object of the typeUpdateProjectRespObj
(combination ofOperationsResponse
andProjectResponse
) now. Note that it reverts corresponding change made in v0.2.4.
- The struct
ApiKeyCreateResponse
(the response type of the methodCreateApiKey
) contains the attributesCreatedAt
andName
now.
The release incorporates the up-to-date API contract as of 2023-09-29 00:08:00 GMT.
- [BREAKING] Method
UpdateProject
returns the object of the typeProjectResponse
now - The struct
CurrentUserInfoResponse
(the response type of the methodGetCurrentUserInfo
) contains the attributeLastName
now
The release incorporates the up-to-date API contract as of 2023-09-21 01:30:00 GMT.
- Method
GetCurrentUserInfo
to retrieve information about the current user.
The release incorporates the up-to-date API contract as of 2023-09-14 00:08:27 GMT.
- (#26) Removed temporary workaround to map invalid
"200 response" which used to be returned by the Neon API for non existed resources (find
details here).
The rationale:
- The workaround logic relies on the header
Content-Length
, but the server response may not contain that header according to the RFC#7230:[...] Aside from the cases defined above, in the absence of Transfer-Encoding, an origin server SHOULD send a Content-Length header field when the payload body size is known prior to sending the complete header section.[...]
- It was noticed that the workaround leads to unexpected behaviour for the method
ListProject
: it returns the error "object not found" for the API response which contains a non-empty list of projects. The issue appeared when such list contains more than a couple of objects. - The reason caused implementation of the workaround was presumably resolved on the Neon API side.
- The workaround logic relies on the header
The release incorporates the up-to-date API contract as of 2023-07-29 23:16:06 GMT.
- The response type
CreatedBranch
of the methodCreateProjectBranch
. - The type
Operation
:TotalDurationMs
attribute added to reflect duration of the operation.
The release incorporates the up-to-date API contract as of 2023-07-26 11:57:20 GMT.
- Pagination support for list methods
- [Preview] Method to query consumption metrics for every
project (details):
ListProjectsConsumption
- (#15) Autoscaling limits are defined using floating point units
- (#9) The project's quota data struct is collocated with the project's settings data struct.
- Module's documentation
- Order of the data structs' attributes, they will be sorted alphabetically
- Support of go versions below 1.18
- Fixed the definition of the optional field
Settings
for the following types:EndpointUpdateRequestEndpoint
EndpointCreateRequestEndpoint
The reason: to omit the JSON field settings
when serialising the above types' objects when the field Settings
is nil
.
- Fixed handling optional request body
- Fixed test for
CreateProjectBranch
- Fixed definition of the request data types with optional fields of the type
time.Time
- Type
PgSettingsData
is defined asmap[string]interface{}
instead of emptystruct
.
- Fixed the way environment variables are set in the tests:
t.Setenv
instead ofos.Setenv
. - Reduced the cyclomatic complexity to be below 16.
- Aligned the SDK methods and types definitions with the up-to-date API spec
- Methods compliant with the API V2
- Only required path parameters mapped onto the SDK methods
- SDK authentication using variadic function and environment
variable
NEON_API_KEY
. The evaluation order:- Variadic function client's argument;
- Environment variables.
- Mock for the HTTP client:
package main
import (
"log"
neon "github.com/kislerdm/neon-sdk-go"
)
func main() {
client, err := neon.NewClient(neon.WithHTTPClient(neon.NewMockHTTPClient()))
if err != nil {
panic(err)
}
v, err := client.ListProjects()
if err != nil {
panic(err)
}
log.Printf("%d projects found", len(v.Projects))
}