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.20"
".": "0.1.0-alpha.21"
}
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
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/the-san-francisco-compute-company%2Fsfc-nodes-f5f616455c00f00755e37240a294c96c2353b63aa8238d54f03ff16831f321f3.yml
openapi_spec_hash: 5d24f0033a95eabe54df671a80d0d91f
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/the-san-francisco-compute-company%2Fsfc-nodes-80cab7746a6cdf7657e218c427ff7e13db1ac2454eacaccf0f36120234d49a3d.yml
openapi_spec_hash: c36b216292e88e7bd8d57ef05cf67cf2
config_hash: 5ab998e0c5691df351205dfc14a2cfaf
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.21 (2025-10-02)

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

### Features

* **api:** api update ([addc1db](https://github.com/sfcompute/nodes-typescript/commit/addc1dbe5df80f337b28aa5485038fd908e0c8a0))

## 0.1.0-alpha.20 (2025-10-02)

Full Changelog: [v0.1.0-alpha.19...v0.1.0-alpha.20](https://github.com/sfcompute/nodes-typescript/compare/v0.1.0-alpha.19...v0.1.0-alpha.20)
Expand Down
54 changes: 0 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,60 +48,6 @@ const listResponseNode: SFCNodes.ListResponseNode = await client.nodes.list();

Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.

## File uploads

Request parameters that correspond to file uploads can be passed in many different forms:

- `File` (or an object with the same structure)
- a `fetch` `Response` (or an object with the same structure)
- an `fs.ReadStream`
- the return value of our `toFile` helper

```ts
import fs from 'fs';
import SFCNodes, { toFile } from '@sfcompute/nodes-sdk-alpha';

const client = new SFCNodes();

// If you have access to Node `fs` we recommend using `fs.createReadStream()`:
await client.nodes.create({
desired_count: 1,
max_price_per_node_hour: 1000,
zone: 'hayesvalley',
cloud_init_user_data: fs.createReadStream('/path/to/file'),
});

// Or if you have the web `File` API you can pass a `File` instance:
await client.nodes.create({
desired_count: 1,
max_price_per_node_hour: 1000,
zone: 'hayesvalley',
cloud_init_user_data: new File(['my bytes'], 'file'),
});

// You can also pass a `fetch` `Response`:
await client.nodes.create({
desired_count: 1,
max_price_per_node_hour: 1000,
zone: 'hayesvalley',
cloud_init_user_data: await fetch('https://somesite/file'),
});

// Finally, if none of the above are convenient, you can use our `toFile` helper:
await client.nodes.create({
desired_count: 1,
max_price_per_node_hour: 1000,
zone: 'hayesvalley',
cloud_init_user_data: await toFile(Buffer.from('my bytes'), 'file'),
});
await client.nodes.create({
desired_count: 1,
max_price_per_node_hour: 1000,
zone: 'hayesvalley',
cloud_init_user_data: await toFile(new Uint8Array([0, 1, 2]), 'file'),
});
```

## Handling errors

When the library is unable to connect to the API,
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.20",
"version": "0.1.0-alpha.21",
"description": "The official TypeScript library for the SFC Nodes API",
"author": "SFC Nodes <hello@sfcompute.com>",
"types": "dist/index.d.ts",
Expand Down
7 changes: 3 additions & 4 deletions src/resources/nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import { APIResource } from '../core/resource';
import * as NodesAPI from './nodes';
import { APIPromise } from '../core/api-promise';
import { type Uploadable } from '../core/uploads';
import { buildHeaders } from '../internal/headers';
import { RequestOptions } from '../internal/request-options';
import { path } from '../internal/utils/path';
Expand Down Expand Up @@ -127,7 +126,7 @@ export interface CreateNodesRequest {
/**
* User script to be executed during the VM's boot process
*/
cloud_init_user_data?: Uploadable;
cloud_init_user_data?: string;

/**
* End time as Unix timestamp in seconds If provided, end time must be aligned to
Expand Down Expand Up @@ -456,7 +455,7 @@ export interface NodeCreateParams {
/**
* User script to be executed during the VM's boot process
*/
cloud_init_user_data?: Uploadable;
cloud_init_user_data?: string;

/**
* End time as Unix timestamp in seconds If provided, end time must be aligned to
Expand Down Expand Up @@ -515,7 +514,7 @@ export interface NodeRedeployParams {
* Update the cloud init user data for VMs running on this node Data should be
* base64 encoded
*/
cloud_init_user_data?: Uploadable;
cloud_init_user_data?: string;

/**
* Redeploy node with this VM image ID
Expand Down
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.20'; // x-release-please-version
export const VERSION = '0.1.0-alpha.21'; // x-release-please-version
4 changes: 2 additions & 2 deletions tests/api-resources/nodes.test.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.

import SFCNodes, { toFile } from '@sfcompute/nodes-sdk-alpha';
import SFCNodes from '@sfcompute/nodes-sdk-alpha';

const client = new SFCNodes({
bearerToken: 'My Bearer Token',
Expand Down Expand Up @@ -30,7 +30,7 @@ describe('resource nodes', () => {
desired_count: 1,
max_price_per_node_hour: 1000,
zone: 'hayesvalley',
cloud_init_user_data: await toFile(Buffer.from('# my file contents'), 'README.md'),
cloud_init_user_data: 'aGVsbG8gd29ybGQ=',
end_at: 0,
image_id: 'vmi_1234567890abcdef',
names: ['cuda-crunch'],
Expand Down