Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev 165 #25

Merged
merged 6 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions sdk/AiRoute.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/* eslint-disable */
/* tslint:disable */
/*
* ---------------------------------------------------------------
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
* ## ##
* ## AUTHOR: acacode ##
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
* ---------------------------------------------------------------
*/

import {
AssistServerFiltersAiAssistServerFiltersGetData,
AssistServerPriceFiltersAiAssistServerPriceFiltersGetData,
} from "./data-contracts";

export namespace Ai {
/**
* @description Extract Server JSON filters from freetext.
* @tags AI
* @name AssistServerFiltersAiAssistServerFiltersGet
* @summary Assist Server Filters
* @request GET:/ai/assist_server_filters
*/
export namespace AssistServerFiltersAiAssistServerFiltersGet {
export type RequestParams = {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specify explicit types instead of using '{}'.

- export type RequestParams = {};
- export type RequestHeaders = {};
+ export type RequestParams = Record<string, unknown>;
+ export type RequestHeaders = Record<string, string>;

Also applies to: 32-32

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
export type RequestParams = {};
export type RequestParams = Record<string, unknown>;
export type RequestHeaders = Record<string, string>;
Tools
Biome

[error] 26-26: Don't use '{}' as a type. (lint/complexity/noBannedTypes)

Prefer explicitly define the object shape. '{}' means "any non-nullable value".

export type RequestQuery = {
/** Text */
text: string;
};
export type RequestBody = never;
export type RequestHeaders = {};
export type ResponseBody = AssistServerFiltersAiAssistServerFiltersGetData;
}

/**
* @description Extract ServerPrice JSON filters from freetext.
* @tags AI
* @name AssistServerPriceFiltersAiAssistServerPriceFiltersGet
* @summary Assist Server Price Filters
* @request GET:/ai/assist_server_price_filters
*/
export namespace AssistServerPriceFiltersAiAssistServerPriceFiltersGet {
export type RequestParams = {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specify explicit types instead of using '{}'.

- export type RequestParams = {};
- export type RequestHeaders = {};
+ export type RequestParams = Record<string, unknown>;
+ export type RequestHeaders = Record<string, string>;

Also applies to: 50-50

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
export type RequestParams = {};
export type RequestParams = Record<string, unknown>;
export type RequestHeaders = Record<string, string>;
Tools
Biome

[error] 44-44: Don't use '{}' as a type. (lint/complexity/noBannedTypes)

Prefer explicitly define the object shape. '{}' means "any non-nullable value".

export type RequestQuery = {
/** Text */
text: string;
};
export type RequestBody = never;
export type RequestHeaders = {};
export type ResponseBody = AssistServerPriceFiltersAiAssistServerPriceFiltersGetData;
}
}
29 changes: 29 additions & 0 deletions sdk/HealthcheckRoute.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/* eslint-disable */
/* tslint:disable */
/*
* ---------------------------------------------------------------
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
* ## ##
* ## AUTHOR: acacode ##
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
* ---------------------------------------------------------------
*/

import { HealthcheckHealthcheckGetData } from "./data-contracts";

export namespace Healthcheck {
/**
* @description Return database hash and last udpated timestamp.
* @tags Administrative endpoints
* @name HealthcheckHealthcheckGet
* @summary Healthcheck
* @request GET:/healthcheck
*/
export namespace HealthcheckHealthcheckGet {
export type RequestParams = {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specify explicit types instead of using '{}'.

-    export type RequestParams = {};
+    export type RequestParams = Record<string, never>;

-    export type RequestQuery = {};
+    export type RequestQuery = Record<string, never>;

-    export type RequestHeaders = {};
+    export type RequestHeaders = Record<string, never>;

This change enhances type safety by explicitly defining that no properties are expected in these objects.

Also applies to: 24-24, 26-26

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
export type RequestParams = {};
export type RequestParams = Record<string, never>;
export type RequestQuery = Record<string, never>;
export type RequestHeaders = Record<string, never>;
Tools
Biome

[error] 23-23: Don't use '{}' as a type. (lint/complexity/noBannedTypes)

Prefer explicitly define the object shape. '{}' means "any non-nullable value".

export type RequestQuery = {};
export type RequestBody = never;
export type RequestHeaders = {};
export type ResponseBody = HealthcheckHealthcheckGetData;
}
}
20 changes: 8 additions & 12 deletions sdk/Datacenters.ts → sdk/Regions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,10 @@
* ---------------------------------------------------------------
*/

import {
HTTPValidationError,
SearchDatacentersDatacentersGetData,
SearchDatacentersDatacentersGetParams,
} from "./data-contracts";
import { HTTPValidationError, SearchRegionsRegionsGetData, SearchRegionsRegionsGetParams } from "./data-contracts";
import { HttpClient, RequestParams } from "./http-client";

export class Datacenters<SecurityDataType = unknown> {
export class Regions<SecurityDataType = unknown> {
http: HttpClient<SecurityDataType>;

constructor(http: HttpClient<SecurityDataType>) {
Expand All @@ -27,13 +23,13 @@ export class Datacenters<SecurityDataType = unknown> {
* No description
*
* @tags Query Resources
* @name SearchDatacentersDatacentersGet
* @summary Search Datacenters
* @request GET:/datacenters
* @name SearchRegionsRegionsGet
* @summary Search Regions
* @request GET:/regions
*/
searchDatacentersDatacentersGet = (query: SearchDatacentersDatacentersGetParams, params: RequestParams = {}) =>
this.http.request<SearchDatacentersDatacentersGetData, HTTPValidationError>({
path: `/datacenters`,
searchRegionsRegionsGet = (query: SearchRegionsRegionsGetParams, params: RequestParams = {}) =>
this.http.request<SearchRegionsRegionsGetData, HTTPValidationError>({
path: `/regions`,
method: "GET",
query: query,
...params,
Expand Down
35 changes: 35 additions & 0 deletions sdk/RegionsRoute.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/* eslint-disable */
/* tslint:disable */
/*
* ---------------------------------------------------------------
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
* ## ##
* ## AUTHOR: acacode ##
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
* ---------------------------------------------------------------
*/

import { SearchRegionsRegionsGetData } from "./data-contracts";

export namespace Regions {
/**
* No description
* @tags Query Resources
* @name SearchRegionsRegionsGet
* @summary Search Regions
* @request GET:/regions
*/
export namespace SearchRegionsRegionsGet {
export type RequestParams = {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specify explicit types instead of using '{}'.

-    export type RequestParams = {};
+    export type RequestParams = Record<string, never>;

-    export type RequestHeaders = {};
+    export type RequestHeaders = Record<string, never>;

This change enhances type safety by explicitly defining that no properties are expected in these objects.

Also applies to: 32-32

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
export type RequestParams = {};
export type RequestParams = Record<string, never>;
Tools
Biome

[error] 23-23: Don't use '{}' as a type. (lint/complexity/noBannedTypes)

Prefer explicitly define the object shape. '{}' means "any non-nullable value".

export type RequestQuery = {
/**
* Vendor id
* Identifier of the cloud provider vendor.
*/
vendor?: "hcloud" | "aws" | "gcp";
};
export type RequestBody = never;
export type RequestHeaders = {};
export type ResponseBody = SearchRegionsRegionsGetData;
}
}
14 changes: 7 additions & 7 deletions sdk/Server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* ---------------------------------------------------------------
*/

import { GetServerServerVendorIdServerIdGetData, HTTPValidationError } from "./data-contracts";
import { GetServerServerVendorServerGetData, HTTPValidationError } from "./data-contracts";
import { HttpClient, RequestParams } from "./http-client";

export class Server<SecurityDataType = unknown> {
Expand All @@ -20,16 +20,16 @@ export class Server<SecurityDataType = unknown> {
}

/**
* No description
* @description Query a single server by its vendor id and either the server or, or its API reference. Return dictionary includes all server fields, along with the current prices per zone, and the available benchmark scores.
*
* @tags Query Resources
* @name GetServerServerVendorIdServerIdGet
* @name GetServerServerVendorServerGet
* @summary Get Server
* @request GET:/server/{vendor_id}/{server_id}
* @request GET:/server/{vendor}/{server}
*/
getServerServerVendorIdServerIdGet = (vendorId: string, serverId: string, params: RequestParams = {}) =>
this.http.request<GetServerServerVendorIdServerIdGetData, HTTPValidationError>({
path: `/server/${vendorId}/${serverId}`,
getServerServerVendorServerGet = (vendor: string, server: string, params: RequestParams = {}) =>
this.http.request<GetServerServerVendorServerGetData, HTTPValidationError>({
path: `/server/${vendor}/${server}`,
method: "GET",
...params,
});
Expand Down
Loading