Skip to content

Commit a2d0ed1

Browse files
Merge pull request #18 from sfcompute/release-please--branches--main--changes--next--components--nodes-sdk-alpha
2 parents f41d9e4 + 07810ae commit a2d0ed1

File tree

14 files changed

+119
-83
lines changed

14 files changed

+119
-83
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.7"
2+
".": "0.1.0-alpha.8"
33
}

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 8
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/the-san-francisco-compute-company%2Fsfc-nodes-75d55a2bdbad9dd66f295dbd8559f2bf6264e40b8c4afe69f2b74c206d96aabd.yml
3-
openapi_spec_hash: 4754d7b3a8a098a220650c410b3b79cd
4-
config_hash: 0bc0755073b9c5efee39395b9d08b3a3
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/the-san-francisco-compute-company%2Fsfc-nodes-a77e44712c1fc082086539b82229b887a6eb9d4a3f677e6827d2eea9341fa08b.yml
3+
openapi_spec_hash: df8daea0f36c6c13f13ac2658d306083
4+
config_hash: ada4ea3670884e51d3b5b4f3b5a6e76d

CHANGELOG.md

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

3+
## 0.1.0-alpha.8 (2025-08-13)
4+
5+
Full Changelog: [v0.1.0-alpha.7...v0.1.0-alpha.8](https://github.com/sfcompute/nodes-typescript/compare/v0.1.0-alpha.7...v0.1.0-alpha.8)
6+
7+
### Features
8+
9+
* **api:** revert custom ErrorConfig ([186cb52](https://github.com/sfcompute/nodes-typescript/commit/186cb5225a5de532914c1fd24f8e34688294ad51))
10+
11+
12+
### Chores
13+
14+
* **internal:** codegen related update ([4a8ba72](https://github.com/sfcompute/nodes-typescript/commit/4a8ba72e22d870c79ea30dcc90de37cf20fe1dd5))
15+
* **internal:** move publish config ([42810dd](https://github.com/sfcompute/nodes-typescript/commit/42810ddb26d3d78aeddf9d0b9419a8166c33ad61))
16+
* **internal:** update comment in script ([51e1934](https://github.com/sfcompute/nodes-typescript/commit/51e193432b8af198a91381c4d55350aa271b91ff))
17+
* update @stainless-api/prism-cli to v5.15.0 ([2c66260](https://github.com/sfcompute/nodes-typescript/commit/2c6626033c3ec5ab5109ea290b0bfec58a6afbf5))
18+
319
## 0.1.0-alpha.7 (2025-08-05)
420

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

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The full API of this library can be found in [api.md](api.md).
2323
import SFCNodes from '@sfcompute/nodes-sdk-alpha';
2424

2525
const client = new SFCNodes({
26-
apiKey: process.env['SFC_API_KEY'], // This is the default and can be omitted
26+
bearerToken: process.env['SFC_NODES_BEARER_TOKEN'], // This is the default and can be omitted
2727
});
2828

2929
const listResponseNode = await client.nodes.list();
@@ -40,7 +40,7 @@ This library includes TypeScript definitions for all request params and response
4040
import SFCNodes from '@sfcompute/nodes-sdk-alpha';
4141

4242
const client = new SFCNodes({
43-
apiKey: process.env['SFC_API_KEY'], // This is the default and can be omitted
43+
bearerToken: process.env['SFC_NODES_BEARER_TOKEN'], // This is the default and can be omitted
4444
});
4545

4646
const listResponseNode: SFCNodes.ListResponseNode = await client.nodes.list();

bin/publish-npm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ else
5858
fi
5959

6060
# Publish with the appropriate tag
61-
yarn publish --access public --tag "$TAG"
61+
yarn publish --tag "$TAG"

package.json

Lines changed: 4 additions & 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.7",
3+
"version": "0.1.0-alpha.8",
44
"description": "The official TypeScript library for the SFC Nodes API",
55
"author": "SFC Nodes <hello@sfcompute.com>",
66
"types": "dist/index.d.ts",
@@ -13,6 +13,9 @@
1313
"**/*"
1414
],
1515
"private": false,
16+
"publishConfig": {
17+
"access": "public"
18+
},
1619
"scripts": {
1720
"test": "./scripts/test",
1821
"build": "./scripts/build",

scripts/mock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ echo "==> Starting mock server with URL ${URL}"
2121

2222
# Run prism mock on the given spec
2323
if [ "$1" == "--daemon" ]; then
24-
npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" &> .prism.log &
24+
npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log &
2525

2626
# Wait for server to come online
2727
echo -n "Waiting for server"
@@ -37,5 +37,5 @@ if [ "$1" == "--daemon" ]; then
3737

3838
echo
3939
else
40-
npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL"
40+
npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL"
4141
fi

scripts/test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ elif ! prism_is_running ; then
4343
echo -e "To run the server, pass in the path or url of your OpenAPI"
4444
echo -e "spec to the prism command:"
4545
echo
46-
echo -e " \$ ${YELLOW}npm exec --package=@stoplight/prism-cli@~5.3.2 -- prism mock path/to/your.openapi.yml${NC}"
46+
echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}"
4747
echo
4848

4949
exit 1

src/client.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ import { isEmptyObj } from './internal/utils/values';
4949

5050
export interface ClientOptions {
5151
/**
52-
* Defaults to process.env['SFC_API_KEY'].
52+
* Defaults to process.env['SFC_NODES_BEARER_TOKEN'].
5353
*/
54-
apiKey?: string | null | undefined;
54+
bearerToken?: string | null | undefined;
5555

5656
/**
5757
* Override the default base URL for the API, e.g., "https://api.example.com/v2/"
@@ -126,7 +126,7 @@ export interface ClientOptions {
126126
* API Client for interfacing with the SFC Nodes API.
127127
*/
128128
export class SFCNodes {
129-
apiKey: string | null;
129+
bearerToken: string | null;
130130

131131
baseURL: string;
132132
maxRetries: number;
@@ -143,7 +143,7 @@ export class SFCNodes {
143143
/**
144144
* API Client for interfacing with the SFC Nodes API.
145145
*
146-
* @param {string | null | undefined} [opts.apiKey=process.env['SFC_API_KEY'] ?? null]
146+
* @param {string | null | undefined} [opts.bearerToken=process.env['SFC_NODES_BEARER_TOKEN'] ?? null]
147147
* @param {string} [opts.baseURL=process.env['SFC_NODES_BASE_URL'] ?? https://api.sfcompute.com] - Override the default base URL for the API.
148148
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
149149
* @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls.
@@ -154,11 +154,11 @@ export class SFCNodes {
154154
*/
155155
constructor({
156156
baseURL = readEnv('SFC_NODES_BASE_URL'),
157-
apiKey = readEnv('SFC_API_KEY') ?? null,
157+
bearerToken = readEnv('SFC_NODES_BEARER_TOKEN') ?? null,
158158
...opts
159159
}: ClientOptions = {}) {
160160
const options: ClientOptions = {
161-
apiKey,
161+
bearerToken,
162162
...opts,
163163
baseURL: baseURL || `https://api.sfcompute.com`,
164164
};
@@ -180,7 +180,7 @@ export class SFCNodes {
180180

181181
this._options = options;
182182

183-
this.apiKey = apiKey;
183+
this.bearerToken = bearerToken;
184184
}
185185

186186
/**
@@ -196,7 +196,7 @@ export class SFCNodes {
196196
logLevel: this.logLevel,
197197
fetch: this.fetch,
198198
fetchOptions: this.fetchOptions,
199-
apiKey: this.apiKey,
199+
bearerToken: this.bearerToken,
200200
...options,
201201
});
202202
return client;
@@ -214,23 +214,23 @@ export class SFCNodes {
214214
}
215215

216216
protected validateHeaders({ values, nulls }: NullableHeaders) {
217-
if (this.apiKey && values.get('authorization')) {
217+
if (this.bearerToken && values.get('authorization')) {
218218
return;
219219
}
220220
if (nulls.has('authorization')) {
221221
return;
222222
}
223223

224224
throw new Error(
225-
'Could not resolve authentication method. Expected the apiKey to be set. Or for the "Authorization" headers to be explicitly omitted',
225+
'Could not resolve authentication method. Expected the bearerToken to be set. Or for the "Authorization" headers to be explicitly omitted',
226226
);
227227
}
228228

229229
protected async authHeaders(opts: FinalRequestOptions): Promise<NullableHeaders | undefined> {
230-
if (this.apiKey == null) {
230+
if (this.bearerToken == null) {
231231
return undefined;
232232
}
233-
return buildHeaders([{ Authorization: `Bearer ${this.apiKey}` }]);
233+
return buildHeaders([{ Authorization: `Bearer ${this.bearerToken}` }]);
234234
}
235235

236236
/**

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

0 commit comments

Comments
 (0)