diff --git a/.release-please-manifest.json b/.release-please-manifest.json index de4ea38..e003ff7 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.20" + ".": "0.1.0-alpha.21" } diff --git a/.stats.yml b/.stats.yml index ca59d57..4df05a3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 4910298..834225e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/README.md b/README.md index 8304c61..c78c179 100644 --- a/README.md +++ b/README.md @@ -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, diff --git a/package.json b/package.json index a7d24af..fdc40db 100644 --- a/package.json +++ b/package.json @@ -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 ", "types": "dist/index.d.ts", diff --git a/src/resources/nodes.ts b/src/resources/nodes.ts index 4cdbcc3..cbad5f1 100644 --- a/src/resources/nodes.ts +++ b/src/resources/nodes.ts @@ -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'; @@ -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 @@ -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 @@ -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 diff --git a/src/version.ts b/src/version.ts index 48ca0ae..0176b61 100644 --- a/src/version.ts +++ b/src/version.ts @@ -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 diff --git a/tests/api-resources/nodes.test.ts b/tests/api-resources/nodes.test.ts index 53b3213..44d9b1b 100644 --- a/tests/api-resources/nodes.test.ts +++ b/tests/api-resources/nodes.test.ts @@ -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', @@ -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'],