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
2 changes: 1 addition & 1 deletion packages/clients/src/api/account/v2alpha1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export type ListSSHKeysRequestOrderBy =

/** List ssh keys response */
export interface ListSSHKeysResponse {
sshKeys: Array<SSHKey>
sshKeys: SSHKey[]
totalCount: number
}

Expand Down
6 changes: 3 additions & 3 deletions packages/clients/src/helpers/marshalling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@ export const unmarshalArrayOfObject = <T, B extends boolean>(
data: unknown,
unmarshaller: (input: unknown) => T,
emptyFallback: B = true as B,
): B extends true ? Array<T> | undefined : Array<T> => {
): B extends true ? T[] | undefined : T[] => {
if (!Array.isArray(data)) {
return (emptyFallback ? [] : undefined) as B extends true
? Array<T> | undefined
: Array<T>
? T[] | undefined
: T[]
}

return data.map(elt => unmarshaller(elt))
Expand Down
2 changes: 1 addition & 1 deletion packages/clients/src/scw/custom-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export interface TimeSeries {
/** Name of the metric. */
name: string
/** Points contains all the points that composed the series. */
points: Array<TimeSeriesPoint>
points: TimeSeriesPoint[]
/** Metadata contains some string metadata related to a metric. */
metadata: Record<string, string>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export type InvalidArgumentsErrorDetails = {
*
* @internal
*/
const buildMessage = (list: Array<InvalidArgumentsErrorDetails>): string => {
const buildMessage = (list: InvalidArgumentsErrorDetails[]): string => {
const invalidArgs: string[] = list.reduce<string[]>((acc, details) => {
let readableReason = ''
switch (details.reason) {
Expand Down Expand Up @@ -58,7 +58,7 @@ export class InvalidArgumentsError extends ScalewayError {
constructor(
readonly status: number,
readonly body: JSONObject,
readonly details: Array<InvalidArgumentsErrorDetails>,
readonly details: InvalidArgumentsErrorDetails[],
) {
super(status, body, buildMessage(details))
this.name = 'InvalidArgumentsError'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export type PermissionsDeniedErrorDetails = {
*
* @internal
*/
const buildMessage = (list: Array<PermissionsDeniedErrorDetails>): string =>
const buildMessage = (list: PermissionsDeniedErrorDetails[]): string =>
`insufficient permissions: ${list
.map(({ action, resource }) => `${action} ${resource}`)
.join('; ')}`
Expand All @@ -34,7 +34,7 @@ export class PermissionsDeniedError extends ScalewayError {
constructor(
readonly status: number,
readonly body: JSONObject,
readonly list: Array<PermissionsDeniedErrorDetails>,
readonly list: PermissionsDeniedErrorDetails[],
) {
super(status, body, buildMessage(list))
this.name = 'PermissionsDeniedError'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export type QuotasExceededErrorDetails = {
*
* @internal
*/
const buildMessage = (list: Array<QuotasExceededErrorDetails>): string =>
const buildMessage = (list: QuotasExceededErrorDetails[]): string =>
`quota exceeded(s): ${list
.map(details => {
const message = `${details.resource} has reached its quota (${details.current}/${details.quota})`
Expand Down Expand Up @@ -68,7 +68,7 @@ export class QuotasExceededError extends ScalewayError {
constructor(
readonly status: number,
readonly body: JSONObject,
readonly list: Array<QuotasExceededErrorDetails>,
readonly list: QuotasExceededErrorDetails[],
) {
super(status, body, buildMessage(list))
this.name = 'QuotasExceededError'
Expand Down