From 0605c36f1e8841824413daba5eac1611814ef065 Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Fri, 15 Mar 2024 10:09:21 +0000 Subject: [PATCH] feat: update generated APIs --- .../src/api/container/v1beta1/api.gen.ts | 34 --------------- .../src/api/container/v1beta1/index.gen.ts | 5 --- .../api/container/v1beta1/marshalling.gen.ts | 32 -------------- .../src/api/container/v1beta1/types.gen.ts | 37 ---------------- .../src/api/function/v1beta1/api.gen.ts | 34 --------------- .../src/api/function/v1beta1/index.gen.ts | 5 --- .../api/function/v1beta1/marshalling.gen.ts | 32 -------------- .../src/api/function/v1beta1/types.gen.ts | 42 ------------------- 8 files changed, 221 deletions(-) diff --git a/packages/clients/src/api/container/v1beta1/api.gen.ts b/packages/clients/src/api/container/v1beta1/api.gen.ts index ba3b0c28a..5129c0099 100644 --- a/packages/clients/src/api/container/v1beta1/api.gen.ts +++ b/packages/clients/src/api/container/v1beta1/api.gen.ts @@ -34,7 +34,6 @@ import { unmarshalListContainersResponse, unmarshalListCronsResponse, unmarshalListDomainsResponse, - unmarshalListLogsResponse, unmarshalListNamespacesResponse, unmarshalListTokensResponse, unmarshalListTriggersResponse, @@ -72,8 +71,6 @@ import type { ListCronsResponse, ListDomainsRequest, ListDomainsResponse, - ListLogsRequest, - ListLogsResponse, ListNamespacesRequest, ListNamespacesResponse, ListTokensRequest, @@ -469,37 +466,6 @@ export class API extends ParentAPI { unmarshalCron, ) - protected pageOfListLogs = (request: Readonly) => - this.client.fetch( - { - method: 'GET', - path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam('containerId', request.containerId)}/logs`, - urlParams: urlParams( - ['order_by', request.orderBy], - ['page', request.page], - [ - 'page_size', - request.pageSize ?? this.client.settings.defaultPageSize, - ], - ), - }, - unmarshalListLogsResponse, - ) - - /** - * Deprecated (replaced by - * [Cockpit](https://www.scaleway.com/en/developers/api/cockpit/)). List your - * container logs. Deprecated (replaced by - * [Cockpit](https://www.scaleway.com/en/developers/api/cockpit/)). List the - * logs of the container with the specified ID. - * - * @deprecated - * @param request - The request {@link ListLogsRequest} - * @returns A Promise of ListLogsResponse - */ - listLogs = (request: Readonly) => - enrichForPagination('logs', this.pageOfListLogs, request) - protected pageOfListDomains = (request: Readonly) => this.client.fetch( { diff --git a/packages/clients/src/api/container/v1beta1/index.gen.ts b/packages/clients/src/api/container/v1beta1/index.gen.ts index 2ad548924..bed3bb4d2 100644 --- a/packages/clients/src/api/container/v1beta1/index.gen.ts +++ b/packages/clients/src/api/container/v1beta1/index.gen.ts @@ -44,9 +44,6 @@ export type { ListDomainsRequest, ListDomainsRequestOrderBy, ListDomainsResponse, - ListLogsRequest, - ListLogsRequestOrderBy, - ListLogsResponse, ListNamespacesRequest, ListNamespacesRequestOrderBy, ListNamespacesResponse, @@ -56,8 +53,6 @@ export type { ListTriggersRequest, ListTriggersRequestOrderBy, ListTriggersResponse, - Log, - LogStream, Namespace, NamespaceStatus, Secret, diff --git a/packages/clients/src/api/container/v1beta1/marshalling.gen.ts b/packages/clients/src/api/container/v1beta1/marshalling.gen.ts index 8d3dd9bee..c2ae2a29e 100644 --- a/packages/clients/src/api/container/v1beta1/marshalling.gen.ts +++ b/packages/clients/src/api/container/v1beta1/marshalling.gen.ts @@ -24,11 +24,9 @@ import type { ListContainersResponse, ListCronsResponse, ListDomainsResponse, - ListLogsResponse, ListNamespacesResponse, ListTokensResponse, ListTriggersResponse, - Log, Namespace, Secret, SecretHashedValue, @@ -295,36 +293,6 @@ export const unmarshalListDomainsResponse = ( } as ListDomainsResponse } -const unmarshalLog = (data: unknown): Log => { - if (!isJSONObject(data)) { - throw new TypeError( - `Unmarshalling the type 'Log' failed as data isn't a dictionary.`, - ) - } - - return { - id: data.id, - level: data.level, - message: data.message, - source: data.source, - stream: data.stream, - timestamp: unmarshalDate(data.timestamp), - } as Log -} - -export const unmarshalListLogsResponse = (data: unknown): ListLogsResponse => { - if (!isJSONObject(data)) { - throw new TypeError( - `Unmarshalling the type 'ListLogsResponse' failed as data isn't a dictionary.`, - ) - } - - return { - logs: unmarshalArrayOfObject(data.logs, unmarshalLog), - totalCount: data.total_count, - } as ListLogsResponse -} - export const unmarshalListNamespacesResponse = ( data: unknown, ): ListNamespacesResponse => { diff --git a/packages/clients/src/api/container/v1beta1/types.gen.ts b/packages/clients/src/api/container/v1beta1/types.gen.ts index 41903ef83..b2e3a3e12 100644 --- a/packages/clients/src/api/container/v1beta1/types.gen.ts +++ b/packages/clients/src/api/container/v1beta1/types.gen.ts @@ -52,8 +52,6 @@ export type ListDomainsRequestOrderBy = | 'hostname_asc' | 'hostname_desc' -export type ListLogsRequestOrderBy = 'timestamp_desc' | 'timestamp_asc' - export type ListNamespacesRequestOrderBy = | 'created_at_asc' | 'created_at_desc' @@ -64,8 +62,6 @@ export type ListTokensRequestOrderBy = 'created_at_asc' | 'created_at_desc' export type ListTriggersRequestOrderBy = 'created_at_asc' | 'created_at_desc' -export type LogStream = 'unknown' | 'stdout' | 'stderr' - export type NamespaceStatus = | 'unknown' | 'ready' @@ -255,18 +251,6 @@ export interface Domain { errorMessage?: string } -export interface Log { - message: string - timestamp?: Date - id: string - /** Contains the severity of the log (info, debug, error, ...). */ - level: string - /** Source of the log (core runtime or user code). */ - source: string - /** Can be stdout or stderr. */ - stream: LogStream -} - export interface Namespace { /** UUID of the namespace. */ id: string @@ -736,27 +720,6 @@ export interface ListDomainsResponse { totalCount: number } -export type ListLogsRequest = { - /** - * Region to target. If none is passed will use default region from the - * config. - */ - region?: Region - /** UUID of the container. */ - containerId: string - /** Page number. */ - page?: number - /** Number of logs per page. */ - pageSize?: number - /** Order of the logs. */ - orderBy?: ListLogsRequestOrderBy -} - -export interface ListLogsResponse { - logs: Log[] - totalCount: number -} - export type ListNamespacesRequest = { /** * Region to target. If none is passed will use default region from the diff --git a/packages/clients/src/api/function/v1beta1/api.gen.ts b/packages/clients/src/api/function/v1beta1/api.gen.ts index 32c8aa7b0..ea243fc3f 100644 --- a/packages/clients/src/api/function/v1beta1/api.gen.ts +++ b/packages/clients/src/api/function/v1beta1/api.gen.ts @@ -36,7 +36,6 @@ import { unmarshalListDomainsResponse, unmarshalListFunctionRuntimesResponse, unmarshalListFunctionsResponse, - unmarshalListLogsResponse, unmarshalListNamespacesResponse, unmarshalListTokensResponse, unmarshalListTriggersResponse, @@ -80,8 +79,6 @@ import type { ListFunctionRuntimesResponse, ListFunctionsRequest, ListFunctionsResponse, - ListLogsRequest, - ListLogsResponse, ListNamespacesRequest, ListNamespacesResponse, ListTokensRequest, @@ -532,37 +529,6 @@ export class API extends ParentAPI { unmarshalCron, ) - protected pageOfListLogs = (request: Readonly) => - this.client.fetch( - { - method: 'GET', - path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/functions/${validatePathParam('functionId', request.functionId)}/logs`, - urlParams: urlParams( - ['order_by', request.orderBy], - ['page', request.page], - [ - 'page_size', - request.pageSize ?? this.client.settings.defaultPageSize, - ], - ), - }, - unmarshalListLogsResponse, - ) - - /** - * Deprecated (replaced by - * [Cockpit](https://www.scaleway.com/en/developers/api/cockpit/)). List - * application logs. Deprecated (replaced by - * [Cockpit](https://www.scaleway.com/en/developers/api/cockpit/)). List the - * application logs of the function with the specified ID. - * - * @deprecated - * @param request - The request {@link ListLogsRequest} - * @returns A Promise of ListLogsResponse - */ - listLogs = (request: Readonly) => - enrichForPagination('logs', this.pageOfListLogs, request) - protected pageOfListDomains = (request: Readonly) => this.client.fetch( { diff --git a/packages/clients/src/api/function/v1beta1/index.gen.ts b/packages/clients/src/api/function/v1beta1/index.gen.ts index 117c9b786..2f6000812 100644 --- a/packages/clients/src/api/function/v1beta1/index.gen.ts +++ b/packages/clients/src/api/function/v1beta1/index.gen.ts @@ -49,9 +49,6 @@ export type { ListFunctionsRequest, ListFunctionsRequestOrderBy, ListFunctionsResponse, - ListLogsRequest, - ListLogsRequestOrderBy, - ListLogsResponse, ListNamespacesRequest, ListNamespacesRequestOrderBy, ListNamespacesResponse, @@ -61,8 +58,6 @@ export type { ListTriggersRequest, ListTriggersRequestOrderBy, ListTriggersResponse, - Log, - LogStream, Namespace, NamespaceStatus, Runtime, diff --git a/packages/clients/src/api/function/v1beta1/marshalling.gen.ts b/packages/clients/src/api/function/v1beta1/marshalling.gen.ts index 09cbfd6ae..edc50d854 100644 --- a/packages/clients/src/api/function/v1beta1/marshalling.gen.ts +++ b/packages/clients/src/api/function/v1beta1/marshalling.gen.ts @@ -26,11 +26,9 @@ import type { ListDomainsResponse, ListFunctionRuntimesResponse, ListFunctionsResponse, - ListLogsResponse, ListNamespacesResponse, ListTokensResponse, ListTriggersResponse, - Log, Namespace, Runtime, Secret, @@ -348,36 +346,6 @@ export const unmarshalListFunctionsResponse = ( } as ListFunctionsResponse } -const unmarshalLog = (data: unknown): Log => { - if (!isJSONObject(data)) { - throw new TypeError( - `Unmarshalling the type 'Log' failed as data isn't a dictionary.`, - ) - } - - return { - id: data.id, - level: data.level, - message: data.message, - source: data.source, - stream: data.stream, - timestamp: unmarshalDate(data.timestamp), - } as Log -} - -export const unmarshalListLogsResponse = (data: unknown): ListLogsResponse => { - if (!isJSONObject(data)) { - throw new TypeError( - `Unmarshalling the type 'ListLogsResponse' failed as data isn't a dictionary.`, - ) - } - - return { - logs: unmarshalArrayOfObject(data.logs, unmarshalLog), - totalCount: data.total_count, - } as ListLogsResponse -} - export const unmarshalListNamespacesResponse = ( data: unknown, ): ListNamespacesResponse => { diff --git a/packages/clients/src/api/function/v1beta1/types.gen.ts b/packages/clients/src/api/function/v1beta1/types.gen.ts index 95015e380..a6ab271a9 100644 --- a/packages/clients/src/api/function/v1beta1/types.gen.ts +++ b/packages/clients/src/api/function/v1beta1/types.gen.ts @@ -77,8 +77,6 @@ export type ListFunctionsRequestOrderBy = | 'name_asc' | 'name_desc' -export type ListLogsRequestOrderBy = 'timestamp_desc' | 'timestamp_asc' - export type ListNamespacesRequestOrderBy = | 'created_at_asc' | 'created_at_desc' @@ -89,8 +87,6 @@ export type ListTokensRequestOrderBy = 'created_at_asc' | 'created_at_desc' export type ListTriggersRequestOrderBy = 'created_at_asc' | 'created_at_desc' -export type LogStream = 'unknown' | 'stdout' | 'stderr' - export type NamespaceStatus = | 'unknown' | 'ready' @@ -297,21 +293,6 @@ export interface Function { runtimeMessage: string } -export interface Log { - /** Message of the log. */ - message: string - /** Timestamp of the log. */ - timestamp?: Date - /** UUID of the log. */ - id: string - /** Severity of the log (info, debug, error etc.). */ - level: string - /** Source of the log (core runtime or user code). */ - source: string - /** Can be stdout or stderr. */ - stream: LogStream -} - export interface Namespace { /** UUID of the namespace. */ id: string @@ -812,29 +793,6 @@ export interface ListFunctionsResponse { totalCount: number } -export type ListLogsRequest = { - /** - * Region to target. If none is passed will use default region from the - * config. - */ - region?: Region - /** UUID of the function to get the logs for. */ - functionId: string - /** Page number. */ - page?: number - /** Number of logs per page. */ - pageSize?: number - /** Order of the logs. */ - orderBy?: ListLogsRequestOrderBy -} - -export interface ListLogsResponse { - /** Array of logs. */ - logs: Log[] - /** Total number of logs. */ - totalCount: number -} - export type ListNamespacesRequest = { /** * Region to target. If none is passed will use default region from the