Skip to content

Commit 546a526

Browse files
committed
SDK regeneration
1 parent 88a6651 commit 546a526

File tree

805 files changed

+40456
-201
lines changed

Some content is hidden

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

805 files changed

+40456
-201
lines changed

.fernignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Specify files that shouldn't be modified by Fern

.github/workflows/ci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: ci
2+
3+
on: [push]
4+
5+
jobs:
6+
compile:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout repo
11+
uses: actions/checkout@v3
12+
13+
- name: Set up node
14+
uses: actions/setup-node@v3
15+
16+
- name: Compile
17+
run: yarn && yarn build
18+
19+
test:
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Checkout repo
24+
uses: actions/checkout@v3
25+
26+
- name: Set up node
27+
uses: actions/setup-node@v3
28+
29+
- name: Compile
30+
run: yarn && yarn test

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
.DS_Store
3+
/dist

.npmignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
node_modules
2+
src
3+
tests
4+
.gitignore
5+
.github
6+
.fernignore
7+
.prettierrc.yml
8+
tsconfig.json
9+
yarn.lock

.prettierrc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
tabWidth: 4
2+
printWidth: 120

LICENSE

Lines changed: 0 additions & 201 deletions
This file was deleted.

README.md

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
# Gooey TypeScript Library
2+
3+
[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-SDK%20generated%20by%20Fern-brightgreen)](https://github.com/fern-api/fern)
4+
[![npm shield](https://img.shields.io/npm/v/gooey)](https://www.npmjs.com/package/gooey)
5+
6+
The Gooey TypeScript library provides convenient access to the Gooey API from TypeScript.
7+
8+
## Installation
9+
10+
```sh
11+
npm i -s gooey
12+
```
13+
14+
## Usage
15+
16+
Instantiate and use the client with the following:
17+
18+
```typescript
19+
import { GooeyClient } from "gooey";
20+
21+
const client = new GooeyClient({ environment: "YOUR_BASE_URL", authorization: "YOUR_AUTHORIZATION" });
22+
await client.copilotIntegrations.videoBotsStreamCreate({
23+
integrationId: "integration_id",
24+
});
25+
```
26+
27+
## Request And Response Types
28+
29+
The SDK exports all request and response types as TypeScript interfaces. Simply import them with the
30+
following namespace:
31+
32+
```typescript
33+
import { Gooey } from "gooey";
34+
35+
const request: Gooey.CreateStreamRequest = {
36+
...
37+
};
38+
```
39+
40+
## Exception Handling
41+
42+
When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
43+
will be thrown.
44+
45+
```typescript
46+
import { GooeyError } from "gooey";
47+
48+
try {
49+
await client.copilotIntegrations.videoBotsStreamCreate(...);
50+
} catch (err) {
51+
if (err instanceof GooeyError) {
52+
console.log(err.statusCode);
53+
console.log(err.message);
54+
console.log(err.body);
55+
}
56+
}
57+
```
58+
59+
## Advanced
60+
61+
### Retries
62+
63+
The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
64+
as the request is deemed retriable and the number of retry attempts has not grown larger than the configured
65+
retry limit (default: 2).
66+
67+
A request is deemed retriable when any of the following HTTP status codes is returned:
68+
69+
- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
70+
- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
71+
- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)
72+
73+
Use the `maxRetries` request option to configure this behavior.
74+
75+
```typescript
76+
const response = await client.copilotIntegrations.videoBotsStreamCreate(..., {
77+
maxRetries: 0 // override maxRetries at the request level
78+
});
79+
```
80+
81+
### Timeouts
82+
83+
The SDK defaults to a 60 second timeout. Use the `timeoutInSeconds` option to configure this behavior.
84+
85+
```typescript
86+
const response = await client.copilotIntegrations.videoBotsStreamCreate(..., {
87+
timeoutInSeconds: 30 // override timeout to 30s
88+
});
89+
```
90+
91+
### Aborting Requests
92+
93+
The SDK allows users to abort requests at any point by passing in an abort signal.
94+
95+
```typescript
96+
const controller = new AbortController();
97+
const response = await client.copilotIntegrations.videoBotsStreamCreate(..., {
98+
abortSignal: controller.signal
99+
});
100+
controller.abort(); // aborts the request
101+
```
102+
103+
### Runtime Compatibility
104+
105+
The SDK defaults to `node-fetch` but will use the global fetch client if present. The SDK works in the following
106+
runtimes:
107+
108+
- Node.js 18+
109+
- Vercel
110+
- Cloudflare Workers
111+
- Deno v1.25+
112+
- Bun 1.0+
113+
- React Native
114+
115+
### Customizing Fetch Client
116+
117+
The SDK provides a way for your to customize the underlying HTTP client / Fetch function. If you're running in an
118+
unsupported environment, this provides a way for you to break glass and ensure the SDK works.
119+
120+
```typescript
121+
import { GooeyClient } from "gooey";
122+
123+
const client = new GooeyClient({
124+
...
125+
fetcher: // provide your implementation here
126+
});
127+
```
128+
129+
## Contributing
130+
131+
While we value open-source contributions to this SDK, this library is generated programmatically.
132+
Additions made directly to this library would have to be moved over to our generation code,
133+
otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
134+
a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
135+
an issue first to discuss with us!
136+
137+
On the other hand, contributions to the README are always very welcome!

jest.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/** @type {import('jest').Config} */
2+
module.exports = {
3+
preset: "ts-jest",
4+
testEnvironment: "node",
5+
};

0 commit comments

Comments
 (0)