diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 93d7a1e..04fb4ce 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -- @diogopms @skirsten @philipkrueck +* @diogopms @skirsten @philipkrueck diff --git a/.nvmrc b/.nvmrc deleted file mode 100644 index 209e3ef..0000000 --- a/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -20 diff --git a/package.json b/package.json index 06c4893..83f5e59 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@genesiscloud/genesiscloud-js", - "version": "1.0.2", + "version": "1.0.3", "description": "JavaScript client for the Genesis Cloud API", "main": "dist/index.js", "type": "commonjs", @@ -23,5 +23,9 @@ "prettier": "^3.2.5", "typescript": "^5.4.5", "yaml": "^2.4.1" - } + }, + "engines": { + "node": "^22" + }, + "packageManager": "pnpm@9.12.0+sha512.4abf725084d7bcbafbd728bfc7bee61f2f791f977fd87542b3579dcb23504d170d46337945e4c66485cd12d588a0c0e570ed9c477e7ccdd8507cf05f3f92eaca" } diff --git a/src/schemas.gen.ts b/src/schemas.gen.ts index 746c758..b50a7d4 100644 --- a/src/schemas.gen.ts +++ b/src/schemas.gen.ts @@ -316,13 +316,17 @@ export const $Filesystem_Status = { enum: ["creating", "created", "deleting"], } as const; +export const $SecurityGroupId = { + type: "string", + description: `A unique identifier for each security group. This is automatically generated. +`, +} as const; + export const $SecurityGroup = { type: "object", properties: { id: { - type: "string", - description: `A unique identifier for each security group. This is automatically generated. -`, + $ref: "#/components/schemas/SecurityGroupId", }, name: { type: "string", @@ -508,7 +512,7 @@ export const $Instance = { type: "object", properties: { id: { - $ref: "#/components/schemas/Instance.SecurityGroupId", + $ref: "#/components/schemas/SecurityGroupId", }, name: { type: "string", @@ -600,26 +604,9 @@ export const $Instance_SSHKeyId = { description: "The ssh key ID.", } as const; -export const $Instance_SecurityGroupIds = { - type: "array", - description: `An array of security group ids. -**Please Note**: By default the **standard security group** is set if you don"t specify any Security Groups. -You can override this behavior by providing a different Security Group. -`, - minItems: 1, - items: { - $ref: "#/components/schemas/Instance.SecurityGroupId", - }, -} as const; - -export const $Instance_SecurityGroupId = { - type: "string", - description: "The security group ID.", -} as const; - export const $Instance_DiskSize = { type: "integer", - description: `The storage size of the instance's boot volume given in GiB (Min: 80GiB). + description: `The storage size of the instance's boot volume given in GiB. `, } as const; @@ -724,6 +711,90 @@ If not provided, the billing_type will default to on-demand. `, } as const; +export const $Instance_UpdateSecurityGroups = { + oneOf: [ + { + $ref: "#/components/schemas/Instance.UpdateSecurityGroups.List", + }, + { + $ref: "#/components/schemas/Instance.UpdateSecurityGroups.Attach", + }, + { + $ref: "#/components/schemas/Instance.UpdateSecurityGroups.Detach", + }, + ], +} as const; + +export const $Instance_UpdateSecurityGroups_List = { + type: "array", + description: "The instance's security group IDs.", + items: { + $ref: "#/components/schemas/SecurityGroupId", + }, +} as const; + +export const $Instance_UpdateSecurityGroups_Attach = { + type: "object", + properties: { + attach: { + $ref: "#/components/schemas/SecurityGroupId", + }, + }, + required: ["attach"], +} as const; + +export const $Instance_UpdateSecurityGroups_Detach = { + type: "object", + properties: { + detach: { + $ref: "#/components/schemas/SecurityGroupId", + }, + }, + required: ["detach"], +} as const; + +export const $Instance_UpdateVolumes = { + oneOf: [ + { + $ref: "#/components/schemas/Instance.UpdateVolumes.List", + }, + { + $ref: "#/components/schemas/Instance.UpdateVolumes.Attach", + }, + { + $ref: "#/components/schemas/Instance.UpdateVolumes.Detach", + }, + ], +} as const; + +export const $Instance_UpdateVolumes_List = { + type: "array", + description: "The instance's volume IDs.", + items: { + $ref: "#/components/schemas/VolumeId", + }, +} as const; + +export const $Instance_UpdateVolumes_Attach = { + type: "object", + properties: { + attach: { + $ref: "#/components/schemas/VolumeId", + }, + }, + required: ["attach"], +} as const; + +export const $Instance_UpdateVolumes_Detach = { + type: "object", + properties: { + detach: { + $ref: "#/components/schemas/VolumeId", + }, + }, + required: ["detach"], +} as const; + export const $SSHKey = { type: "object", properties: { diff --git a/src/types.gen.ts b/src/types.gen.ts index d0640b5..36959fc 100644 --- a/src/types.gen.ts +++ b/src/types.gen.ts @@ -171,12 +171,14 @@ export type Filesystem = { export type Filesystem_Status = "creating" | "created" | "deleting"; +/** + * A unique identifier for each security group. This is automatically generated. + * + */ +export type SecurityGroupId = string; + export type SecurityGroup = { - /** - * A unique identifier for each security group. This is automatically generated. - * - */ - id: string; + id: SecurityGroupId; /** * The human-readable name for the security group. * @@ -288,7 +290,7 @@ export type Instance = { * The security groups of the instance. */ security_groups: Array<{ - id: Instance_SecurityGroupId; + id: SecurityGroupId; /** * The name of the security group. */ @@ -341,20 +343,7 @@ export type ImageId = string; export type Instance_SSHKeyId = string; /** - * An array of security group ids. - * **Please Note**: By default the **standard security group** is set if you don"t specify any Security Groups. - * You can override this behavior by providing a different Security Group. - * - */ -export type Instance_SecurityGroupIds = Array; - -/** - * The security group ID. - */ -export type Instance_SecurityGroupId = string; - -/** - * The storage size of the instance's boot volume given in GiB (Min: 80GiB). + * The storage size of the instance's boot volume given in GiB. * */ export type Instance_DiskSize = number; @@ -436,6 +425,42 @@ export type Instance_BillingType = */ export type Instance_ReuseLongTermSubscription = string; +export type Instance_UpdateSecurityGroups = + | Instance_UpdateSecurityGroups_List + | Instance_UpdateSecurityGroups_Attach + | Instance_UpdateSecurityGroups_Detach; + +/** + * The instance's security group IDs. + */ +export type Instance_UpdateSecurityGroups_List = Array; + +export type Instance_UpdateSecurityGroups_Attach = { + attach: SecurityGroupId; +}; + +export type Instance_UpdateSecurityGroups_Detach = { + detach: SecurityGroupId; +}; + +export type Instance_UpdateVolumes = + | Instance_UpdateVolumes_List + | Instance_UpdateVolumes_Attach + | Instance_UpdateVolumes_Detach; + +/** + * The instance's volume IDs. + */ +export type Instance_UpdateVolumes_List = Array; + +export type Instance_UpdateVolumes_Attach = { + attach: VolumeId; +}; + +export type Instance_UpdateVolumes_Detach = { + detach: VolumeId; +}; + export type SSHKey = { /** * A unique identifier for each SSH key. This is automatically generated. @@ -636,7 +661,7 @@ export type $OpenApiTs = { */ name: string; /** - * The storage size of this snapshot given in GiB (Min: 1GiB). + * The storage size of this snapshot given in GiB (min: 1GiB). * */ size: number; @@ -738,7 +763,7 @@ export type $OpenApiTs = { description?: string; type?: VolumeType; /** - * The storage size of this volume given in GiB (Min: 1GiB). + * The storage size of this volume given in GiB (min: 1GiB). * */ size: number; @@ -797,6 +822,11 @@ export type $OpenApiTs = { * The human-readable description set for the volume. */ description?: string; + /** + * The storage size of this volume given in GiB (min: previous size). + * + */ + size?: number; }; volumeId: string; }; @@ -837,7 +867,7 @@ export type $OpenApiTs = { description?: string; type?: FilesystemType; /** - * The storage size of this filesystem given in GiB (Min: 1GiB). + * The storage size of this filesystem given in GiB (min: 1GiB). * */ size: number; @@ -898,7 +928,8 @@ export type $OpenApiTs = { */ description?: string; /** - * The storage size of this filesystem given in GiB. + * The storage size of this filesystem given in GiB (min: previous size). + * */ size?: number; }; @@ -1060,6 +1091,11 @@ export type $OpenApiTs = { * */ ssh_keys?: Array; + /** + * An array of security group ids. + * + */ + security_groups?: Array; /** * An array of volume ids. * @@ -1078,7 +1114,6 @@ export type $OpenApiTs = { * */ placement_option?: string; - security_groups?: Instance_SecurityGroupIds; is_protected?: Instance_IsProtected; destroy_on_shutdown?: Instance_DestroyOnShutdown; public_ipv6?: Instance_PublicIpv6; @@ -1148,11 +1183,8 @@ export type $OpenApiTs = { * */ reservation_id?: string; - security_groups?: Instance_SecurityGroupIds; - /** - * The instance's volumes IDs. - */ - volumes?: Array; + security_groups?: Instance_UpdateSecurityGroups; + volumes?: Instance_UpdateVolumes; disk_size?: Instance_DiskSize; }; };