diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml new file mode 100644 index 0000000..c14c3f7 --- /dev/null +++ b/.github/workflows/publish-npm.yml @@ -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 }} diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml new file mode 100644 index 0000000..dd03026 --- /dev/null +++ b/.github/workflows/release-doctor.yml @@ -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 }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..67dcd73 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.0.1-alpha.0" +} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d585f4d..6c5fd6a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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://git@github.com:stainless-sdks/honcho-node.git +npm install git+ssh://git@github.com: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 diff --git a/README.md b/README.md index dcd0ed7..47cdbac 100644 --- a/README.md +++ b/README.md @@ -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://git@github.com: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). ```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 ```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 => { @@ -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. diff --git a/bin/check-release-environment b/bin/check-release-environment new file mode 100644 index 0000000..0a16e29 --- /dev/null +++ b/bin/check-release-environment @@ -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!" diff --git a/jest.config.ts b/jest.config.ts index 0b5e735..751cc62 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -7,9 +7,9 @@ const config: JestConfigWithTsJest = { '^.+\\.(t|j)sx?$': ['@swc/jest', { sourceMaps: 'inline' }], }, moduleNameMapper: { - '^honcho$': '/src/index.ts', - '^honcho/_shims/auto/(.*)$': '/src/_shims/auto/$1-node', - '^honcho/(.*)$': '/src/$1', + '^honcho-ai$': '/src/index.ts', + '^honcho-ai/_shims/auto/(.*)$': '/src/_shims/auto/$1-node', + '^honcho-ai/(.*)$': '/src/$1', }, modulePathIgnorePatterns: [ '/ecosystem-tests/', diff --git a/package.json b/package.json index 3d09bc3..77c7c30 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "honcho", + "name": "honcho-ai", "version": "0.0.1-alpha.0", "description": "The official TypeScript library for the Honcho API", "author": "Honcho ", @@ -61,8 +61,8 @@ "./shims/web.mjs" ], "imports": { - "honcho": ".", - "honcho/*": "./src/*" + "honcho-ai": ".", + "honcho-ai/*": "./src/*" }, "exports": { "./_shims/auto/*": { diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..624ed99 --- /dev/null +++ b/release-please-config.json @@ -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" + ] +} diff --git a/scripts/build b/scripts/build index 6db7e2e..4c05d10 100755 --- a/scripts/build +++ b/scripts/build @@ -8,7 +8,7 @@ node scripts/utils/check-version.cjs # Build into dist and will publish the package from there, # so that src/resources/foo.ts becomes /resources/foo.js -# This way importing from `"honcho/resources/foo"` works +# This way importing from `"honcho-ai/resources/foo"` works # even with `"moduleResolution": "node"` rm -rf dist; mkdir dist @@ -47,8 +47,8 @@ node scripts/utils/postprocess-files.cjs # make sure that nothing crashes when we require the output CJS or # import the output ESM -(cd dist && node -e 'require("honcho")') -(cd dist && node -e 'import("honcho")' --input-type=module) +(cd dist && node -e 'require("honcho-ai")') +(cd dist && node -e 'import("honcho-ai")' --input-type=module) if command -v deno &> /dev/null && [ -e ./scripts/build-deno ] then diff --git a/scripts/utils/postprocess-files.cjs b/scripts/utils/postprocess-files.cjs index d8e0c91..1c79e83 100644 --- a/scripts/utils/postprocess-files.cjs +++ b/scripts/utils/postprocess-files.cjs @@ -2,7 +2,7 @@ const fs = require('fs'); const path = require('path'); const { parse } = require('@typescript-eslint/parser'); -const pkgImportPath = process.env['PKG_IMPORT_PATH'] ?? 'honcho/'; +const pkgImportPath = process.env['PKG_IMPORT_PATH'] ?? 'honcho-ai/'; const distDir = process.env['DIST_PATH'] ? @@ -142,7 +142,7 @@ async function postprocess() { if (file.endsWith('.d.ts')) { // work around bad tsc behavior - // if we have `import { type Readable } from 'honcho/_shims/index'`, + // if we have `import { type Readable } from 'honcho-ai/_shims/index'`, // tsc sometimes replaces `Readable` with `import("stream").Readable` inline // in the output .d.ts transformed = transformed.replace(/import\("stream"\).Readable/g, 'Readable'); diff --git a/src/_shims/README.md b/src/_shims/README.md index 5ff23fe..ef0d8c2 100644 --- a/src/_shims/README.md +++ b/src/_shims/README.md @@ -1,9 +1,9 @@ # 👋 Wondering what everything in here does? -`honcho` supports a wide variety of runtime environments like Node.js, Deno, Bun, browsers, and various +`honcho-ai` supports a wide variety of runtime environments like Node.js, Deno, Bun, browsers, and various edge runtimes, as well as both CommonJS (CJS) and EcmaScript Modules (ESM). -To do this, `honcho` provides shims for either using `node-fetch` when in Node (because `fetch` is still experimental there) or the global `fetch` API built into the environment when not in Node. +To do this, `honcho-ai` provides shims for either using `node-fetch` when in Node (because `fetch` is still experimental there) or the global `fetch` API built into the environment when not in Node. It uses [conditional exports](https://nodejs.org/api/packages.html#conditional-exports) to automatically select the correct shims for each environment. However, conditional exports are a fairly new @@ -15,32 +15,32 @@ getting the wrong raw `Response` type from `.asResponse()`, for example. The user can work around these issues by manually importing one of: -- `import 'honcho/shims/node'` -- `import 'honcho/shims/web'` +- `import 'honcho-ai/shims/node'` +- `import 'honcho-ai/shims/web'` All of the code here in `_shims` handles selecting the automatic default shims or manual overrides. ### How it works - Runtime -Runtime shims get installed by calling `setShims` exported by `honcho/_shims/registry`. +Runtime shims get installed by calling `setShims` exported by `honcho-ai/_shims/registry`. -Manually importing `honcho/shims/node` or `honcho/shims/web`, calls `setShims` with the respective runtime shims. +Manually importing `honcho-ai/shims/node` or `honcho-ai/shims/web`, calls `setShims` with the respective runtime shims. -All client code imports shims from `honcho/_shims/index`, which: +All client code imports shims from `honcho-ai/_shims/index`, which: - checks if shims have been set manually -- if not, calls `setShims` with the shims from `honcho/_shims/auto/runtime` -- re-exports the installed shims from `honcho/_shims/registry`. +- if not, calls `setShims` with the shims from `honcho-ai/_shims/auto/runtime` +- re-exports the installed shims from `honcho-ai/_shims/registry`. -`honcho/_shims/auto/runtime` exports web runtime shims. -If the `node` export condition is set, the export map replaces it with `honcho/_shims/auto/runtime-node`. +`honcho-ai/_shims/auto/runtime` exports web runtime shims. +If the `node` export condition is set, the export map replaces it with `honcho-ai/_shims/auto/runtime-node`. ### How it works - Type time -All client code imports shim types from `honcho/_shims/index`, which selects the manual types from `honcho/_shims/manual-types` if they have been declared, otherwise it exports the auto types from `honcho/_shims/auto/types`. +All client code imports shim types from `honcho-ai/_shims/index`, which selects the manual types from `honcho-ai/_shims/manual-types` if they have been declared, otherwise it exports the auto types from `honcho-ai/_shims/auto/types`. -`honcho/_shims/manual-types` exports an empty namespace. -Manually importing `honcho/shims/node` or `honcho/shims/web` merges declarations into this empty namespace, so they get picked up by `honcho/_shims/index`. +`honcho-ai/_shims/manual-types` exports an empty namespace. +Manually importing `honcho-ai/shims/node` or `honcho-ai/shims/web` merges declarations into this empty namespace, so they get picked up by `honcho-ai/_shims/index`. -`honcho/_shims/auto/types` exports web type definitions. -If the `node` export condition is set, the export map replaces it with `honcho/_shims/auto/types-node`, though TS only picks this up if `"moduleResolution": "nodenext"` or `"moduleResolution": "bundler"`. +`honcho-ai/_shims/auto/types` exports web type definitions. +If the `node` export condition is set, the export map replaces it with `honcho-ai/_shims/auto/types-node`, though TS only picks this up if `"moduleResolution": "nodenext"` or `"moduleResolution": "bundler"`. diff --git a/src/_shims/index-deno.ts b/src/_shims/index-deno.ts index a808c85..20c709c 100644 --- a/src/_shims/index-deno.ts +++ b/src/_shims/index-deno.ts @@ -79,7 +79,7 @@ export function getDefaultAgent(url: string) { } export function fileFromPath() { throw new Error( - 'The `fileFromPath` function is only supported in Node. See the README for more details: https://www.github.com/stainless-sdks/honcho-node#file-uploads', + 'The `fileFromPath` function is only supported in Node. See the README for more details: https://www.github.com/plastic-labs/honcho-node#file-uploads', ); } diff --git a/src/_shims/index.d.ts b/src/_shims/index.d.ts index 13f102a..e0a4587 100644 --- a/src/_shims/index.d.ts +++ b/src/_shims/index.d.ts @@ -2,7 +2,7 @@ * Disclaimer: modules in _shims aren't intended to be imported by SDK users. */ import { manual } from './manual-types'; -import * as auto from 'honcho/_shims/auto/types'; +import * as auto from 'honcho-ai/_shims/auto/types'; import { type RequestOptions } from '../core'; type SelectType = unknown extends Manual ? Auto : Manual; diff --git a/src/_shims/index.js b/src/_shims/index.js index dc692ed..017f781 100644 --- a/src/_shims/index.js +++ b/src/_shims/index.js @@ -2,7 +2,7 @@ * Disclaimer: modules in _shims aren't intended to be imported by SDK users. */ const shims = require('./registry'); -const auto = require('honcho/_shims/auto/runtime'); +const auto = require('honcho-ai/_shims/auto/runtime'); if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true }); for (const property of Object.keys(shims)) { Object.defineProperty(exports, property, { diff --git a/src/_shims/index.mjs b/src/_shims/index.mjs index 8442380..a1391a4 100644 --- a/src/_shims/index.mjs +++ b/src/_shims/index.mjs @@ -2,6 +2,6 @@ * Disclaimer: modules in _shims aren't intended to be imported by SDK users. */ import * as shims from './registry.mjs'; -import * as auto from 'honcho/_shims/auto/runtime'; +import * as auto from 'honcho-ai/_shims/auto/runtime'; if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true }); export * from './registry.mjs'; diff --git a/src/_shims/manual-types.d.ts b/src/_shims/manual-types.d.ts index 32a4ba3..1501772 100644 --- a/src/_shims/manual-types.d.ts +++ b/src/_shims/manual-types.d.ts @@ -4,8 +4,8 @@ /** * Types will get added to this namespace when you import one of the following: * - * import 'honcho/shims/node' - * import 'honcho/shims/web' + * import 'honcho-ai/shims/node' + * import 'honcho-ai/shims/web' * * Importing more than one will cause type and runtime errors. */ diff --git a/src/_shims/registry.ts b/src/_shims/registry.ts index ced84aa..ebea666 100644 --- a/src/_shims/registry.ts +++ b/src/_shims/registry.ts @@ -42,11 +42,13 @@ export let isFsReadStream: Shims['isFsReadStream'] | undefined = undefined; export function setShims(shims: Shims, options: { auto: boolean } = { auto: false }) { if (auto) { throw new Error( - `you must \`import 'honcho/shims/${shims.kind}'\` before importing anything else from honcho`, + `you must \`import 'honcho-ai/shims/${shims.kind}'\` before importing anything else from honcho-ai`, ); } if (kind) { - throw new Error(`can't \`import 'honcho/shims/${shims.kind}'\` after \`import 'honcho/shims/${kind}'\``); + throw new Error( + `can't \`import 'honcho-ai/shims/${shims.kind}'\` after \`import 'honcho-ai/shims/${kind}'\``, + ); } auto = options.auto; kind = shims.kind; diff --git a/src/_shims/web-runtime.ts b/src/_shims/web-runtime.ts index 037cbf6..afe73a5 100644 --- a/src/_shims/web-runtime.ts +++ b/src/_shims/web-runtime.ts @@ -9,9 +9,9 @@ export function getRuntime({ manuallyImported }: { manuallyImported?: boolean } const recommendation = manuallyImported ? `You may need to use polyfills` - : `Add one of these imports before your first \`import … from 'honcho'\`: -- \`import 'honcho/shims/node'\` (if you're running on Node) -- \`import 'honcho/shims/web'\` (otherwise) + : `Add one of these imports before your first \`import … from 'honcho-ai'\`: +- \`import 'honcho-ai/shims/node'\` (if you're running on Node) +- \`import 'honcho-ai/shims/web'\` (otherwise) `; let _fetch, _Request, _Response, _Headers; @@ -95,7 +95,7 @@ export function getRuntime({ manuallyImported }: { manuallyImported?: boolean } getDefaultAgent: (url: string) => undefined, fileFromPath: () => { throw new Error( - 'The `fileFromPath` function is only supported in Node. See the README for more details: https://www.github.com/stainless-sdks/honcho-node#file-uploads', + 'The `fileFromPath` function is only supported in Node. See the README for more details: https://www.github.com/plastic-labs/honcho-node#file-uploads', ); }, isFsReadStream: (value: any) => false, diff --git a/src/core.ts b/src/core.ts index 78a1e55..bed42d6 100644 --- a/src/core.ts +++ b/src/core.ts @@ -97,9 +97,9 @@ export class APIPromise extends Promise { * * 👋 Getting the wrong TypeScript type for `Response`? * Try setting `"moduleResolution": "NodeNext"` if you can, - * or add one of these imports before your first `import … from 'honcho'`: - * - `import 'honcho/shims/node'` (if you're running on Node) - * - `import 'honcho/shims/web'` (otherwise) + * or add one of these imports before your first `import … from 'honcho-ai'`: + * - `import 'honcho-ai/shims/node'` (if you're running on Node) + * - `import 'honcho-ai/shims/web'` (otherwise) */ asResponse(): Promise { return this.responsePromise.then((p) => p.response); @@ -113,9 +113,9 @@ export class APIPromise extends Promise { * * 👋 Getting the wrong TypeScript type for `Response`? * Try setting `"moduleResolution": "NodeNext"` if you can, - * or add one of these imports before your first `import … from 'honcho'`: - * - `import 'honcho/shims/node'` (if you're running on Node) - * - `import 'honcho/shims/web'` (otherwise) + * or add one of these imports before your first `import … from 'honcho-ai'`: + * - `import 'honcho-ai/shims/node'` (if you're running on Node) + * - `import 'honcho-ai/shims/web'` (otherwise) */ async withResponse(): Promise<{ data: T; response: Response }> { const [data, response] = await Promise.all([this.parse(), this.asResponse()]); diff --git a/src/index.ts b/src/index.ts index 28c5298..17335eb 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,8 +4,8 @@ import * as Core from './core'; import * as Errors from './error'; import { type Agent } from './_shims/index'; import * as Uploads from './uploads'; -import * as Pagination from 'honcho/pagination'; -import * as API from 'honcho/resources/index'; +import * as Pagination from 'honcho-ai/pagination'; +import * as API from 'honcho-ai/resources/index'; const environments = { local: 'http://localhost:8000', diff --git a/src/resources/apps/apps.ts b/src/resources/apps/apps.ts index 23623da..8216f21 100644 --- a/src/resources/apps/apps.ts +++ b/src/resources/apps/apps.ts @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'honcho/core'; -import { APIResource } from 'honcho/resource'; -import * as AppsAPI from 'honcho/resources/apps/apps'; -import * as UsersAPI from 'honcho/resources/apps/users/users'; +import * as Core from 'honcho-ai/core'; +import { APIResource } from 'honcho-ai/resource'; +import * as AppsAPI from 'honcho-ai/resources/apps/apps'; +import * as UsersAPI from 'honcho-ai/resources/apps/users/users'; export class Apps extends APIResource { users: UsersAPI.Users = new UsersAPI.Users(this._client); diff --git a/src/resources/apps/users/collections/collections.ts b/src/resources/apps/users/collections/collections.ts index 6f43779..cecccce 100644 --- a/src/resources/apps/users/collections/collections.ts +++ b/src/resources/apps/users/collections/collections.ts @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'honcho/core'; -import { APIResource } from 'honcho/resource'; -import { isRequestOptions } from 'honcho/core'; -import * as CollectionsAPI from 'honcho/resources/apps/users/collections/collections'; -import * as DocumentsAPI from 'honcho/resources/apps/users/collections/documents'; -import { Page, type PageParams } from 'honcho/pagination'; +import * as Core from 'honcho-ai/core'; +import { APIResource } from 'honcho-ai/resource'; +import { isRequestOptions } from 'honcho-ai/core'; +import * as CollectionsAPI from 'honcho-ai/resources/apps/users/collections/collections'; +import * as DocumentsAPI from 'honcho-ai/resources/apps/users/collections/documents'; +import { Page, type PageParams } from 'honcho-ai/pagination'; export class Collections extends APIResource { documents: DocumentsAPI.Documents = new DocumentsAPI.Documents(this._client); diff --git a/src/resources/apps/users/collections/documents.ts b/src/resources/apps/users/collections/documents.ts index 876bad0..974245c 100644 --- a/src/resources/apps/users/collections/documents.ts +++ b/src/resources/apps/users/collections/documents.ts @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'honcho/core'; -import { APIResource } from 'honcho/resource'; -import { isRequestOptions } from 'honcho/core'; -import * as DocumentsAPI from 'honcho/resources/apps/users/collections/documents'; -import { Page, type PageParams } from 'honcho/pagination'; +import * as Core from 'honcho-ai/core'; +import { APIResource } from 'honcho-ai/resource'; +import { isRequestOptions } from 'honcho-ai/core'; +import * as DocumentsAPI from 'honcho-ai/resources/apps/users/collections/documents'; +import { Page, type PageParams } from 'honcho-ai/pagination'; export class Documents extends APIResource { /** diff --git a/src/resources/apps/users/sessions/messages.ts b/src/resources/apps/users/sessions/messages.ts index a861de9..e9431ae 100644 --- a/src/resources/apps/users/sessions/messages.ts +++ b/src/resources/apps/users/sessions/messages.ts @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'honcho/core'; -import { APIResource } from 'honcho/resource'; -import { isRequestOptions } from 'honcho/core'; -import * as MessagesAPI from 'honcho/resources/apps/users/sessions/messages'; -import { Page, type PageParams } from 'honcho/pagination'; +import * as Core from 'honcho-ai/core'; +import { APIResource } from 'honcho-ai/resource'; +import { isRequestOptions } from 'honcho-ai/core'; +import * as MessagesAPI from 'honcho-ai/resources/apps/users/sessions/messages'; +import { Page, type PageParams } from 'honcho-ai/pagination'; export class Messages extends APIResource { /** diff --git a/src/resources/apps/users/sessions/metamessages.ts b/src/resources/apps/users/sessions/metamessages.ts index cfd91e4..bfebfdc 100644 --- a/src/resources/apps/users/sessions/metamessages.ts +++ b/src/resources/apps/users/sessions/metamessages.ts @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'honcho/core'; -import { APIResource } from 'honcho/resource'; -import { isRequestOptions } from 'honcho/core'; -import * as MetamessagesAPI from 'honcho/resources/apps/users/sessions/metamessages'; -import { Page, type PageParams } from 'honcho/pagination'; +import * as Core from 'honcho-ai/core'; +import { APIResource } from 'honcho-ai/resource'; +import { isRequestOptions } from 'honcho-ai/core'; +import * as MetamessagesAPI from 'honcho-ai/resources/apps/users/sessions/metamessages'; +import { Page, type PageParams } from 'honcho-ai/pagination'; export class Metamessages extends APIResource { /** diff --git a/src/resources/apps/users/sessions/sessions.ts b/src/resources/apps/users/sessions/sessions.ts index 4bb8ba8..7e7d8dd 100644 --- a/src/resources/apps/users/sessions/sessions.ts +++ b/src/resources/apps/users/sessions/sessions.ts @@ -1,12 +1,12 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'honcho/core'; -import { APIResource } from 'honcho/resource'; -import { isRequestOptions } from 'honcho/core'; -import * as SessionsAPI from 'honcho/resources/apps/users/sessions/sessions'; -import * as MessagesAPI from 'honcho/resources/apps/users/sessions/messages'; -import * as MetamessagesAPI from 'honcho/resources/apps/users/sessions/metamessages'; -import { Page, type PageParams } from 'honcho/pagination'; +import * as Core from 'honcho-ai/core'; +import { APIResource } from 'honcho-ai/resource'; +import { isRequestOptions } from 'honcho-ai/core'; +import * as SessionsAPI from 'honcho-ai/resources/apps/users/sessions/sessions'; +import * as MessagesAPI from 'honcho-ai/resources/apps/users/sessions/messages'; +import * as MetamessagesAPI from 'honcho-ai/resources/apps/users/sessions/metamessages'; +import { Page, type PageParams } from 'honcho-ai/pagination'; export class Sessions extends APIResource { messages: MessagesAPI.Messages = new MessagesAPI.Messages(this._client); diff --git a/src/resources/apps/users/users.ts b/src/resources/apps/users/users.ts index 54bbc86..1de0172 100644 --- a/src/resources/apps/users/users.ts +++ b/src/resources/apps/users/users.ts @@ -1,12 +1,12 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'honcho/core'; -import { APIResource } from 'honcho/resource'; -import { isRequestOptions } from 'honcho/core'; -import * as UsersAPI from 'honcho/resources/apps/users/users'; -import * as CollectionsAPI from 'honcho/resources/apps/users/collections/collections'; -import * as SessionsAPI from 'honcho/resources/apps/users/sessions/sessions'; -import { Page, type PageParams } from 'honcho/pagination'; +import * as Core from 'honcho-ai/core'; +import { APIResource } from 'honcho-ai/resource'; +import { isRequestOptions } from 'honcho-ai/core'; +import * as UsersAPI from 'honcho-ai/resources/apps/users/users'; +import * as CollectionsAPI from 'honcho-ai/resources/apps/users/collections/collections'; +import * as SessionsAPI from 'honcho-ai/resources/apps/users/sessions/sessions'; +import { Page, type PageParams } from 'honcho-ai/pagination'; export class Users extends APIResource { sessions: SessionsAPI.Sessions = new SessionsAPI.Sessions(this._client); diff --git a/src/version.ts b/src/version.ts index 55a1a52..db692bc 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.0.1-alpha.0'; +export const VERSION = '0.0.1-alpha.0'; // x-release-please-version diff --git a/tests/api-resources/apps/apps.test.ts b/tests/api-resources/apps/apps.test.ts index 7b653f3..48df46c 100644 --- a/tests/api-resources/apps/apps.test.ts +++ b/tests/api-resources/apps/apps.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Honcho from 'honcho'; +import Honcho from 'honcho-ai'; import { Response } from 'node-fetch'; const honcho = new Honcho({ diff --git a/tests/api-resources/apps/users/collections/collections.test.ts b/tests/api-resources/apps/users/collections/collections.test.ts index d6ddcc6..de9944d 100644 --- a/tests/api-resources/apps/users/collections/collections.test.ts +++ b/tests/api-resources/apps/users/collections/collections.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Honcho from 'honcho'; +import Honcho from 'honcho-ai'; import { Response } from 'node-fetch'; const honcho = new Honcho({ diff --git a/tests/api-resources/apps/users/collections/documents.test.ts b/tests/api-resources/apps/users/collections/documents.test.ts index 85d49fe..e8a5330 100644 --- a/tests/api-resources/apps/users/collections/documents.test.ts +++ b/tests/api-resources/apps/users/collections/documents.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Honcho from 'honcho'; +import Honcho from 'honcho-ai'; import { Response } from 'node-fetch'; const honcho = new Honcho({ diff --git a/tests/api-resources/apps/users/sessions/messages.test.ts b/tests/api-resources/apps/users/sessions/messages.test.ts index e15ff54..0dfb7a6 100644 --- a/tests/api-resources/apps/users/sessions/messages.test.ts +++ b/tests/api-resources/apps/users/sessions/messages.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Honcho from 'honcho'; +import Honcho from 'honcho-ai'; import { Response } from 'node-fetch'; const honcho = new Honcho({ diff --git a/tests/api-resources/apps/users/sessions/metamessages.test.ts b/tests/api-resources/apps/users/sessions/metamessages.test.ts index 5957a11..d40414e 100644 --- a/tests/api-resources/apps/users/sessions/metamessages.test.ts +++ b/tests/api-resources/apps/users/sessions/metamessages.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Honcho from 'honcho'; +import Honcho from 'honcho-ai'; import { Response } from 'node-fetch'; const honcho = new Honcho({ diff --git a/tests/api-resources/apps/users/sessions/sessions.test.ts b/tests/api-resources/apps/users/sessions/sessions.test.ts index 04372a4..4eb0923 100644 --- a/tests/api-resources/apps/users/sessions/sessions.test.ts +++ b/tests/api-resources/apps/users/sessions/sessions.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Honcho from 'honcho'; +import Honcho from 'honcho-ai'; import { Response } from 'node-fetch'; const honcho = new Honcho({ diff --git a/tests/api-resources/apps/users/users.test.ts b/tests/api-resources/apps/users/users.test.ts index bea3eb2..aa7a951 100644 --- a/tests/api-resources/apps/users/users.test.ts +++ b/tests/api-resources/apps/users/users.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Honcho from 'honcho'; +import Honcho from 'honcho-ai'; import { Response } from 'node-fetch'; const honcho = new Honcho({ diff --git a/tests/form.test.ts b/tests/form.test.ts index d0412be..2f922e0 100644 --- a/tests/form.test.ts +++ b/tests/form.test.ts @@ -1,6 +1,6 @@ -import { multipartFormRequestOptions, createForm } from 'honcho/core'; -import { Blob } from 'honcho/_shims/index'; -import { toFile } from 'honcho'; +import { multipartFormRequestOptions, createForm } from 'honcho-ai/core'; +import { Blob } from 'honcho-ai/_shims/index'; +import { toFile } from 'honcho-ai'; describe('form data validation', () => { test('valid values do not error', async () => { diff --git a/tests/index.test.ts b/tests/index.test.ts index ef6a41e..c077c5c 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Honcho from 'honcho'; -import { APIUserAbortError } from 'honcho'; -import { Headers } from 'honcho/core'; +import Honcho from 'honcho-ai'; +import { APIUserAbortError } from 'honcho-ai'; +import { Headers } from 'honcho-ai/core'; import defaultFetch, { Response, type RequestInit, type RequestInfo } from 'node-fetch'; describe('instantiate client', () => { diff --git a/tests/responses.test.ts b/tests/responses.test.ts index cc29ab0..d037c23 100644 --- a/tests/responses.test.ts +++ b/tests/responses.test.ts @@ -1,5 +1,5 @@ -import { createResponseHeaders } from 'honcho/core'; -import { Headers } from 'honcho/_shims/index'; +import { createResponseHeaders } from 'honcho-ai/core'; +import { Headers } from 'honcho-ai/_shims/index'; describe('response parsing', () => { // TODO: test unicode characters diff --git a/tests/stringifyQuery.test.ts b/tests/stringifyQuery.test.ts index b41b8d7..bee9edc 100644 --- a/tests/stringifyQuery.test.ts +++ b/tests/stringifyQuery.test.ts @@ -1,4 +1,4 @@ -import { APIClient } from 'honcho/core'; +import { APIClient } from 'honcho-ai/core'; const { stringifyQuery } = APIClient.prototype as any; diff --git a/tests/uploads.test.ts b/tests/uploads.test.ts index d2f2415..6bda430 100644 --- a/tests/uploads.test.ts +++ b/tests/uploads.test.ts @@ -1,6 +1,6 @@ import fs from 'fs'; -import { toFile, type ResponseLike } from 'honcho/uploads'; -import { File } from 'honcho/_shims/index'; +import { toFile, type ResponseLike } from 'honcho-ai/uploads'; +import { File } from 'honcho-ai/_shims/index'; class MyClass { name: string = 'foo'; diff --git a/tsconfig.build.json b/tsconfig.build.json index 1837cdb..17390a4 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -5,8 +5,8 @@ "compilerOptions": { "rootDir": "./dist/src", "paths": { - "honcho/*": ["dist/src/*"], - "honcho": ["dist/src/index.ts"], + "honcho-ai/*": ["dist/src/*"], + "honcho-ai": ["dist/src/index.ts"], }, "noEmit": false, "declaration": true, diff --git a/tsconfig.deno.json b/tsconfig.deno.json index 5c37192..ea3e86c 100644 --- a/tsconfig.deno.json +++ b/tsconfig.deno.json @@ -6,9 +6,9 @@ "rootDir": "./deno", "lib": ["es2020", "DOM"], "paths": { - "honcho/_shims/auto/*": ["deno/_shims/auto/*-deno"], - "honcho/*": ["deno/*"], - "honcho": ["deno/index.ts"], + "honcho-ai/_shims/auto/*": ["deno/_shims/auto/*-deno"], + "honcho-ai/*": ["deno/*"], + "honcho-ai": ["deno/index.ts"], }, "noEmit": true, "declaration": true, diff --git a/tsconfig.json b/tsconfig.json index de575dc..2665dd2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,9 +9,9 @@ "esModuleInterop": true, "baseUrl": "./", "paths": { - "honcho/_shims/auto/*": ["src/_shims/auto/*-node"], - "honcho/*": ["src/*"], - "honcho": ["src/index.ts"], + "honcho-ai/_shims/auto/*": ["src/_shims/auto/*-node"], + "honcho-ai/*": ["src/*"], + "honcho-ai": ["src/index.ts"], }, "noEmit": true,