Skip to content

Commit 9af205c

Browse files
release: 0.1.0-alpha.21 (#32)
Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 838405b commit 9af205c

File tree

8 files changed

+18
-65
lines changed

8 files changed

+18
-65
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.20"
2+
".": "0.1.0-alpha.21"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 13
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/the-san-francisco-compute-company%2Fsfc-nodes-f5f616455c00f00755e37240a294c96c2353b63aa8238d54f03ff16831f321f3.yml
3-
openapi_spec_hash: 5d24f0033a95eabe54df671a80d0d91f
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/the-san-francisco-compute-company%2Fsfc-nodes-80cab7746a6cdf7657e218c427ff7e13db1ac2454eacaccf0f36120234d49a3d.yml
3+
openapi_spec_hash: c36b216292e88e7bd8d57ef05cf67cf2
44
config_hash: 5ab998e0c5691df351205dfc14a2cfaf

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.21 (2025-10-02)
4+
5+
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)
6+
7+
### Features
8+
9+
* **api:** api update ([addc1db](https://github.com/sfcompute/nodes-typescript/commit/addc1dbe5df80f337b28aa5485038fd908e0c8a0))
10+
311
## 0.1.0-alpha.20 (2025-10-02)
412

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

README.md

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -48,60 +48,6 @@ const listResponseNode: SFCNodes.ListResponseNode = await client.nodes.list();
4848

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

51-
## File uploads
52-
53-
Request parameters that correspond to file uploads can be passed in many different forms:
54-
55-
- `File` (or an object with the same structure)
56-
- a `fetch` `Response` (or an object with the same structure)
57-
- an `fs.ReadStream`
58-
- the return value of our `toFile` helper
59-
60-
```ts
61-
import fs from 'fs';
62-
import SFCNodes, { toFile } from '@sfcompute/nodes-sdk-alpha';
63-
64-
const client = new SFCNodes();
65-
66-
// If you have access to Node `fs` we recommend using `fs.createReadStream()`:
67-
await client.nodes.create({
68-
desired_count: 1,
69-
max_price_per_node_hour: 1000,
70-
zone: 'hayesvalley',
71-
cloud_init_user_data: fs.createReadStream('/path/to/file'),
72-
});
73-
74-
// Or if you have the web `File` API you can pass a `File` instance:
75-
await client.nodes.create({
76-
desired_count: 1,
77-
max_price_per_node_hour: 1000,
78-
zone: 'hayesvalley',
79-
cloud_init_user_data: new File(['my bytes'], 'file'),
80-
});
81-
82-
// You can also pass a `fetch` `Response`:
83-
await client.nodes.create({
84-
desired_count: 1,
85-
max_price_per_node_hour: 1000,
86-
zone: 'hayesvalley',
87-
cloud_init_user_data: await fetch('https://somesite/file'),
88-
});
89-
90-
// Finally, if none of the above are convenient, you can use our `toFile` helper:
91-
await client.nodes.create({
92-
desired_count: 1,
93-
max_price_per_node_hour: 1000,
94-
zone: 'hayesvalley',
95-
cloud_init_user_data: await toFile(Buffer.from('my bytes'), 'file'),
96-
});
97-
await client.nodes.create({
98-
desired_count: 1,
99-
max_price_per_node_hour: 1000,
100-
zone: 'hayesvalley',
101-
cloud_init_user_data: await toFile(new Uint8Array([0, 1, 2]), 'file'),
102-
});
103-
```
104-
10551
## Handling errors
10652

10753
When the library is unable to connect to the API,

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.20",
3+
"version": "0.1.0-alpha.21",
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/resources/nodes.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import { APIResource } from '../core/resource';
44
import * as NodesAPI from './nodes';
55
import { APIPromise } from '../core/api-promise';
6-
import { type Uploadable } from '../core/uploads';
76
import { buildHeaders } from '../internal/headers';
87
import { RequestOptions } from '../internal/request-options';
98
import { path } from '../internal/utils/path';
@@ -127,7 +126,7 @@ export interface CreateNodesRequest {
127126
/**
128127
* User script to be executed during the VM's boot process
129128
*/
130-
cloud_init_user_data?: Uploadable;
129+
cloud_init_user_data?: string;
131130

132131
/**
133132
* End time as Unix timestamp in seconds If provided, end time must be aligned to
@@ -456,7 +455,7 @@ export interface NodeCreateParams {
456455
/**
457456
* User script to be executed during the VM's boot process
458457
*/
459-
cloud_init_user_data?: Uploadable;
458+
cloud_init_user_data?: string;
460459

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

520519
/**
521520
* Redeploy node with this VM image ID

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.20'; // x-release-please-version
1+
export const VERSION = '0.1.0-alpha.21'; // x-release-please-version

tests/api-resources/nodes.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

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

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

0 commit comments

Comments
 (0)