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 .github/workflows/deploy-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- run: echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: pnpm lerna publish -y --create-release github
- run: pnpm lerna publish -y --bump major --create-release github
env:
HUSKY: 0
GH_TOKEN: ${{ secrets.GH_TOKEN }}
2 changes: 1 addition & 1 deletion packages/clients/src/api/account/v2/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class API extends ParentAPI {
path: `/account/v2/projects`,
urlParams: urlParams(
['name', request.name],
['order_by', request.orderBy ?? 'created_at_asc'],
['order_by', request.orderBy],
[
'organization_id',
request.organizationId ??
Expand Down
6 changes: 4 additions & 2 deletions packages/clients/src/api/account/v2/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type {
UpdateProjectRequest,
} from './types.gen'

export const unmarshalProject = (data: unknown) => {
export const unmarshalProject = (data: unknown): Project => {
if (!isJSONObject(data)) {
throw new TypeError(
`Unmarshalling the type 'Project' failed as data isn't a dictionary.`,
Expand All @@ -31,7 +31,9 @@ export const unmarshalProject = (data: unknown) => {
} as Project
}

export const unmarshalListProjectsResponse = (data: unknown) => {
export const unmarshalListProjectsResponse = (
data: unknown,
): ListProjectsResponse => {
if (!isJSONObject(data)) {
throw new TypeError(
`Unmarshalling the type 'ListProjectsResponse' failed as data isn't a dictionary.`,
Expand Down
32 changes: 15 additions & 17 deletions packages/clients/src/api/account/v2/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,6 @@ export type ListProjectsRequestOrderBy =
| 'name_asc'
| 'name_desc'

/** List projects response. */
export interface ListProjectsResponse {
/** Total number of Projects. */
totalCount: number
/** Paginated returned Projects. */
projects: Project[]
}

/** Project. */
export interface Project {
/** ID of the Project. */
id: string
Expand All @@ -40,6 +31,16 @@ export type CreateProjectRequest = {
description?: string
}

export type DeleteProjectRequest = {
/** Project ID of the Project. */
projectId?: string
}

export type GetProjectRequest = {
/** Project ID of the Project. */
projectId?: string
}

export type ListProjectsRequest = {
/** Organization ID of the Project. */
organizationId?: string
Expand All @@ -58,14 +59,11 @@ export type ListProjectsRequest = {
projectIds?: string[]
}

export type GetProjectRequest = {
/** Project ID of the Project. */
projectId?: string
}

export type DeleteProjectRequest = {
/** Project ID of the Project. */
projectId?: string
export interface ListProjectsResponse {
/** Total number of Projects. */
totalCount: number
/** Paginated returned Projects. */
projects: Project[]
}

export type UpdateProjectRequest = {
Expand Down
2 changes: 1 addition & 1 deletion packages/clients/src/api/account/v3/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class ProjectAPI extends ParentAPI {
path: `/account/v3/projects`,
urlParams: urlParams(
['name', request.name],
['order_by', request.orderBy ?? 'created_at_asc'],
['order_by', request.orderBy],
[
'organization_id',
request.organizationId ??
Expand Down
6 changes: 4 additions & 2 deletions packages/clients/src/api/account/v3/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type {
ProjectApiUpdateProjectRequest,
} from './types.gen'

export const unmarshalProject = (data: unknown) => {
export const unmarshalProject = (data: unknown): Project => {
if (!isJSONObject(data)) {
throw new TypeError(
`Unmarshalling the type 'Project' failed as data isn't a dictionary.`,
Expand All @@ -31,7 +31,9 @@ export const unmarshalProject = (data: unknown) => {
} as Project
}

export const unmarshalListProjectsResponse = (data: unknown) => {
export const unmarshalListProjectsResponse = (
data: unknown,
): ListProjectsResponse => {
if (!isJSONObject(data)) {
throw new TypeError(
`Unmarshalling the type 'ListProjectsResponse' failed as data isn't a dictionary.`,
Expand Down
36 changes: 17 additions & 19 deletions packages/clients/src/api/account/v3/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,6 @@ export type ListProjectsRequestOrderBy =
| 'name_asc'
| 'name_desc'

/** List projects response. */
export interface ListProjectsResponse {
/** Total number of Projects. */
totalCount: number
/** Paginated returned Projects. */
projects: Project[]
}

/** Project. */
export interface Project {
/** ID of the Project. */
id: string
Expand All @@ -31,6 +22,13 @@ export interface Project {
description: string
}

export interface ListProjectsResponse {
/** Total number of Projects. */
totalCount: number
/** Paginated returned Projects. */
projects: Project[]
}

export type ProjectApiCreateProjectRequest = {
/** Name of the Project. */
name?: string
Expand All @@ -40,6 +38,16 @@ export type ProjectApiCreateProjectRequest = {
description: string
}

export type ProjectApiDeleteProjectRequest = {
/** Project ID of the Project. */
projectId?: string
}

export type ProjectApiGetProjectRequest = {
/** Project ID of the Project. */
projectId?: string
}

export type ProjectApiListProjectsRequest = {
/** Organization ID of the Project. */
organizationId?: string
Expand All @@ -58,16 +66,6 @@ export type ProjectApiListProjectsRequest = {
projectIds?: string[]
}

export type ProjectApiGetProjectRequest = {
/** Project ID of the Project. */
projectId?: string
}

export type ProjectApiDeleteProjectRequest = {
/** Project ID of the Project. */
projectId?: string
}

export type ProjectApiUpdateProjectRequest = {
/** Project ID of the Project. */
projectId?: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export class API extends ParentAPI {
request.zone ?? this.client.settings.defaultZone,
)}/servers`,
urlParams: urlParams(
['order_by', request.orderBy ?? 'created_at_asc'],
['order_by', request.orderBy],
['organization_id', request.organizationId],
['page', request.page],
[
Expand Down
81 changes: 47 additions & 34 deletions packages/clients/src/api/applesilicon/v1alpha1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,53 +21,79 @@ import type {
UpdateServerRequest,
} from './types.gen'

const unmarshalServerTypeCPU = (data: unknown) => {
export const unmarshalOS = (data: unknown): OS => {
if (!isJSONObject(data)) {
throw new TypeError(
`Unmarshalling the type 'OS' failed as data isn't a dictionary.`,
)
}

return {
compatibleServerTypes: data.compatible_server_types,
id: data.id,
imageUrl: data.image_url,
label: data.label,
name: data.name,
} as OS
}

const unmarshalServerTypeCPU = (data: unknown): ServerTypeCPU => {
if (!isJSONObject(data)) {
throw new TypeError(
`Unmarshalling the type 'ServerTypeCPU' failed as data isn't a dictionary.`,
)
}

return { coreCount: data.core_count, name: data.name } as ServerTypeCPU
return {
coreCount: data.core_count,
name: data.name,
} as ServerTypeCPU
}

const unmarshalServerTypeDisk = (data: unknown) => {
const unmarshalServerTypeDisk = (data: unknown): ServerTypeDisk => {
if (!isJSONObject(data)) {
throw new TypeError(
`Unmarshalling the type 'ServerTypeDisk' failed as data isn't a dictionary.`,
)
}

return { capacity: data.capacity, type: data.type } as ServerTypeDisk
return {
capacity: data.capacity,
type: data.type,
} as ServerTypeDisk
}

const unmarshalServerTypeMemory = (data: unknown) => {
const unmarshalServerTypeMemory = (data: unknown): ServerTypeMemory => {
if (!isJSONObject(data)) {
throw new TypeError(
`Unmarshalling the type 'ServerTypeMemory' failed as data isn't a dictionary.`,
)
}

return { capacity: data.capacity, type: data.type } as ServerTypeMemory
return {
capacity: data.capacity,
type: data.type,
} as ServerTypeMemory
}

export const unmarshalOS = (data: unknown) => {
export const unmarshalServerType = (data: unknown): ServerType => {
if (!isJSONObject(data)) {
throw new TypeError(
`Unmarshalling the type 'OS' failed as data isn't a dictionary.`,
`Unmarshalling the type 'ServerType' failed as data isn't a dictionary.`,
)
}

return {
compatibleServerTypes: data.compatible_server_types,
id: data.id,
imageUrl: data.image_url,
label: data.label,
cpu: data.cpu ? unmarshalServerTypeCPU(data.cpu) : undefined,
disk: data.disk ? unmarshalServerTypeDisk(data.disk) : undefined,
memory: data.memory ? unmarshalServerTypeMemory(data.memory) : undefined,
minimumLeaseDuration: data.minimum_lease_duration,
name: data.name,
} as OS
stock: data.stock,
} as ServerType
}

export const unmarshalServer = (data: unknown) => {
export const unmarshalServer = (data: unknown): Server => {
if (!isJSONObject(data)) {
throw new TypeError(
`Unmarshalling the type 'Server' failed as data isn't a dictionary.`,
Expand All @@ -90,24 +116,7 @@ export const unmarshalServer = (data: unknown) => {
} as Server
}

export const unmarshalServerType = (data: unknown) => {
if (!isJSONObject(data)) {
throw new TypeError(
`Unmarshalling the type 'ServerType' failed as data isn't a dictionary.`,
)
}

return {
cpu: data.cpu ? unmarshalServerTypeCPU(data.cpu) : undefined,
disk: data.disk ? unmarshalServerTypeDisk(data.disk) : undefined,
memory: data.memory ? unmarshalServerTypeMemory(data.memory) : undefined,
minimumLeaseDuration: data.minimum_lease_duration,
name: data.name,
stock: data.stock,
} as ServerType
}

export const unmarshalListOSResponse = (data: unknown) => {
export const unmarshalListOSResponse = (data: unknown): ListOSResponse => {
if (!isJSONObject(data)) {
throw new TypeError(
`Unmarshalling the type 'ListOSResponse' failed as data isn't a dictionary.`,
Expand All @@ -120,7 +129,9 @@ export const unmarshalListOSResponse = (data: unknown) => {
} as ListOSResponse
}

export const unmarshalListServerTypesResponse = (data: unknown) => {
export const unmarshalListServerTypesResponse = (
data: unknown,
): ListServerTypesResponse => {
if (!isJSONObject(data)) {
throw new TypeError(
`Unmarshalling the type 'ListServerTypesResponse' failed as data isn't a dictionary.`,
Expand All @@ -132,7 +143,9 @@ export const unmarshalListServerTypesResponse = (data: unknown) => {
} as ListServerTypesResponse
}

export const unmarshalListServersResponse = (data: unknown) => {
export const unmarshalListServersResponse = (
data: unknown,
): ListServersResponse => {
if (!isJSONObject(data)) {
throw new TypeError(
`Unmarshalling the type 'ListServersResponse' failed as data isn't a dictionary.`,
Expand Down
Loading