Skip to content

Commit ced6208

Browse files
release: 0.1.0-alpha.14 (#15)
* chore(internal): codegen related update * chore: update CI script * feat(client): shorten union variant names * fix(internal): remove unused null class * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * feat(api): manual updates * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * fix(internal): fix resource and method skipping logic * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * fix(api): prevent build compares against main * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * feat(mcp): add client infer to cloudflare oauth screen * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): update global Error reference * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * feat(api): encode path params * codegen metadata * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * feat(mcp): expose client options in `streamableHTTPApp` * chore(internal): codegen related update * feat(mcp): allow setting logging level * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore: ci build action * chore(internal): codegen related update * chore(internal): codegen related update * fix(mcp): fix query options parsing * codegen metadata * fix: coerce nullable values to undefined * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(mcp): upload dxt as release asset * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * fix(mcp): fix uploading dxt release assets * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): enable and auto-fix @typescript-eslint/consistent-type-imports lint rule * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * chore(internal): codegen related update * feat(api): docs * release: 0.1.0-alpha.14 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 6c58f31 commit ced6208

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1284
-214
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,15 @@ jobs:
7878
AUTH: ${{ steps.github-oidc.outputs.github_token }}
7979
SHA: ${{ github.sha }}
8080
run: ./scripts/utils/upload-artifact.sh
81+
82+
- name: Upload MCP Server tarball
83+
if: github.repository == 'stainless-sdks/stainless-v0-typescript'
84+
env:
85+
URL: https://pkg.stainless.com/s?subpackage=mcp-server
86+
AUTH: ${{ steps.github-oidc.outputs.github_token }}
87+
SHA: ${{ github.sha }}
88+
BASE_PATH: packages/mcp-server
89+
run: ./scripts/utils/upload-artifact.sh
8190
test:
8291
timeout-minutes: 10
8392
name: test

.github/workflows/publish-npm.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,8 @@ jobs:
3939
yarn tsn scripts/publish-packages.ts "{ \"paths_released\": \"$PATHS_RELEASED\" }"
4040
env:
4141
NPM_TOKEN: ${{ secrets.STAINLESS_NPM_TOKEN || secrets.NPM_TOKEN }}
42+
43+
- name: Upload MCP Server DXT GitHub release asset
44+
run: |
45+
gh release upload ${{ github.event.release.tag_name }} \
46+
packages/mcp-server/stainless_api_sdk_api.dxt

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ dist
77
dist-deno
88
/*.tgz
99
.idea/
10-
10+
dist-bundle
11+
*.dxt

.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.13"
2+
".": "0.1.0-alpha.14"
33
}

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 19
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/stainless%2Fstainless-v0-a3a29065ad8fdc320ffaa9b130843b1d0dc3670a045795fc624936bded3bfe0f.yml
3-
openapi_spec_hash: e1b7059453520913dc4a07ccc9114ed8
4-
config_hash: bebf53e09f502c558eb86ebe727c58dd
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/stainless%2Fstainless-v0-a015455f60c6b613608a0a1fc4918a41593038160a16b09f714f601ab98c84bf.yml
3+
openapi_spec_hash: 6f4ebb173c63d77efa9addde9b11f69e
4+
config_hash: 50a257a9f90f8a010873c283e2832095

CHANGELOG.md

Lines changed: 114 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ const client = new Stainless({
2727
environment: 'staging', // defaults to 'production'
2828
});
2929

30-
const buildObject = await client.builds.create({ project: 'project', revision: 'string' });
30+
const build = await client.builds.create({ project: 'stainless', revision: 'main' });
3131

32-
console.log(buildObject.id);
32+
console.log(build.id);
3333
```
3434

3535
### Request & Response types
@@ -45,8 +45,8 @@ const client = new Stainless({
4545
environment: 'staging', // defaults to 'production'
4646
});
4747

48-
const params: Stainless.BuildCreateParams = { project: 'project', revision: 'string' };
49-
const buildObject: Stainless.BuildObject = await client.builds.create(params);
48+
const params: Stainless.BuildCreateParams = { project: 'stainless', revision: 'main' };
49+
const build: Stainless.Build = await client.builds.create(params);
5050
```
5151

5252
Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
@@ -59,17 +59,15 @@ a subclass of `APIError` will be thrown:
5959

6060
<!-- prettier-ignore -->
6161
```ts
62-
const buildObject = await client.builds
63-
.create({ project: 'project', revision: 'string' })
64-
.catch(async (err) => {
65-
if (err instanceof Stainless.APIError) {
66-
console.log(err.status); // 400
67-
console.log(err.name); // BadRequestError
68-
console.log(err.headers); // {server: 'nginx', ...}
69-
} else {
70-
throw err;
71-
}
72-
});
62+
const build = await client.builds.create({ project: 'stainless', revision: 'main' }).catch(async (err) => {
63+
if (err instanceof Stainless.APIError) {
64+
console.log(err.status); // 400
65+
console.log(err.name); // BadRequestError
66+
console.log(err.headers); // {server: 'nginx', ...}
67+
} else {
68+
throw err;
69+
}
70+
});
7371
```
7472

7573
Error codes are as follows:
@@ -101,7 +99,7 @@ const client = new Stainless({
10199
});
102100

103101
// Or, configure per-request:
104-
await client.builds.create({ project: 'project', revision: 'string' }, {
102+
await client.builds.create({ project: 'stainless', revision: 'main' }, {
105103
maxRetries: 5,
106104
});
107105
```
@@ -118,7 +116,7 @@ const client = new Stainless({
118116
});
119117

120118
// Override per-request:
121-
await client.builds.create({ project: 'project', revision: 'string' }, {
119+
await client.builds.create({ project: 'stainless', revision: 'main' }, {
122120
timeout: 5 * 1000,
123121
});
124122
```
@@ -133,22 +131,22 @@ List methods in the Stainless API are paginated.
133131
You can use the `for await … of` syntax to iterate through items across all pages:
134132

135133
```ts
136-
async function fetchAllBuildObjects(params) {
137-
const allBuildObjects = [];
134+
async function fetchAllBuilds(params) {
135+
const allBuilds = [];
138136
// Automatically fetches more pages as needed.
139-
for await (const buildObject of client.builds.list({ project: 'project' })) {
140-
allBuildObjects.push(buildObject);
137+
for await (const build of client.builds.list({ project: 'stainless' })) {
138+
allBuilds.push(build);
141139
}
142-
return allBuildObjects;
140+
return allBuilds;
143141
}
144142
```
145143

146144
Alternatively, you can request a single page at a time:
147145

148146
```ts
149-
let page = await client.builds.list({ project: 'project' });
150-
for (const buildObject of page.data) {
151-
console.log(buildObject);
147+
let page = await client.builds.list({ project: 'stainless' });
148+
for (const build of page.data) {
149+
console.log(build);
152150
}
153151

154152
// Convenience methods are provided for manually paginating:
@@ -172,15 +170,15 @@ Unlike `.asResponse()` this method consumes the body, returning once it is parse
172170
```ts
173171
const client = new Stainless();
174172

175-
const response = await client.builds.create({ project: 'project', revision: 'string' }).asResponse();
173+
const response = await client.builds.create({ project: 'stainless', revision: 'main' }).asResponse();
176174
console.log(response.headers.get('X-My-Header'));
177175
console.log(response.statusText); // access the underlying Response object
178176

179-
const { data: buildObject, response: raw } = await client.builds
180-
.create({ project: 'project', revision: 'string' })
177+
const { data: build, response: raw } = await client.builds
178+
.create({ project: 'stainless', revision: 'main' })
181179
.withResponse();
182180
console.log(raw.headers.get('X-My-Header'));
183-
console.log(buildObject.id);
181+
console.log(build.id);
184182
```
185183

186184
### Logging

api.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,16 @@ Methods:
5050

5151
Types:
5252

53-
- <code><a href="./src/resources/builds/builds.ts">BuildObject</a></code>
53+
- <code><a href="./src/resources/builds/builds.ts">Build</a></code>
5454
- <code><a href="./src/resources/builds/builds.ts">BuildTarget</a></code>
5555
- <code><a href="./src/resources/builds/builds.ts">CheckStep</a></code>
5656
- <code><a href="./src/resources/builds/builds.ts">BuildCompareResponse</a></code>
5757

5858
Methods:
5959

60-
- <code title="post /v0/builds">client.builds.<a href="./src/resources/builds/builds.ts">create</a>({ ...params }) -> BuildObject</code>
61-
- <code title="get /v0/builds/{buildId}">client.builds.<a href="./src/resources/builds/builds.ts">retrieve</a>(buildID) -> BuildObject</code>
62-
- <code title="get /v0/builds">client.builds.<a href="./src/resources/builds/builds.ts">list</a>({ ...params }) -> BuildObjectsPage</code>
60+
- <code title="post /v0/builds">client.builds.<a href="./src/resources/builds/builds.ts">create</a>({ ...params }) -> Build</code>
61+
- <code title="get /v0/builds/{buildId}">client.builds.<a href="./src/resources/builds/builds.ts">retrieve</a>(buildID) -> Build</code>
62+
- <code title="get /v0/builds">client.builds.<a href="./src/resources/builds/builds.ts">list</a>({ ...params }) -> BuildsPage</code>
6363
- <code title="post /v0/builds/compare">client.builds.<a href="./src/resources/builds/builds.ts">compare</a>({ ...params }) -> BuildCompareResponse</code>
6464

6565
## Diagnostics

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@stainless-api/sdk",
3-
"version": "0.1.0-alpha.13",
3+
"version": "0.1.0-alpha.14",
44
"description": "The official TypeScript library for the Stainless API",
55
"author": "Stainless <[email protected]>",
66
"types": "dist/index.d.ts",

packages/mcp-server/README.md

Lines changed: 46 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -221,39 +221,67 @@ The following tools are available in this MCP server.
221221

222222
### Resource `projects`:
223223

224-
- `create_projects` (`write`): Create a new project
225-
- `retrieve_projects` (`read`): Retrieve a project by name
226-
- `update_projects` (`write`): Update a project's properties
227-
- `list_projects` (`read`): List projects in an organization, from oldest to newest
224+
- `create_projects` (`write`): Create a new project.
225+
- `retrieve_projects` (`read`): Retrieve a project by name.
226+
- `update_projects` (`write`): Update a project's properties.
227+
- `list_projects` (`read`): List projects in an organization, from oldest to newest.
228228

229229
### Resource `projects.branches`:
230230

231-
- `create_projects_branches` (`write`): Create a new branch for a project
232-
- `retrieve_projects_branches` (`read`): Retrieve a project branch
233-
- `list_projects_branches` (`read`): List project branches
234-
- `delete_projects_branches` (`write`): Delete a project branch
235-
- `rebase_projects_branches` (`write`): Rebase a project branch
231+
- `create_projects_branches` (`write`): Create a new branch for a project.
232+
233+
The branch inherits the config files from the revision pointed to by the
234+
`branch_from` parameter. In addition, if the revision is a branch name,
235+
the branch will also inherit custom code changes from that branch.
236+
237+
- `retrieve_projects_branches` (`read`): Retrieve a project branch by name.
238+
- `list_projects_branches` (`read`): Retrieve a project branch by name.
239+
- `delete_projects_branches` (`write`): Delete a project branch by name.
240+
- `rebase_projects_branches` (`write`): Rebase a project branch.
241+
242+
The branch is rebased onto the `base` branch or commit SHA, inheriting
243+
any config and custom code changes.
236244

237245
### Resource `projects.configs`:
238246

239-
- `retrieve_projects_configs` (`read`): Retrieve configuration files for a project
240-
- `guess_projects_configs` (`write`): Generate configuration suggestions based on an OpenAPI spec
247+
- `retrieve_projects_configs` (`read`):
248+
Retrieve the configuration files for a given project.
249+
- `guess_projects_configs` (`write`):
250+
Generate suggestions for changes to config files based on an OpenAPI spec.
241251

242252
### Resource `builds`:
243253

244-
- `create_builds` (`write`): Create a new build
245-
- `retrieve_builds` (`read`): Retrieve a build by ID
246-
- `list_builds` (`read`): List builds for a project
254+
- `create_builds` (`write`): Create a build, on top of a project branch, against a given input revision.
255+
256+
The project branch will be modified so that its latest set of config files
257+
points to the one specified by the input revision.
258+
259+
- `retrieve_builds` (`read`): Retrieve a build by its ID.
260+
- `list_builds` (`read`): List user-triggered builds for a given project.
261+
262+
An optional revision can be specified to filter by config commit SHA, or
263+
hashes of file contents.
247264

248265
### Resource `builds.diagnostics`:
249266

250-
- `list_builds_diagnostics` (`read`): Get diagnostics for a build
267+
- `list_builds_diagnostics` (`read`): Get the list of diagnostics for a given build.
268+
269+
If no language targets are specified, diagnostics for all languages are returned.
251270

252271
### Resource `builds.target_outputs`:
253272

254-
- `retrieve_builds_target_outputs` (`read`): Download the output of a build target
273+
- `retrieve_builds_target_outputs` (`read`): Retrieve a method to download an output for a given build target.
274+
275+
If the requested type of output is `source`, and the requested output
276+
method is `url`, a download link to a tarball of the source files is
277+
returned. If the requested output method is `git`, a Git remote, ref,
278+
and access token (if necessary) is returned.
279+
280+
Otherwise, the possible types of outputs are specific to the requested
281+
target, and the output method _must_ be `url`. See the documentation for
282+
`type` for more information.
255283

256284
### Resource `orgs`:
257285

258-
- `retrieve_orgs` (`read`): Retrieve an organization by name
259-
- `list_orgs` (`read`): List organizations the user has access to
286+
- `retrieve_orgs` (`read`): Retrieve an organization by name.
287+
- `list_orgs` (`read`): List organizations accessible to the current authentication method.

0 commit comments

Comments
 (0)