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 .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0-alpha.24"
".": "0.1.0-alpha.25"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 13
configured_endpoints: 15
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/the-san-francisco-compute-company%2Fsfc-nodes-c9d6d56eabd56a40a29dc2639a77d22dd5394ecd3ec9aeaebb3a3977811571da.yml
openapi_spec_hash: beda3f45c48679e14d6fe8bbe7003d51
config_hash: cf202573c712b5d91a4d496f35f0ff57
config_hash: a187153315a646ecf95709ee4a223df5
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.1.0-alpha.25 (2025-12-01)

Full Changelog: [v0.1.0-alpha.24...v0.1.0-alpha.25](https://github.com/sfcompute/nodes-typescript/compare/v0.1.0-alpha.24...v0.1.0-alpha.25)

### Features

* **api:** add .zones SDK methods ([b48f535](https://github.com/sfcompute/nodes-typescript/commit/b48f5352e10deb94d20a316e83db724226539524))

## 0.1.0-alpha.24 (2025-11-22)

Full Changelog: [v0.1.0-alpha.23...v0.1.0-alpha.24](https://github.com/sfcompute/nodes-typescript/compare/v0.1.0-alpha.23...v0.1.0-alpha.24)
Expand Down
12 changes: 12 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,15 @@ Methods:
- <code title="get /v1/nodes/{id}">client.nodes.<a href="./src/resources/nodes.ts">get</a>(id) -> Node</code>
- <code title="put /v1/nodes/{id}/redeploy">client.nodes.<a href="./src/resources/nodes.ts">redeploy</a>(id, { ...params }) -> Node</code>
- <code title="patch /v1/nodes/{id}/release">client.nodes.<a href="./src/resources/nodes.ts">release</a>(id) -> Node</code>

# Zones

Types:

- <code><a href="./src/resources/zones.ts">ZoneListResponse</a></code>
- <code><a href="./src/resources/zones.ts">ZoneGetResponse</a></code>

Methods:

- <code title="get /v0/zones">client.zones.<a href="./src/resources/zones.ts">list</a>() -> ZoneListResponse</code>
- <code title="get /v0/zones/{id}">client.zones.<a href="./src/resources/zones.ts">get</a>(id) -> ZoneGetResponse</code>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sfcompute/nodes-sdk-alpha",
"version": "0.1.0-alpha.24",
"version": "0.1.0-alpha.25",
"description": "The official TypeScript library for the SFC Nodes API",
"author": "SFC Nodes <hello@sfcompute.com>",
"types": "dist/index.d.ts",
Expand Down
9 changes: 9 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import {
Nodes,
Status,
} from './resources/nodes';
import { ZoneGetResponse, ZoneListResponse, Zones } from './resources/zones';
import { VMLogsParams, VMLogsResponse, VMSSHParams, VMSSHResponse, VMs } from './resources/vms/vms';
import { type Fetch } from './internal/builtin-types';
import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers';
Expand Down Expand Up @@ -725,10 +726,12 @@ export class SFCNodes {

vms: API.VMs = new API.VMs(this);
nodes: API.Nodes = new API.Nodes(this);
zones: API.Zones = new API.Zones(this);
}

SFCNodes.VMs = VMs;
SFCNodes.Nodes = Nodes;
SFCNodes.Zones = Zones;

export declare namespace SFCNodes {
export type RequestOptions = Opts.RequestOptions;
Expand Down Expand Up @@ -759,4 +762,10 @@ export declare namespace SFCNodes {
type NodeExtendParams as NodeExtendParams,
type NodeRedeployParams as NodeRedeployParams,
};

export {
Zones as Zones,
type ZoneListResponse as ZoneListResponse,
type ZoneGetResponse as ZoneGetResponse,
};
}
1 change: 1 addition & 0 deletions src/resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ export {
type NodeRedeployParams,
} from './nodes';
export { VMs, type VMLogsResponse, type VMSSHResponse, type VMLogsParams, type VMSSHParams } from './vms/vms';
export { Zones, type ZoneListResponse, type ZoneGetResponse } from './zones';
113 changes: 113 additions & 0 deletions src/resources/zones.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import { APIResource } from '../core/resource';
import * as NodesAPI from './nodes';
import { APIPromise } from '../core/api-promise';
import { RequestOptions } from '../internal/request-options';
import { path } from '../internal/utils/path';

export class Zones extends APIResource {
/**
* List all available zones
*/
list(options?: RequestOptions): APIPromise<ZoneListResponse> {
return this._client.get('/v0/zones', options);
}

/**
* Get detailed information about a specific zone
*/
get(id: string, options?: RequestOptions): APIPromise<ZoneGetResponse> {
return this._client.get(path`/v0/zones/${id}`, options);
}
}

export interface ZoneListResponse {
data: Array<ZoneListResponse.Data>;

object: string;
}

export namespace ZoneListResponse {
export interface Data {
/**
* The available capacity on this cluster, in the shape of consecutive
* "availability rectangles".
*/
available_capacity: Array<Data.AvailableCapacity>;

delivery_type: 'K8s' | 'VM';

hardware_type: NodesAPI.AcceleratorType;

interconnect_type: 'Infiniband' | 'None';

name: string;

object: string;

region: 'NorthAmerica' | 'AsiaPacific' | 'EuropeMiddleEastAfrica';
}

export namespace Data {
export interface AvailableCapacity {
/**
* Unix timestamp in seconds since epoch
*/
end_timestamp: number;

/**
* The number of nodes available during this time period
*/
quantity: number;

/**
* Unix timestamp in seconds since epoch
*/
start_timestamp: number;
}
}
}

export interface ZoneGetResponse {
/**
* The available capacity on this cluster, in the shape of consecutive
* "availability rectangles".
*/
available_capacity: Array<ZoneGetResponse.AvailableCapacity>;

delivery_type: 'K8s' | 'VM';

hardware_type: NodesAPI.AcceleratorType;

interconnect_type: 'Infiniband' | 'None';

name: string;

object: string;

region: 'NorthAmerica' | 'AsiaPacific' | 'EuropeMiddleEastAfrica';
}

export namespace ZoneGetResponse {
export interface AvailableCapacity {
/**
* Unix timestamp in seconds since epoch
*/
end_timestamp: number;

/**
* The number of nodes available during this time period
*/
quantity: number;

/**
* Unix timestamp in seconds since epoch
*/
start_timestamp: number;
}
}

export declare namespace Zones {
export { type ZoneListResponse as ZoneListResponse, type ZoneGetResponse as ZoneGetResponse };
}
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '0.1.0-alpha.24'; // x-release-please-version
export const VERSION = '0.1.0-alpha.25'; // x-release-please-version
34 changes: 34 additions & 0 deletions tests/api-resources/zones.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import SFCNodes from '@sfcompute/nodes-sdk-alpha';

const client = new SFCNodes({
bearerToken: 'My Bearer Token',
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
});

describe('resource zones', () => {
// Prism tests are disabled
test.skip('list', async () => {
const responsePromise = client.zones.list();
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
expect(response).not.toBeInstanceOf(Response);
const dataAndResponse = await responsePromise.withResponse();
expect(dataAndResponse.data).toBe(response);
expect(dataAndResponse.response).toBe(rawResponse);
});

// Prism tests are disabled
test.skip('get', async () => {
const responsePromise = client.zones.get('id');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
expect(response).not.toBeInstanceOf(Response);
const dataAndResponse = await responsePromise.withResponse();
expect(dataAndResponse.data).toBe(response);
expect(dataAndResponse.response).toBe(rawResponse);
});
});