-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: upgrade to latest package version
This applies the fixes for hey-api/openapi-ts#474 and hey-api/openapi-ts#484
- Loading branch information
Showing
15 changed files
with
8,805 additions
and
661 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,53 @@ | ||
/* generated using openapi-typescript-codegen -- do not edit */ | ||
/* istanbul ignore file */ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
import type { BaseHttpRequest } from './core/BaseHttpRequest'; | ||
import type { OpenAPIConfig } from './core/OpenAPI'; | ||
import { Interceptors } from './core/OpenAPI'; | ||
import { FetchHttpRequest } from './core/FetchHttpRequest'; | ||
import { ApiKeyService } from './services/ApiKeyService'; | ||
import { BranchService } from './services/BranchService'; | ||
import { ConsumptionService } from './services/ConsumptionService'; | ||
import { EndpointService } from './services/EndpointService'; | ||
import { OperationService } from './services/OperationService'; | ||
import { ProjectService } from './services/ProjectService'; | ||
import { UsersService } from './services/UsersService'; | ||
|
||
import { ApiKeyService } from './services.gen'; | ||
import { BranchService } from './services.gen'; | ||
import { ConsumptionService } from './services.gen'; | ||
import { EndpointService } from './services.gen'; | ||
import { OperationService } from './services.gen'; | ||
import { ProjectService } from './services.gen'; | ||
import { UsersService } from './services.gen'; | ||
|
||
type HttpRequestConstructor = new (config: OpenAPIConfig) => BaseHttpRequest; | ||
|
||
export class NeonClient { | ||
public readonly apiKey: ApiKeyService; | ||
public readonly branch: BranchService; | ||
public readonly consumption: ConsumptionService; | ||
public readonly endpoint: EndpointService; | ||
public readonly operation: OperationService; | ||
public readonly project: ProjectService; | ||
public readonly users: UsersService; | ||
public readonly request: BaseHttpRequest; | ||
constructor(config?: Partial<OpenAPIConfig>, HttpRequest: HttpRequestConstructor = FetchHttpRequest) { | ||
this.request = new HttpRequest({ | ||
BASE: config?.BASE ?? 'https://console.neon.tech/api/v2', | ||
VERSION: config?.VERSION ?? '2', | ||
WITH_CREDENTIALS: config?.WITH_CREDENTIALS ?? false, | ||
CREDENTIALS: config?.CREDENTIALS ?? 'include', | ||
TOKEN: config?.TOKEN, | ||
USERNAME: config?.USERNAME, | ||
PASSWORD: config?.PASSWORD, | ||
HEADERS: config?.HEADERS, | ||
ENCODE_PATH: config?.ENCODE_PATH, | ||
}); | ||
this.apiKey = new ApiKeyService(this.request); | ||
this.branch = new BranchService(this.request); | ||
this.consumption = new ConsumptionService(this.request); | ||
this.endpoint = new EndpointService(this.request); | ||
this.operation = new OperationService(this.request); | ||
this.project = new ProjectService(this.request); | ||
this.users = new UsersService(this.request); | ||
} | ||
} | ||
|
||
public readonly apiKey: ApiKeyService; | ||
public readonly branch: BranchService; | ||
public readonly consumption: ConsumptionService; | ||
public readonly endpoint: EndpointService; | ||
public readonly operation: OperationService; | ||
public readonly project: ProjectService; | ||
public readonly users: UsersService; | ||
|
||
public readonly request: BaseHttpRequest; | ||
|
||
constructor(config?: Partial<OpenAPIConfig>, HttpRequest: HttpRequestConstructor = FetchHttpRequest) { | ||
this.request = new HttpRequest({ | ||
BASE: config?.BASE ?? 'https://console.neon.tech/api/v2', | ||
VERSION: config?.VERSION ?? '2', | ||
WITH_CREDENTIALS: config?.WITH_CREDENTIALS ?? false, | ||
CREDENTIALS: config?.CREDENTIALS ?? 'include', | ||
TOKEN: config?.TOKEN, | ||
USERNAME: config?.USERNAME, | ||
PASSWORD: config?.PASSWORD, | ||
HEADERS: config?.HEADERS, | ||
ENCODE_PATH: config?.ENCODE_PATH, | ||
interceptors: { | ||
request: config?.interceptors?.request ?? new Interceptors(), | ||
response: config?.interceptors?.response ?? new Interceptors(), | ||
}, | ||
}); | ||
|
||
this.apiKey = new ApiKeyService(this.request); | ||
this.branch = new BranchService(this.request); | ||
this.consumption = new ConsumptionService(this.request); | ||
this.endpoint = new EndpointService(this.request); | ||
this.operation = new OperationService(this.request); | ||
this.project = new ProjectService(this.request); | ||
this.users = new UsersService(this.request); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,21 @@ | ||
/* generated using openapi-typescript-codegen -- do not edit */ | ||
/* istanbul ignore file */ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
import type { ApiRequestOptions } from './ApiRequestOptions'; | ||
import type { ApiResult } from './ApiResult'; | ||
|
||
export class ApiError extends Error { | ||
public readonly url: string; | ||
public readonly status: number; | ||
public readonly statusText: string; | ||
public readonly body: any; | ||
public readonly request: ApiRequestOptions; | ||
public readonly url: string; | ||
public readonly status: number; | ||
public readonly statusText: string; | ||
public readonly body: unknown; | ||
public readonly request: ApiRequestOptions; | ||
|
||
constructor(request: ApiRequestOptions, response: ApiResult, message: string) { | ||
super(message); | ||
constructor(request: ApiRequestOptions, response: ApiResult, message: string) { | ||
super(message); | ||
|
||
this.name = 'ApiError'; | ||
this.url = response.url; | ||
this.status = response.status; | ||
this.statusText = response.statusText; | ||
this.body = response.body; | ||
this.request = request; | ||
} | ||
} | ||
this.name = 'ApiError'; | ||
this.url = response.url; | ||
this.status = response.status; | ||
this.statusText = response.statusText; | ||
this.body = response.body; | ||
this.request = request; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,13 @@ | ||
/* generated using openapi-typescript-codegen -- do not edit */ | ||
/* istanbul ignore file */ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export type ApiRequestOptions = { | ||
readonly method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'PATCH'; | ||
readonly url: string; | ||
readonly path?: Record<string, any>; | ||
readonly cookies?: Record<string, any>; | ||
readonly headers?: Record<string, any>; | ||
readonly query?: Record<string, any>; | ||
readonly formData?: Record<string, any>; | ||
readonly body?: any; | ||
readonly mediaType?: string; | ||
readonly responseHeader?: string; | ||
readonly errors?: Record<number, string>; | ||
}; | ||
readonly method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'PATCH'; | ||
readonly url: string; | ||
readonly path?: Record<string, unknown>; | ||
readonly cookies?: Record<string, unknown>; | ||
readonly headers?: Record<string, unknown>; | ||
readonly query?: Record<string, unknown>; | ||
readonly formData?: Record<string, unknown>; | ||
readonly body?: any; | ||
readonly mediaType?: string; | ||
readonly responseHeader?: string; | ||
readonly errors?: Record<number, string>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,7 @@ | ||
/* generated using openapi-typescript-codegen -- do not edit */ | ||
/* istanbul ignore file */ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export type ApiResult = { | ||
readonly url: string; | ||
readonly ok: boolean; | ||
readonly status: number; | ||
readonly statusText: string; | ||
readonly body: any; | ||
}; | ||
export type ApiResult<TData = any> = { | ||
readonly body: TData; | ||
readonly ok: boolean; | ||
readonly status: number; | ||
readonly statusText: string; | ||
readonly url: string; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,10 @@ | ||
/* generated using openapi-typescript-codegen -- do not edit */ | ||
/* istanbul ignore file */ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
import type { ApiRequestOptions } from './ApiRequestOptions'; | ||
import type { CancelablePromise } from './CancelablePromise'; | ||
import type { OpenAPIConfig } from './OpenAPI'; | ||
|
||
export abstract class BaseHttpRequest { | ||
|
||
constructor(public readonly config: OpenAPIConfig) {} | ||
constructor(public readonly config: OpenAPIConfig) {} | ||
|
||
public abstract request<T>(options: ApiRequestOptions): CancelablePromise<T>; | ||
} | ||
public abstract request<T>(options: ApiRequestOptions): CancelablePromise<T>; | ||
} |
Oops, something went wrong.