-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into evan/updown
- Loading branch information
Showing
20 changed files
with
3,019 additions
and
2,672 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,14 @@ | ||
name: CLI (Check) | ||
|
||
on: [push] | ||
|
||
jobs: | ||
# run format, lint, and test | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: oven-sh/setup-bun@v2 | ||
- run: bun install --frozen-lockfile | ||
- run: bun check |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,14 +1,22 @@ | ||
import createClient from "openapi-fetch"; | ||
import createClient, { type Client } from "openapi-fetch"; | ||
import { getAuthToken, loadConfig } from "./helpers/config"; | ||
import type { paths } from "./schema"; // generated by openapi-typescript | ||
|
||
let __client: Client<paths, `${string}/${string}`> | undefined; | ||
|
||
export const apiClient = async () => { | ||
const config = await loadConfig(); | ||
if (__client) { | ||
return __client; | ||
} | ||
|
||
return createClient<paths>({ | ||
const config = await loadConfig(); | ||
__client = createClient<paths>({ | ||
baseUrl: config.api_url, | ||
headers: { | ||
Authorization: `Bearer ${await getAuthToken()}`, | ||
"Content-Type": "application/json", | ||
}, | ||
}); | ||
|
||
return __client; | ||
}; |
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.