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.28"
".": "0.1.0-alpha.29"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 13
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/the-san-francisco-compute-company/sfc-nodes-92c25ef5a0eefcd88287edd4de0589c948908f558a03a0aa15ffa961a1415845.yml
configured_endpoints: 15
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/the-san-francisco-compute-company/sfc-nodes-bef77b99228a46dabf4fa0d83d626af67a1f16adf612b90810b99591cb435dcd.yml
openapi_spec_hash: e5d9664ddfbca394030b9a9e24246dc7
config_hash: a187153315a646ecf95709ee4a223df5
config_hash: 4ea510d6a5c84c7055b51a248a2aacbf
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 0.1.0-alpha.29 (2026-05-18)

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

### Features

* **api:** update config to account for breaking changes ([ec04a35](https://github.com/sfcompute/nodes-typescript/commit/ec04a35aaf436deec09b0ddade7f24007dc62ffe))


### Bug Fixes

* **sdk:** remove unused Error types causing circular imports ([48ffa1b](https://github.com/sfcompute/nodes-typescript/commit/48ffa1b53b1942798ac686fc4c87be0e06013daa))

## 0.1.0-alpha.28 (2026-05-17)

Full Changelog: [v0.1.0-alpha.27...v0.1.0-alpha.28](https://github.com/sfcompute/nodes-typescript/compare/v0.1.0-alpha.27...v0.1.0-alpha.28)
Expand Down
10 changes: 10 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ Methods:

## Images

Types:

- <code><a href="./src/resources/vms/images.ts">ImageListResponse</a></code>
- <code><a href="./src/resources/vms/images.ts">ImageGetResponse</a></code>

Methods:

- <code title="get /preview/v2/images">client.vms.images.<a href="./src/resources/vms/images.ts">list</a>({ ...params }) -> ImageListResponse</code>
- <code title="get /preview/v2/images/{id}">client.vms.images.<a href="./src/resources/vms/images.ts">get</a>(id) -> ImageGetResponse</code>

# Nodes

Types:
Expand Down
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.28",
"version": "0.1.0-alpha.29",
"description": "The official TypeScript library for the SFC Nodes API",
"author": "SFC Nodes <hello@sfcompute.com>",
"types": "dist/index.d.ts",
Expand Down
140 changes: 139 additions & 1 deletion src/resources/vms/images.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,143 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

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

export class Images extends APIResource {}
/**
* Custom machine images for instances.
*/
export class Images extends APIResource {
/**
* > ⚠️ This endpoint is in [preview](/preview/about-preview).
*
* List images in the specified workspace. Pass `sfc:workspace:sfcompute:public` as
* the workspace to list sfc-provided public images instead.
*/
list(query: ImageListParams, options?: RequestOptions): APIPromise<ImageListResponse> {
return this._client.get('/preview/v2/images', {
query,
defaultBaseURL: 'https://api.sfcompute.com',
...options,
});
}

/**
* > ⚠️ This endpoint is in [preview](/preview/about-preview).
*
* Retrieve an image by ID. Returns both user-owned and public images.
*/
get(id: string, options?: RequestOptions): APIPromise<ImageGetResponse> {
return this._client.get(path`/preview/v2/images/${id}`, {
defaultBaseURL: 'https://api.sfcompute.com',
...options,
});
}
}

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

has_more: boolean;

object: 'list';

cursor?: string | null;
}

export namespace ImageListResponse {
export interface Data {
id: string;

/**
* Unix timestamp.
*/
created_at: number;

name: string;

object: 'image';

owner: string;

/**
* A resource path for a image resource. Format:
* sfc:image:<account>:<workspace>:<name>.
*/
resource_path: string;

upload_status: 'started' | 'uploading' | 'completed' | 'failed' | 'revoked';

workspace: string;

provider?: string | null;

sha256?: string | null;
}
}

export interface ImageGetResponse {
id: string;

/**
* Unix timestamp.
*/
created_at: number;

name: string;

object: 'image';

owner: string;

/**
* A resource path for a image resource. Format:
* sfc:image:<account>:<workspace>:<name>.
*/
resource_path: string;

upload_status: 'started' | 'uploading' | 'completed' | 'failed' | 'revoked';

workspace: string;

provider?: string | null;

sha256?: string | null;
}

export interface ImageListParams {
/**
* Filter by workspace. Pass `sfc:workspace:sfcompute:public` to list sfc-provided
* public images.
*/
workspace: string;

/**
* Filter by image ID (repeatable).
*/
id?: Array<string>;

/**
* Cursor for backward pagination.
*/
ending_before?: string;

/**
* Maximum number of results to return (1-200, default 50).
*/
limit?: number;

/**
* Cursor for forward pagination (from a previous response's `cursor` field).
*/
starting_after?: string;
}

export declare namespace Images {
export {
type ImageListResponse as ImageListResponse,
type ImageGetResponse as ImageGetResponse,
type ImageListParams as ImageListParams,
};
}
2 changes: 1 addition & 1 deletion src/resources/vms/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

export { Images } from './images';
export { Images, type ImageListResponse, type ImageGetResponse, type ImageListParams } from './images';
export {
Script,
type UserData,
Expand Down
9 changes: 7 additions & 2 deletions src/resources/vms/vms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { APIResource } from '../../core/resource';
import * as ImagesAPI from './images';
import { Images } from './images';
import { ImageGetResponse, ImageListParams, ImageListResponse, Images } from './images';
import * as ScriptAPI from './script';
import { Script, ScriptCreateParams, ScriptCreateResponse, ScriptRetrieveResponse, UserData } from './script';
import { APIPromise } from '../../core/api-promise';
Expand Down Expand Up @@ -112,5 +112,10 @@ export declare namespace VMs {
type ScriptCreateParams as ScriptCreateParams,
};

export { Images as Images };
export {
Images as Images,
type ImageListResponse as ImageListResponse,
type ImageGetResponse as ImageGetResponse,
type ImageListParams as ImageListParams,
};
}
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.28'; // x-release-please-version
export const VERSION = '0.1.0-alpha.29'; // x-release-please-version
45 changes: 45 additions & 0 deletions tests/api-resources/vms/images.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// 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 images', () => {
// Mock server tests are disabled
test.skip('list: only required params', async () => {
const responsePromise = client.vms.images.list({ workspace: 'wksp_k3R-nX9vLm7Qp2Yw5Jd8F' });
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);
});

// Mock server tests are disabled
test.skip('list: required and optional params', async () => {
const response = await client.vms.images.list({
workspace: 'wksp_k3R-nX9vLm7Qp2Yw5Jd8F',
id: ['image_k3R-nX9vLm7Qp2Yw5Jd8F'],
ending_before: 'imagec_gqXR7s0Kj5mHvE2wNpLc4Q',
limit: 1,
starting_after: 'imagec_gqXR7s0Kj5mHvE2wNpLc4Q',
});
});

// Mock server tests are disabled
test.skip('get', async () => {
const responsePromise = client.vms.images.get('image_k3R-nX9vLm7Qp2Yw5Jd8F');
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);
});
});
Loading