Skip to content

Commit 4e960f9

Browse files
release: 0.1.0-alpha.25 (#36)
Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent cf16926 commit 4e960f9

File tree

10 files changed

+182
-5
lines changed

10 files changed

+182
-5
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.1.0-alpha.24"
2+
".": "0.1.0-alpha.25"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 13
1+
configured_endpoints: 15
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/the-san-francisco-compute-company%2Fsfc-nodes-c9d6d56eabd56a40a29dc2639a77d22dd5394ecd3ec9aeaebb3a3977811571da.yml
33
openapi_spec_hash: beda3f45c48679e14d6fe8bbe7003d51
4-
config_hash: cf202573c712b5d91a4d496f35f0ff57
4+
config_hash: a187153315a646ecf95709ee4a223df5

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 0.1.0-alpha.25 (2025-12-01)
4+
5+
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)
6+
7+
### Features
8+
9+
* **api:** add .zones SDK methods ([b48f535](https://github.com/sfcompute/nodes-typescript/commit/b48f5352e10deb94d20a316e83db724226539524))
10+
311
## 0.1.0-alpha.24 (2025-11-22)
412

513
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)

api.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,15 @@ Methods:
6060
- <code title="get /v1/nodes/{id}">client.nodes.<a href="./src/resources/nodes.ts">get</a>(id) -> Node</code>
6161
- <code title="put /v1/nodes/{id}/redeploy">client.nodes.<a href="./src/resources/nodes.ts">redeploy</a>(id, { ...params }) -> Node</code>
6262
- <code title="patch /v1/nodes/{id}/release">client.nodes.<a href="./src/resources/nodes.ts">release</a>(id) -> Node</code>
63+
64+
# Zones
65+
66+
Types:
67+
68+
- <code><a href="./src/resources/zones.ts">ZoneListResponse</a></code>
69+
- <code><a href="./src/resources/zones.ts">ZoneGetResponse</a></code>
70+
71+
Methods:
72+
73+
- <code title="get /v0/zones">client.zones.<a href="./src/resources/zones.ts">list</a>() -> ZoneListResponse</code>
74+
- <code title="get /v0/zones/{id}">client.zones.<a href="./src/resources/zones.ts">get</a>(id) -> ZoneGetResponse</code>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sfcompute/nodes-sdk-alpha",
3-
"version": "0.1.0-alpha.24",
3+
"version": "0.1.0-alpha.25",
44
"description": "The official TypeScript library for the SFC Nodes API",
55
"author": "SFC Nodes <hello@sfcompute.com>",
66
"types": "dist/index.d.ts",

src/client.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import {
3535
Nodes,
3636
Status,
3737
} from './resources/nodes';
38+
import { ZoneGetResponse, ZoneListResponse, Zones } from './resources/zones';
3839
import { VMLogsParams, VMLogsResponse, VMSSHParams, VMSSHResponse, VMs } from './resources/vms/vms';
3940
import { type Fetch } from './internal/builtin-types';
4041
import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers';
@@ -725,10 +726,12 @@ export class SFCNodes {
725726

726727
vms: API.VMs = new API.VMs(this);
727728
nodes: API.Nodes = new API.Nodes(this);
729+
zones: API.Zones = new API.Zones(this);
728730
}
729731

730732
SFCNodes.VMs = VMs;
731733
SFCNodes.Nodes = Nodes;
734+
SFCNodes.Zones = Zones;
732735

733736
export declare namespace SFCNodes {
734737
export type RequestOptions = Opts.RequestOptions;
@@ -759,4 +762,10 @@ export declare namespace SFCNodes {
759762
type NodeExtendParams as NodeExtendParams,
760763
type NodeRedeployParams as NodeRedeployParams,
761764
};
765+
766+
export {
767+
Zones as Zones,
768+
type ZoneListResponse as ZoneListResponse,
769+
type ZoneGetResponse as ZoneGetResponse,
770+
};
762771
}

src/resources/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ export {
1919
type NodeRedeployParams,
2020
} from './nodes';
2121
export { VMs, type VMLogsResponse, type VMSSHResponse, type VMLogsParams, type VMSSHParams } from './vms/vms';
22+
export { Zones, type ZoneListResponse, type ZoneGetResponse } from './zones';

src/resources/zones.ts

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
import { APIResource } from '../core/resource';
4+
import * as NodesAPI from './nodes';
5+
import { APIPromise } from '../core/api-promise';
6+
import { RequestOptions } from '../internal/request-options';
7+
import { path } from '../internal/utils/path';
8+
9+
export class Zones extends APIResource {
10+
/**
11+
* List all available zones
12+
*/
13+
list(options?: RequestOptions): APIPromise<ZoneListResponse> {
14+
return this._client.get('/v0/zones', options);
15+
}
16+
17+
/**
18+
* Get detailed information about a specific zone
19+
*/
20+
get(id: string, options?: RequestOptions): APIPromise<ZoneGetResponse> {
21+
return this._client.get(path`/v0/zones/${id}`, options);
22+
}
23+
}
24+
25+
export interface ZoneListResponse {
26+
data: Array<ZoneListResponse.Data>;
27+
28+
object: string;
29+
}
30+
31+
export namespace ZoneListResponse {
32+
export interface Data {
33+
/**
34+
* The available capacity on this cluster, in the shape of consecutive
35+
* "availability rectangles".
36+
*/
37+
available_capacity: Array<Data.AvailableCapacity>;
38+
39+
delivery_type: 'K8s' | 'VM';
40+
41+
hardware_type: NodesAPI.AcceleratorType;
42+
43+
interconnect_type: 'Infiniband' | 'None';
44+
45+
name: string;
46+
47+
object: string;
48+
49+
region: 'NorthAmerica' | 'AsiaPacific' | 'EuropeMiddleEastAfrica';
50+
}
51+
52+
export namespace Data {
53+
export interface AvailableCapacity {
54+
/**
55+
* Unix timestamp in seconds since epoch
56+
*/
57+
end_timestamp: number;
58+
59+
/**
60+
* The number of nodes available during this time period
61+
*/
62+
quantity: number;
63+
64+
/**
65+
* Unix timestamp in seconds since epoch
66+
*/
67+
start_timestamp: number;
68+
}
69+
}
70+
}
71+
72+
export interface ZoneGetResponse {
73+
/**
74+
* The available capacity on this cluster, in the shape of consecutive
75+
* "availability rectangles".
76+
*/
77+
available_capacity: Array<ZoneGetResponse.AvailableCapacity>;
78+
79+
delivery_type: 'K8s' | 'VM';
80+
81+
hardware_type: NodesAPI.AcceleratorType;
82+
83+
interconnect_type: 'Infiniband' | 'None';
84+
85+
name: string;
86+
87+
object: string;
88+
89+
region: 'NorthAmerica' | 'AsiaPacific' | 'EuropeMiddleEastAfrica';
90+
}
91+
92+
export namespace ZoneGetResponse {
93+
export interface AvailableCapacity {
94+
/**
95+
* Unix timestamp in seconds since epoch
96+
*/
97+
end_timestamp: number;
98+
99+
/**
100+
* The number of nodes available during this time period
101+
*/
102+
quantity: number;
103+
104+
/**
105+
* Unix timestamp in seconds since epoch
106+
*/
107+
start_timestamp: number;
108+
}
109+
}
110+
111+
export declare namespace Zones {
112+
export { type ZoneListResponse as ZoneListResponse, type ZoneGetResponse as ZoneGetResponse };
113+
}

src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const VERSION = '0.1.0-alpha.24'; // x-release-please-version
1+
export const VERSION = '0.1.0-alpha.25'; // x-release-please-version

tests/api-resources/zones.test.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
import SFCNodes from '@sfcompute/nodes-sdk-alpha';
4+
5+
const client = new SFCNodes({
6+
bearerToken: 'My Bearer Token',
7+
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
8+
});
9+
10+
describe('resource zones', () => {
11+
// Prism tests are disabled
12+
test.skip('list', async () => {
13+
const responsePromise = client.zones.list();
14+
const rawResponse = await responsePromise.asResponse();
15+
expect(rawResponse).toBeInstanceOf(Response);
16+
const response = await responsePromise;
17+
expect(response).not.toBeInstanceOf(Response);
18+
const dataAndResponse = await responsePromise.withResponse();
19+
expect(dataAndResponse.data).toBe(response);
20+
expect(dataAndResponse.response).toBe(rawResponse);
21+
});
22+
23+
// Prism tests are disabled
24+
test.skip('get', async () => {
25+
const responsePromise = client.zones.get('id');
26+
const rawResponse = await responsePromise.asResponse();
27+
expect(rawResponse).toBeInstanceOf(Response);
28+
const response = await responsePromise;
29+
expect(response).not.toBeInstanceOf(Response);
30+
const dataAndResponse = await responsePromise.withResponse();
31+
expect(dataAndResponse.data).toBe(response);
32+
expect(dataAndResponse.response).toBe(rawResponse);
33+
});
34+
});

0 commit comments

Comments
 (0)