-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(api): update via SDK Studio (#1) * feat(api): OpenAPI spec update via Stainless API (#3) * release: 0.0.2-alpha.1 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
- Loading branch information
1 parent
0a7f648
commit 85558fd
Showing
46 changed files
with
314 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# This workflow is triggered when a GitHub release is created. | ||
# It can also be run manually to re-publish to NPM in case it failed for some reason. | ||
# You can run this workflow by navigating to https://www.github.com/plastic-labs/honcho-node/actions/workflows/publish-npm.yml | ||
name: Publish NPM | ||
on: | ||
workflow_dispatch: | ||
|
||
release: | ||
types: [published] | ||
|
||
jobs: | ||
publish: | ||
name: publish | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18' | ||
|
||
- name: Install dependencies | ||
run: | | ||
yarn install | ||
- name: Publish to NPM | ||
run: | | ||
bash ./bin/publish-npm | ||
env: | ||
NPM_TOKEN: ${{ secrets.HONCHO_NPM_TOKEN || secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Release Doctor | ||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
release_doctor: | ||
name: release doctor | ||
runs-on: ubuntu-latest | ||
if: github.repository == 'plastic-labs/honcho-node' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Check release environment | ||
run: | | ||
bash ./bin/check-release-environment | ||
env: | ||
NPM_TOKEN: ${{ secrets.HONCHO_NPM_TOKEN || secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
".": "0.0.2-alpha.1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
configured_endpoints: 38 | ||
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/plastic-labs%2Fhoncho-07e26700dbaad7ad4aa984bd22f3197f07b7d3dff9a68533c57d3f1244704218.yml | ||
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/plastic-labs%2FHoncho-a370506bdacaf58567fea52cb6312d99b0e211dd67c8d1ffb896fcf6abfee16b.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Changelog | ||
|
||
## 0.0.2-alpha.1 (2024-05-09) | ||
|
||
Full Changelog: [v0.0.1-alpha.0...v0.0.2-alpha.1](https://github.com/plastic-labs/honcho-node/compare/v0.0.1-alpha.0...v0.0.2-alpha.1) | ||
|
||
### Features | ||
|
||
* **api:** OpenAPI spec update via Stainless API ([#3](https://github.com/plastic-labs/honcho-node/issues/3)) ([92d65ac](https://github.com/plastic-labs/honcho-node/commit/92d65acee1b967d4a559ab2b4a5e9372f3637b91)) | ||
* **api:** update via SDK Studio ([477affd](https://github.com/plastic-labs/honcho-node/commit/477affdce431e0a3cfab0a89ed82d0a4d671cea5)) | ||
* **api:** update via SDK Studio ([f89689e](https://github.com/plastic-labs/honcho-node/commit/f89689ebdb4911691307b94b568fb6198526c479)) | ||
* **api:** update via SDK Studio ([048f079](https://github.com/plastic-labs/honcho-node/commit/048f0795a97dd4cef5c38cd1c806451ef9deec34)) | ||
* **api:** update via SDK Studio ([751cfec](https://github.com/plastic-labs/honcho-node/commit/751cfec21f9c88b3155bda870feef0d80672749d)) | ||
* **api:** update via SDK Studio ([39b1bdf](https://github.com/plastic-labs/honcho-node/commit/39b1bdfc363bedc97cf525a51c5d6217456f15fe)) | ||
* **api:** update via SDK Studio ([a11e02e](https://github.com/plastic-labs/honcho-node/commit/a11e02ee566310082ea0aea49ba89de7cf58e27e)) | ||
* **api:** update via SDK Studio ([0d0f698](https://github.com/plastic-labs/honcho-node/commit/0d0f69874484513a253134924e429da30d7c1bb5)) | ||
* **api:** update via SDK Studio ([0e24b7a](https://github.com/plastic-labs/honcho-node/commit/0e24b7a6e9a67c894da3f5ae9061216e60e5d9b0)) | ||
* **api:** update via SDK Studio ([6f4ae87](https://github.com/plastic-labs/honcho-node/commit/6f4ae87cffe7a3634516a131d96827991228579d)) | ||
* **api:** update via SDK Studio ([1a2fb6f](https://github.com/plastic-labs/honcho-node/commit/1a2fb6fcf78cbfe14a7919c7d32816a12ab4e4f9)) | ||
* **api:** update via SDK Studio ([34ea231](https://github.com/plastic-labs/honcho-node/commit/34ea231a852f513b536fbf9068147f301bfe9180)) | ||
* **api:** update via SDK Studio ([351afe1](https://github.com/plastic-labs/honcho-node/commit/351afe16e68ddc044057358a2dcd55fbd79cb151)) | ||
* **api:** update via SDK Studio ([85b3685](https://github.com/plastic-labs/honcho-node/commit/85b368508e3c201197db5dd3fc45f018f8f2e512)) | ||
* **api:** update via SDK Studio ([#1](https://github.com/plastic-labs/honcho-node/issues/1)) ([9531c0e](https://github.com/plastic-labs/honcho-node/commit/9531c0ea806202b70bc7a96752cd6e74a05b161b)) | ||
|
||
|
||
### Chores | ||
|
||
* update SDK settings ([0a7f648](https://github.com/plastic-labs/honcho-node/commit/0a7f648b3ec320898b8a8e60d6129ec4312b0d5f)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,25 +42,25 @@ If you’d like to use the repository from source, you can either install from g | |
To install via git: | ||
|
||
```bash | ||
npm install git+ssh://[email protected]:stainless-sdks/honcho-node.git | ||
npm install git+ssh://[email protected]:plastic-labs/honcho-node.git | ||
``` | ||
|
||
Alternatively, to link a local copy of the repo: | ||
|
||
```bash | ||
# Clone | ||
git clone https://www.github.com/stainless-sdks/honcho-node | ||
git clone https://www.github.com/plastic-labs/honcho-node | ||
cd honcho-node | ||
|
||
# With yarn | ||
yarn link | ||
cd ../my-package | ||
yarn link honcho | ||
yarn link honcho-ai | ||
|
||
# With pnpm | ||
pnpm link --global | ||
cd ../my-package | ||
pnpm link -—global honcho | ||
pnpm link -—global honcho-ai | ||
``` | ||
|
||
## Running tests | ||
|
@@ -99,7 +99,7 @@ the changes aren't made through the automated pipeline, you may want to make rel | |
|
||
### Publish with a GitHub workflow | ||
|
||
You can release to package managers by using [the `Publish NPM` GitHub action](https://www.github.com/stainless-sdks/honcho-node/actions/workflows/publish-npm.yml). This requires a setup organization or repository secret to be set up. | ||
You can release to package managers by using [the `Publish NPM` GitHub action](https://www.github.com/plastic-labs/honcho-node/actions/workflows/publish-npm.yml). This requires a setup organization or repository secret to be set up. | ||
|
||
### Publish manually | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Honcho Node API Library | ||
|
||
[![NPM version](https://img.shields.io/npm/v/honcho.svg)](https://npmjs.org/package/honcho) | ||
[![NPM version](https://img.shields.io/npm/v/honcho-ai.svg)](https://npmjs.org/package/honcho-ai) | ||
|
||
This library provides convenient access to the Honcho REST API from server-side TypeScript or JavaScript. | ||
|
||
|
@@ -11,19 +11,16 @@ It is generated with [Stainless](https://www.stainlessapi.com/). | |
## Installation | ||
|
||
```sh | ||
npm install git+ssh://[email protected]:stainless-sdks/honcho-node.git | ||
npm install honcho-ai | ||
``` | ||
|
||
> [!NOTE] | ||
> Once this package is [published to npm](https://app.stainlessapi.com/docs/guides/publish), this will become: `npm install honcho` | ||
## Usage | ||
|
||
The full API of this library can be found in [api.md](api.md). | ||
|
||
<!-- prettier-ignore --> | ||
```js | ||
import Honcho from 'honcho'; | ||
import Honcho from 'honcho-ai'; | ||
|
||
const honcho = new Honcho({ | ||
apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted | ||
|
@@ -45,7 +42,7 @@ This library includes TypeScript definitions for all request params and response | |
|
||
<!-- prettier-ignore --> | ||
```ts | ||
import Honcho from 'honcho'; | ||
import Honcho from 'honcho-ai'; | ||
|
||
const honcho = new Honcho({ | ||
apiKey: process.env['HONCHO_AUTH_TOKEN'], // This is the default and can be omitted | ||
|
@@ -247,12 +244,12 @@ add the following import before your first import `from "Honcho"`: | |
```ts | ||
// Tell TypeScript and the package to use the global web fetch instead of node-fetch. | ||
// Note, despite the name, this does not add any polyfills, but expects them to be provided if needed. | ||
import 'honcho/shims/web'; | ||
import Honcho from 'honcho'; | ||
import 'honcho-ai/shims/web'; | ||
import Honcho from 'honcho-ai'; | ||
``` | ||
|
||
To do the inverse, add `import "honcho/shims/node"` (which does import polyfills). | ||
This can also be useful if you are getting the wrong TypeScript types for `Response` ([more details](https://github.com/plastic-labs/tree/main/src/_shims#readme)). | ||
To do the inverse, add `import "honcho-ai/shims/node"` (which does import polyfills). | ||
This can also be useful if you are getting the wrong TypeScript types for `Response` ([more details](https://github.com/plastic-labs/honcho-node/tree/main/src/_shims#readme)). | ||
|
||
### Logging and middleware | ||
|
||
|
@@ -261,7 +258,7 @@ which can be used to inspect or alter the `Request` or `Response` before/after e | |
|
||
```ts | ||
import { fetch } from 'undici'; // as one example | ||
import Honcho from 'honcho'; | ||
import Honcho from 'honcho-ai'; | ||
|
||
const client = new Honcho({ | ||
fetch: async (url: RequestInfo, init?: RequestInit): Promise<Response> => { | ||
|
@@ -311,7 +308,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con | |
|
||
We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience. | ||
|
||
We are keen for your feedback; please open an [issue](https://www.github.com/stainless-sdks/honcho-node/issues) with questions, bugs, or suggestions. | ||
We are keen for your feedback; please open an [issue](https://www.github.com/plastic-labs/honcho-node/issues) with questions, bugs, or suggestions. | ||
|
||
## Requirements | ||
|
||
|
@@ -320,7 +317,7 @@ TypeScript >= 4.5 is supported. | |
The following runtimes are supported: | ||
|
||
- Node.js 18 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions. | ||
- Deno v1.28.0 or higher, using `import Honcho from "npm:honcho"`. | ||
- Deno v1.28.0 or higher, using `import Honcho from "npm:honcho-ai"`. | ||
- Bun 1.0 or later. | ||
- Cloudflare Workers. | ||
- Vercel Edge Runtime. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env bash | ||
|
||
warnings=() | ||
errors=() | ||
|
||
if [ -z "${NPM_TOKEN}" ]; then | ||
warnings+=("The HONCHO_NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets") | ||
fi | ||
|
||
lenWarnings=${#warnings[@]} | ||
|
||
if [[ lenWarnings -gt 0 ]]; then | ||
echo -e "Found the following warnings in the release environment:\n" | ||
|
||
for warning in "${warnings[@]}"; do | ||
echo -e "- $warning\n" | ||
done | ||
fi | ||
|
||
lenErrors=${#errors[@]} | ||
|
||
if [[ lenErrors -gt 0 ]]; then | ||
echo -e "Found the following errors in the release environment:\n" | ||
|
||
for error in "${errors[@]}"; do | ||
echo -e "- $error\n" | ||
done | ||
|
||
exit 1 | ||
fi | ||
|
||
echo "The environment is ready to push releases!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "honcho", | ||
"version": "0.0.1-alpha.0", | ||
"name": "honcho-ai", | ||
"version": "0.0.2-alpha.1", | ||
"description": "The official TypeScript library for the Honcho API", | ||
"author": "Honcho <[email protected]>", | ||
"types": "dist/index.d.ts", | ||
|
@@ -61,8 +61,8 @@ | |
"./shims/web.mjs" | ||
], | ||
"imports": { | ||
"honcho": ".", | ||
"honcho/*": "./src/*" | ||
"honcho-ai": ".", | ||
"honcho-ai/*": "./src/*" | ||
}, | ||
"exports": { | ||
"./_shims/auto/*": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{ | ||
"packages": { | ||
".": {} | ||
}, | ||
"$schema": "https://raw.githubusercontent.com/stainless-api/release-please/main/schemas/config.json", | ||
"include-v-in-tag": true, | ||
"include-component-in-tag": false, | ||
"versioning": "prerelease", | ||
"prerelease": true, | ||
"bump-minor-pre-major": true, | ||
"bump-patch-for-minor-pre-major": false, | ||
"pull-request-header": "Automated Release PR", | ||
"pull-request-title-pattern": "release: ${version}", | ||
"changelog-sections": [ | ||
{ | ||
"type": "feat", | ||
"section": "Features" | ||
}, | ||
{ | ||
"type": "fix", | ||
"section": "Bug Fixes" | ||
}, | ||
{ | ||
"type": "perf", | ||
"section": "Performance Improvements" | ||
}, | ||
{ | ||
"type": "revert", | ||
"section": "Reverts" | ||
}, | ||
{ | ||
"type": "chore", | ||
"section": "Chores" | ||
}, | ||
{ | ||
"type": "docs", | ||
"section": "Documentation" | ||
}, | ||
{ | ||
"type": "style", | ||
"section": "Styles" | ||
}, | ||
{ | ||
"type": "refactor", | ||
"section": "Refactors" | ||
}, | ||
{ | ||
"type": "test", | ||
"section": "Tests", | ||
"hidden": true | ||
}, | ||
{ | ||
"type": "build", | ||
"section": "Build System" | ||
}, | ||
{ | ||
"type": "ci", | ||
"section": "Continuous Integration", | ||
"hidden": true | ||
} | ||
], | ||
"release-type": "node", | ||
"extra-files": [ | ||
"src/version.ts", | ||
"README.md" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.