Skip to content
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
34 changes: 0 additions & 34 deletions packages/clients/src/api/container/v1beta1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import {
unmarshalListContainersResponse,
unmarshalListCronsResponse,
unmarshalListDomainsResponse,
unmarshalListLogsResponse,
unmarshalListNamespacesResponse,
unmarshalListTokensResponse,
unmarshalListTriggersResponse,
Expand Down Expand Up @@ -72,8 +71,6 @@ import type {
ListCronsResponse,
ListDomainsRequest,
ListDomainsResponse,
ListLogsRequest,
ListLogsResponse,
ListNamespacesRequest,
ListNamespacesResponse,
ListTokensRequest,
Expand Down Expand Up @@ -469,37 +466,6 @@ export class API extends ParentAPI {
unmarshalCron,
)

protected pageOfListLogs = (request: Readonly<ListLogsRequest>) =>
this.client.fetch<ListLogsResponse>(
{
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<ListLogsRequest>) =>
enrichForPagination('logs', this.pageOfListLogs, request)

protected pageOfListDomains = (request: Readonly<ListDomainsRequest>) =>
this.client.fetch<ListDomainsResponse>(
{
Expand Down
5 changes: 0 additions & 5 deletions packages/clients/src/api/container/v1beta1/index.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ export type {
ListDomainsRequest,
ListDomainsRequestOrderBy,
ListDomainsResponse,
ListLogsRequest,
ListLogsRequestOrderBy,
ListLogsResponse,
ListNamespacesRequest,
ListNamespacesRequestOrderBy,
ListNamespacesResponse,
Expand All @@ -56,8 +53,6 @@ export type {
ListTriggersRequest,
ListTriggersRequestOrderBy,
ListTriggersResponse,
Log,
LogStream,
Namespace,
NamespaceStatus,
Secret,
Expand Down
32 changes: 0 additions & 32 deletions packages/clients/src/api/container/v1beta1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,9 @@ import type {
ListContainersResponse,
ListCronsResponse,
ListDomainsResponse,
ListLogsResponse,
ListNamespacesResponse,
ListTokensResponse,
ListTriggersResponse,
Log,
Namespace,
Secret,
SecretHashedValue,
Expand Down Expand Up @@ -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 => {
Expand Down
37 changes: 0 additions & 37 deletions packages/clients/src/api/container/v1beta1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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'
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
34 changes: 0 additions & 34 deletions packages/clients/src/api/function/v1beta1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import {
unmarshalListDomainsResponse,
unmarshalListFunctionRuntimesResponse,
unmarshalListFunctionsResponse,
unmarshalListLogsResponse,
unmarshalListNamespacesResponse,
unmarshalListTokensResponse,
unmarshalListTriggersResponse,
Expand Down Expand Up @@ -80,8 +79,6 @@ import type {
ListFunctionRuntimesResponse,
ListFunctionsRequest,
ListFunctionsResponse,
ListLogsRequest,
ListLogsResponse,
ListNamespacesRequest,
ListNamespacesResponse,
ListTokensRequest,
Expand Down Expand Up @@ -532,37 +529,6 @@ export class API extends ParentAPI {
unmarshalCron,
)

protected pageOfListLogs = (request: Readonly<ListLogsRequest>) =>
this.client.fetch<ListLogsResponse>(
{
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<ListLogsRequest>) =>
enrichForPagination('logs', this.pageOfListLogs, request)

protected pageOfListDomains = (request: Readonly<ListDomainsRequest>) =>
this.client.fetch<ListDomainsResponse>(
{
Expand Down
5 changes: 0 additions & 5 deletions packages/clients/src/api/function/v1beta1/index.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ export type {
ListFunctionsRequest,
ListFunctionsRequestOrderBy,
ListFunctionsResponse,
ListLogsRequest,
ListLogsRequestOrderBy,
ListLogsResponse,
ListNamespacesRequest,
ListNamespacesRequestOrderBy,
ListNamespacesResponse,
Expand All @@ -61,8 +58,6 @@ export type {
ListTriggersRequest,
ListTriggersRequestOrderBy,
ListTriggersResponse,
Log,
LogStream,
Namespace,
NamespaceStatus,
Runtime,
Expand Down
32 changes: 0 additions & 32 deletions packages/clients/src/api/function/v1beta1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ import type {
ListDomainsResponse,
ListFunctionRuntimesResponse,
ListFunctionsResponse,
ListLogsResponse,
ListNamespacesResponse,
ListTokensResponse,
ListTriggersResponse,
Log,
Namespace,
Runtime,
Secret,
Expand Down Expand Up @@ -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 => {
Expand Down
42 changes: 0 additions & 42 deletions packages/clients/src/api/function/v1beta1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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'
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down