-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🌿 Fern Regeneration -- July 22, 2024 #6
Open
fern-api
wants to merge
1
commit into
main
Choose a base branch
from
fern-bot/07-22-2024-0720PM
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
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 @@ | ||
# Specify files that shouldn't be modified by Fern |
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,30 @@ | ||
name: ci | ||
|
||
on: [push] | ||
|
||
jobs: | ||
compile: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up node | ||
uses: actions/setup-node@v3 | ||
|
||
- name: Compile | ||
run: yarn && yarn build | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up node | ||
uses: actions/setup-node@v3 | ||
|
||
- name: Compile | ||
run: yarn && yarn test |
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 @@ | ||
node_modules | ||
.DS_Store | ||
/dist |
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,9 @@ | ||
node_modules | ||
src | ||
tests | ||
.gitignore | ||
.github | ||
.fernignore | ||
.prettierrc.yml | ||
tsconfig.json | ||
yarn.lock |
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,2 @@ | ||
tabWidth: 4 | ||
printWidth: 120 |
This file was deleted.
Oops, something went wrong.
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,137 @@ | ||
# Gooey TypeScript Library | ||
|
||
[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-SDK%20generated%20by%20Fern-brightgreen)](https://github.com/fern-api/fern) | ||
[![npm shield](https://img.shields.io/npm/v/gooey)](https://www.npmjs.com/package/gooey) | ||
|
||
The Gooey TypeScript library provides convenient access to the Gooey API from TypeScript. | ||
|
||
## Installation | ||
|
||
```sh | ||
npm i -s gooey | ||
``` | ||
|
||
## Usage | ||
|
||
Instantiate and use the client with the following: | ||
|
||
```typescript | ||
import { GooeyClient } from "gooey"; | ||
|
||
const client = new GooeyClient({ authorization: "YOUR_AUTHORIZATION" }); | ||
await client.copilotIntegrations.videoBotsStreamCreate({ | ||
integrationId: "integration_id", | ||
}); | ||
``` | ||
|
||
## Request And Response Types | ||
|
||
The SDK exports all request and response types as TypeScript interfaces. Simply import them with the | ||
following namespace: | ||
|
||
```typescript | ||
import { Gooey } from "gooey"; | ||
|
||
const request: Gooey.CreateStreamRequest = { | ||
... | ||
}; | ||
``` | ||
|
||
## Exception Handling | ||
|
||
When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error | ||
will be thrown. | ||
|
||
```typescript | ||
import { GooeyError } from "gooey"; | ||
|
||
try { | ||
await client.copilotIntegrations.videoBotsStreamCreate(...); | ||
} catch (err) { | ||
if (err instanceof GooeyError) { | ||
console.log(err.statusCode); | ||
console.log(err.message); | ||
console.log(err.body); | ||
} | ||
} | ||
``` | ||
|
||
## Advanced | ||
|
||
### Retries | ||
|
||
The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long | ||
as the request is deemed retriable and the number of retry attempts has not grown larger than the configured | ||
retry limit (default: 2). | ||
|
||
A request is deemed retriable when any of the following HTTP status codes is returned: | ||
|
||
- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout) | ||
- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests) | ||
- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors) | ||
|
||
Use the `maxRetries` request option to configure this behavior. | ||
|
||
```typescript | ||
const response = await client.copilotIntegrations.videoBotsStreamCreate(..., { | ||
maxRetries: 0 // override maxRetries at the request level | ||
}); | ||
``` | ||
|
||
### Timeouts | ||
|
||
The SDK defaults to a 60 second timeout. Use the `timeoutInSeconds` option to configure this behavior. | ||
|
||
```typescript | ||
const response = await client.copilotIntegrations.videoBotsStreamCreate(..., { | ||
timeoutInSeconds: 30 // override timeout to 30s | ||
}); | ||
``` | ||
|
||
### Aborting Requests | ||
|
||
The SDK allows users to abort requests at any point by passing in an abort signal. | ||
|
||
```typescript | ||
const controller = new AbortController(); | ||
const response = await client.copilotIntegrations.videoBotsStreamCreate(..., { | ||
abortSignal: controller.signal | ||
}); | ||
controller.abort(); // aborts the request | ||
``` | ||
|
||
### Runtime Compatibility | ||
|
||
The SDK defaults to `node-fetch` but will use the global fetch client if present. The SDK works in the following | ||
runtimes: | ||
|
||
- Node.js 18+ | ||
- Vercel | ||
- Cloudflare Workers | ||
- Deno v1.25+ | ||
- Bun 1.0+ | ||
- React Native | ||
|
||
### Customizing Fetch Client | ||
|
||
The SDK provides a way for your to customize the underlying HTTP client / Fetch function. If you're running in an | ||
unsupported environment, this provides a way for you to break glass and ensure the SDK works. | ||
|
||
```typescript | ||
import { GooeyClient } from "gooey"; | ||
|
||
const client = new GooeyClient({ | ||
... | ||
fetcher: // provide your implementation here | ||
}); | ||
``` | ||
|
||
## Contributing | ||
|
||
While we value open-source contributions to this SDK, this library is generated programmatically. | ||
Additions made directly to this library would have to be moved over to our generation code, | ||
otherwise they would be overwritten upon the next generated release. Feel free to open a PR as | ||
a proof of concept, but know that we will not be able to merge it as-is. We suggest opening | ||
an issue first to discuss with us! | ||
|
||
On the other hand, contributions to the README are always very welcome! |
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,5 @@ | ||
/** @type {import('jest').Config} */ | ||
module.exports = { | ||
preset: "ts-jest", | ||
testEnvironment: "node", | ||
}; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
usage should be more descriptive and have some use case that is demonstrated