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 30 #118

Merged
merged 31 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
0fbc419
SDK update
Palabola Aug 14, 2024
185f210
/storages added
Palabola Aug 14, 2024
06cd0fb
Merge branch 'main' into DEV-299
Palabola Aug 22, 2024
1cdd4a1
SDK update
Palabola Aug 22, 2024
08d0643
/storages updates
Palabola Aug 22, 2024
1f4836b
Merge branch 'main' into DEV-299
Palabola Sep 2, 2024
c91bd9f
Merge branch 'main' into DEV-299
Palabola Sep 5, 2024
7aeae50
SDK update
Palabola Sep 5, 2024
60e0ea1
SDK update
Palabola Sep 5, 2024
8c3655f
Merge branch 'main' into DEV-299
Palabola Sep 9, 2024
3c34b25
SDK
Palabola Sep 9, 2024
a094510
added currency options to storages
Palabola Sep 9, 2024
612bb6f
Merge branch 'DEV-299' of https://github.com/SpareCores/sc-www into D…
Palabola Sep 9, 2024
11c7e33
typo
Palabola Sep 9, 2024
5228f56
lint
Palabola Sep 9, 2024
7e4b7f8
added /traffic_prices page
Palabola Sep 9, 2024
0341576
SDK
Palabola Sep 9, 2024
77ddbea
traffic-prices update
Palabola Sep 10, 2024
3f1114e
dynamic title, needs research before use
Palabola Sep 10, 2024
6455c53
missing filea
Palabola Sep 11, 2024
e2def96
storages ordering + fields
Palabola Sep 11, 2024
780db3e
cleanup
Palabola Sep 11, 2024
4d4ac54
review
Palabola Sep 11, 2024
a4e3579
review
Palabola Sep 11, 2024
a99cbaa
SDK update
Palabola Sep 13, 2024
9990ffc
update AI assistant logic, use schema default limits
Palabola Sep 13, 2024
8c1b735
Merge branch 'main' into DEV-349
Palabola Sep 13, 2024
500db4d
lint
Palabola Sep 13, 2024
243473b
Merge branch 'DEV-349' of https://github.com/SpareCores/sc-www into D…
Palabola Sep 13, 2024
7c5109c
default order
Palabola Sep 13, 2024
b2bbb54
query total count
Palabola Sep 13, 2024
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
42 changes: 42 additions & 0 deletions sdk/Ai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ import {
AssistServerFiltersAiAssistServerFiltersGetParams,
AssistServerPriceFiltersAiAssistServerPriceFiltersGetData,
AssistServerPriceFiltersAiAssistServerPriceFiltersGetParams,
AssistStoragePriceFiltersAiAssistStoragePriceFiltersGetData,
AssistStoragePriceFiltersAiAssistStoragePriceFiltersGetParams,
AssistTrafficPriceFiltersAiAssistTrafficPriceFiltersGetData,
AssistTrafficPriceFiltersAiAssistTrafficPriceFiltersGetParams,
HTTPValidationError,
} from "./data-contracts";
import { HttpClient, RequestParams } from "./http-client";
Expand Down Expand Up @@ -63,4 +67,42 @@ export class Ai<SecurityDataType = unknown> {
format: "json",
...params,
});
/**
* @description Extract StoragePrice JSON filters from freetext.
*
* @tags AI
* @name AssistStoragePriceFiltersAiAssistStoragePriceFiltersGet
* @summary Assist Storage Price Filters
* @request GET:/ai/assist_storage_price_filters
*/
assistStoragePriceFiltersAiAssistStoragePriceFiltersGet = (
query: AssistStoragePriceFiltersAiAssistStoragePriceFiltersGetParams,
params: RequestParams = {},
) =>
this.http.request<AssistStoragePriceFiltersAiAssistStoragePriceFiltersGetData, HTTPValidationError>({
path: `/ai/assist_storage_price_filters`,
method: "GET",
query: query,
format: "json",
...params,
});
/**
* @description Extract TrafficPrice JSON filters from freetext.
*
* @tags AI
* @name AssistTrafficPriceFiltersAiAssistTrafficPriceFiltersGet
* @summary Assist Traffic Price Filters
* @request GET:/ai/assist_traffic_price_filters
*/
assistTrafficPriceFiltersAiAssistTrafficPriceFiltersGet = (
query: AssistTrafficPriceFiltersAiAssistTrafficPriceFiltersGetParams,
params: RequestParams = {},
) =>
this.http.request<AssistTrafficPriceFiltersAiAssistTrafficPriceFiltersGetData, HTTPValidationError>({
path: `/ai/assist_traffic_price_filters`,
method: "GET",
query: query,
format: "json",
...params,
});
}
38 changes: 38 additions & 0 deletions sdk/AiRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import {
AssistServerFiltersAiAssistServerFiltersGetData,
AssistServerPriceFiltersAiAssistServerPriceFiltersGetData,
AssistStoragePriceFiltersAiAssistStoragePriceFiltersGetData,
AssistTrafficPriceFiltersAiAssistTrafficPriceFiltersGetData,
} from "./data-contracts";

export namespace Ai {
Expand Down Expand Up @@ -50,4 +52,40 @@ export namespace Ai {
export type RequestHeaders = {};
export type ResponseBody = AssistServerPriceFiltersAiAssistServerPriceFiltersGetData;
}

/**
* @description Extract StoragePrice JSON filters from freetext.
* @tags AI
* @name AssistStoragePriceFiltersAiAssistStoragePriceFiltersGet
* @summary Assist Storage Price Filters
* @request GET:/ai/assist_storage_price_filters
*/
export namespace AssistStoragePriceFiltersAiAssistStoragePriceFiltersGet {
export type RequestParams = {};
export type RequestQuery = {
/** Text */
text: string;
};
export type RequestBody = never;
export type RequestHeaders = {};
export type ResponseBody = AssistStoragePriceFiltersAiAssistStoragePriceFiltersGetData;
}
Comment on lines +56 to +72
Copy link
Contributor

Choose a reason for hiding this comment

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

Well-documented namespace, but consider refining type definitions.

The namespace AssistStoragePriceFiltersAiAssistStoragePriceFiltersGet is well-documented and structured. However, the use of '{}' for RequestParams and RequestHeaders should be replaced with more explicit types to avoid ambiguity and comply with static analysis recommendations.

Consider defining explicit types or interfaces for RequestParams and RequestHeaders:

- export type RequestParams = {};
- export type RequestHeaders = {};
+ export interface RequestParams {
+   // Define specific parameters here if any, otherwise use 'Record<string, never>' for empty objects
+ }
+ export interface RequestHeaders {
+   // Define specific headers here if any, otherwise use 'Record<string, never>' for empty objects
+ }
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. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/**
* @description Extract StoragePrice JSON filters from freetext.
* @tags AI
* @name AssistStoragePriceFiltersAiAssistStoragePriceFiltersGet
* @summary Assist Storage Price Filters
* @request GET:/ai/assist_storage_price_filters
*/
export namespace AssistStoragePriceFiltersAiAssistStoragePriceFiltersGet {
export type RequestParams = {};
export type RequestQuery = {
/** Text */
text: string;
};
export type RequestBody = never;
export type RequestHeaders = {};
export type ResponseBody = AssistStoragePriceFiltersAiAssistStoragePriceFiltersGetData;
}
/**
* @description Extract StoragePrice JSON filters from freetext.
* @tags AI
* @name AssistStoragePriceFiltersAiAssistStoragePriceFiltersGet
* @summary Assist Storage Price Filters
* @request GET:/ai/assist_storage_price_filters
*/
export namespace AssistStoragePriceFiltersAiAssistStoragePriceFiltersGet {
export interface RequestParams {
// Define specific parameters here if any, otherwise use 'Record<string, never>' for empty objects
}
export type RequestQuery = {
/** Text */
text: string;
};
export type RequestBody = never;
export interface RequestHeaders {
// Define specific headers here if any, otherwise use 'Record<string, never>' for empty objects
}
export type ResponseBody = AssistStoragePriceFiltersAiAssistStoragePriceFiltersGetData;
}
Tools
Biome

[error] 63-63: Don't use '{}' as a type.

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

(lint/complexity/noBannedTypes)


[error] 69-69: Don't use '{}' as a type.

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

(lint/complexity/noBannedTypes)


/**
* @description Extract TrafficPrice JSON filters from freetext.
* @tags AI
* @name AssistTrafficPriceFiltersAiAssistTrafficPriceFiltersGet
* @summary Assist Traffic Price Filters
* @request GET:/ai/assist_traffic_price_filters
*/
export namespace AssistTrafficPriceFiltersAiAssistTrafficPriceFiltersGet {
export type RequestParams = {};
export type RequestQuery = {
/** Text */
text: string;
};
export type RequestBody = never;
export type RequestHeaders = {};
export type ResponseBody = AssistTrafficPriceFiltersAiAssistTrafficPriceFiltersGetData;
}
Comment on lines +81 to +90
Copy link
Contributor

Choose a reason for hiding this comment

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

Define explicit types or interfaces for request parameters and headers.

The namespace AssistTrafficPriceFiltersAiAssistTrafficPriceFiltersGet is well-structured and documented. However, similar to the AssistStoragePriceFiltersAiAssistStoragePriceFiltersGet namespace, the usage of '{}' as a type for request parameters and headers should be replaced with explicit types or interfaces to avoid ambiguity and comply with static analysis recommendations.

Consider defining explicit types or interfaces for RequestParams and RequestHeaders:

-export type RequestParams = {};
-export type RequestHeaders = {};
+export interface RequestParams {
+  // Define specific parameters here if any, otherwise use 'Record<string, never>' for empty objects
+}
+export interface RequestHeaders {
+  // Define specific headers here if any, otherwise use 'Record<string, never>' for empty objects
+}
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. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export namespace AssistTrafficPriceFiltersAiAssistTrafficPriceFiltersGet {
export type RequestParams = {};
export type RequestQuery = {
/** Text */
text: string;
};
export type RequestBody = never;
export type RequestHeaders = {};
export type ResponseBody = AssistTrafficPriceFiltersAiAssistTrafficPriceFiltersGetData;
}
export namespace AssistTrafficPriceFiltersAiAssistTrafficPriceFiltersGet {
export interface RequestParams {
// Define specific parameters here if any, otherwise use 'Record<string, never>' for empty objects
}
export type RequestQuery = {
/** Text */
text: string;
};
export type RequestBody = never;
export interface RequestHeaders {
// Define specific headers here if any, otherwise use 'Record<string, never>' for empty objects
}
export type ResponseBody = AssistTrafficPriceFiltersAiAssistTrafficPriceFiltersGetData;
}
Tools
Biome

[error] 82-82: Don't use '{}' as a type.

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

(lint/complexity/noBannedTypes)


[error] 88-88: Don't use '{}' as a type.

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

(lint/complexity/noBannedTypes)

}
2 changes: 1 addition & 1 deletion sdk/Healthcheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class Healthcheck<SecurityDataType = unknown> {
}

/**
* @description Return database hash and last updated timestamp.
* @description Quickly return package and database version information.
*
* @tags Administrative endpoints
* @name HealthcheckHealthcheckGet
Expand Down
2 changes: 1 addition & 1 deletion sdk/HealthcheckRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { HealthcheckHealthcheckGetData } from "./data-contracts";

export namespace Healthcheck {
/**
* @description Return database hash and last updated timestamp.
* @description Quickly return package and database version information.
* @tags Administrative endpoints
* @name HealthcheckHealthcheckGet
* @summary Healthcheck
Expand Down
16 changes: 8 additions & 8 deletions sdk/Server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import {
GetServerPricesServerVendorServerPricesGetParams,
GetServerServerVendorServerGetData,
GetServerServerVendorServerGetParams,
GetSimilarServersServerVendorServerSimilarServersByNGetData,
GetSimilarServersServerVendorServerSimilarServersByNGetParams,
GetSimilarServersServerVendorServerSimilarServersByNumGetData,
GetSimilarServersServerVendorServerSimilarServersByNumGetParams,
HTTPValidationError,
} from "./data-contracts";
import { HttpClient, RequestParams } from "./http-client";
Expand Down Expand Up @@ -52,16 +52,16 @@ export class Server<SecurityDataType = unknown> {
* @description Search similar servers to the provided one. The "family" method returns all servers from the same family of the same vendor. The "specs" approach will prioritize the number of GPUs, then CPUs, lastly the amount of memory. The "score" method will find the servers with the closest performance using the multi-core SCore.
*
* @tags Server Details
* @name GetSimilarServersServerVendorServerSimilarServersByNGet
* @name GetSimilarServersServerVendorServerSimilarServersByNumGet
* @summary Get Similar Servers
* @request GET:/server/{vendor}/{server}/similar_servers/{by}/{n}
* @request GET:/server/{vendor}/{server}/similar_servers/{by}/{num}
*/
getSimilarServersServerVendorServerSimilarServersByNGet = (
{ vendor, server, by, n, ...query }: GetSimilarServersServerVendorServerSimilarServersByNGetParams,
getSimilarServersServerVendorServerSimilarServersByNumGet = (
{ vendor, server, by, num, ...query }: GetSimilarServersServerVendorServerSimilarServersByNumGetParams,
params: RequestParams = {},
) =>
this.http.request<GetSimilarServersServerVendorServerSimilarServersByNGetData, HTTPValidationError>({
path: `/server/${vendor}/${server}/similar_servers/${by}/${n}`,
this.http.request<GetSimilarServersServerVendorServerSimilarServersByNumGetData, HTTPValidationError>({
path: `/server/${vendor}/${server}/similar_servers/${by}/${num}`,
method: "GET",
query: query,
format: "json",
Expand Down
14 changes: 7 additions & 7 deletions sdk/ServerRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
GetServerBenchmarksServerVendorServerBenchmarksGetData,
GetServerPricesServerVendorServerPricesGetData,
GetServerServerVendorServerGetData,
GetSimilarServersServerVendorServerSimilarServersByNGetData,
GetSimilarServersServerVendorServerSimilarServersByNumGetData,
} from "./data-contracts";

export namespace Server {
Expand Down Expand Up @@ -53,11 +53,11 @@ export namespace Server {
/**
* @description Search similar servers to the provided one. The "family" method returns all servers from the same family of the same vendor. The "specs" approach will prioritize the number of GPUs, then CPUs, lastly the amount of memory. The "score" method will find the servers with the closest performance using the multi-core SCore.
* @tags Server Details
* @name GetSimilarServersServerVendorServerSimilarServersByNGet
* @name GetSimilarServersServerVendorServerSimilarServersByNumGet
* @summary Get Similar Servers
* @request GET:/server/{vendor}/{server}/similar_servers/{by}/{n}
* @request GET:/server/{vendor}/{server}/similar_servers/{by}/{num}
*/
export namespace GetSimilarServersServerVendorServerSimilarServersByNGet {
export namespace GetSimilarServersServerVendorServerSimilarServersByNumGet {
export type RequestParams = {
/**
* Vendor
Expand All @@ -75,11 +75,11 @@ export namespace Server {
*/
by: "family" | "specs" | "score";
/**
* N
* Num
* Number of servers to get.
* @max 100
*/
n: number;
num: number;
};
export type RequestQuery = {
/**
Expand All @@ -97,7 +97,7 @@ export namespace Server {
};
export type RequestBody = never;
export type RequestHeaders = {};
export type ResponseBody = GetSimilarServersServerVendorServerSimilarServersByNGetData;
export type ResponseBody = GetSimilarServersServerVendorServerSimilarServersByNumGetData;
}

/**
Expand Down
16 changes: 10 additions & 6 deletions sdk/StoragePrices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

import {
HTTPValidationError,
TableStoragePricesStoragePricesGetData,
TableStoragePricesStoragePricesGetParams,
SearchStoragePricesStoragePricesGetData,
SearchStoragePricesStoragePricesGetParams,
} from "./data-contracts";
import { HttpClient, RequestParams } from "./http-client";

Expand All @@ -26,12 +26,16 @@ export class StoragePrices<SecurityDataType = unknown> {
/**
* No description
*
* @name TableStoragePricesStoragePricesGet
* @summary Table Storage Prices
* @tags Query Resources
* @name SearchStoragePricesStoragePricesGet
* @summary Search Storage Prices
* @request GET:/storage_prices
*/
tableStoragePricesStoragePricesGet = (query: TableStoragePricesStoragePricesGetParams, params: RequestParams = {}) =>
this.http.request<TableStoragePricesStoragePricesGetData, HTTPValidationError>({
searchStoragePricesStoragePricesGet = (
query: SearchStoragePricesStoragePricesGetParams,
params: RequestParams = {},
) =>
this.http.request<SearchStoragePricesStoragePricesGetData, HTTPValidationError>({
path: `/storage_prices`,
method: "GET",
query: query,
Expand Down
Loading